From owner-freebsd-testing@FreeBSD.ORG Thu Mar 6 14:16:35 2014 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24F48E49 for ; Thu, 6 Mar 2014 14:16:35 +0000 (UTC) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D24F7A0F for ; Thu, 6 Mar 2014 14:16:34 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id r5so2871797qcx.18 for ; Thu, 06 Mar 2014 06:16:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Y3jQbOccKpEgXy5qsMKMFjgCpqVxG3ljNpn4XLEx8rM=; b=A0vClPz2wxhQEXFd3UP7ISJV/tadCdgdohGj2CCLsNHC4bt7u9JnHLCbsS0F8MOYXx D5HSkHKxzDP0MT9LvZtqgdkFe5SrkHKeVF0lCe4h3v4XRyzrYdW/os3D4AIIiV0/YsG1 99RDpp8sNtcG1C+1AwWxqH2FPPb9dxH6eWmfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=Y3jQbOccKpEgXy5qsMKMFjgCpqVxG3ljNpn4XLEx8rM=; b=We+pkBdbLVAPBoXJGd9Li24k3/CiEzeRn1qv3rZAGGJ8Cvh0+0JCY1sjBEAxTPsJIw mOFmxR8Snr//S0axk7jdlEX7YLplswQY68UoRLP2o+aZ31fPR4g3YmVRokeI5opqtqE6 vDtBcHcgheDzdewZXs0YybiMh6v9CJh1q2mM1ZFjyLQZiBdlv34xN3nXjPytMEfsEOj0 ay7Tsrf/4+jnT3IZVmXMdW81xb1cjtz7fEqZl+f+ynQS3zVuLvi8eloSiiP8PCf0djDH MNTqQhpt/ek2vuCxToDD5meBOxpPHtM6JC+g975GMY2CPTbA1loB436Cw88eAYUf/C3e LAHw== X-Gm-Message-State: ALoCoQmvaYIxpiTU2WeX/7BC8/9u/VLaXwPpUKl12wQB+UUxvI1OdkuyxWqqKpfmO9STfmD9KWUy X-Received: by 10.224.80.70 with SMTP id s6mr9677261qak.44.1394115388673; Thu, 06 Mar 2014 06:16:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.147.225 with HTTP; Thu, 6 Mar 2014 06:15:58 -0800 (PST) In-Reply-To: <20140306112322.GA10664@x2.osted.lan> References: <20140305085806.GA70478@x2.osted.lan> <20140306112322.GA10664@x2.osted.lan> From: Eitan Adler Date: Thu, 6 Mar 2014 09:15:58 -0500 Message-ID: Subject: Re: Test scenario for sysctl kern.maxfiles To: Peter Holm Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-testing@freebsd.org" X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 14:16:35 -0000 On 6 March 2014 06:23, Peter Holm wrote: > On Wed, Mar 05, 2014 at 10:08:49AM -0700, Alan Somers wrote: >> On Wed, Mar 5, 2014 at 1:58 AM, Peter Holm wrote: >> > Here's an attempt to verify that increasing kern.maxfiles works as >> > expected. >> > >> > http://people.freebsd.org/~pho/kern_descrip_test-v3.diff >> > -- >> > Peter >> >> 1) done should be of type "static volatile sig_atomic_t", not int, >> because it's set by signal handlers. >> > > Yes, that is nicer (I learned something new today :-). But the use > here works because there is a call to usleep(3) after each test, > forcing the compiler to reload the "done" variable. That isn't what sig_atomic_t is trying to prevent. It is an ""integer type of an object that can be accessed as an atomic entity, even in the presence of asynchronous interrupts."". In particular, on some machines it would be possible for the signal handler to observe a half-updated "int" type variable. On i386 sig_atomic_t happens to be an "int". On amd64 it happens to be a long. This is not contractual. -- Eitan Adler