From owner-freebsd-current@FreeBSD.ORG Sat Apr 14 18:11:35 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id AA9351065670; Sat, 14 Apr 2012 18:11:35 +0000 (UTC) Date: Sat, 14 Apr 2012 18:11:35 +0000 From: Alexander Best To: Robert Huff , freebsd-current@freebsd.org Message-ID: <20120414181135.GA94130@freebsd.org> References: <20120414090728.GA8798@felucia.tataz.chchile.org> <20361.29886.740093.455933@jerusalem.litteratus.org> <20120414150253.GB71196@felucia.tataz.chchile.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120414150253.GB71196@felucia.tataz.chchile.org> Cc: Subject: Re: howto debug a complete hard reset X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 18:11:35 -0000 On Sat Apr 14 12, Jeremie Le Hen wrote: > On Sat, Apr 14, 2012 at 08:59:42AM -0400, Robert Huff wrote: > > > > > This is probably a sysctl handler that is causing the reboot. You can > > > run this one-liner to spot the culprit (use sh): > > > > > > for i in $(sysctl -Na); do sysctl $i >> ~/sysctl.out; sync; done > > > > > > Each sysctl will be called in turn and the output is appended to > > > a file, but the file will forcibly written to the disk before the > > > next occurence. > > > > Um ... it is my understanding sync(8) does not guarantee > > pending i/o will be written before it returns, but merely requests > > this happen irrespective of when it would normally occur. > > An I mistaken? > > Honestly I don't know, but I have do admit that the small paragraph in > the BUGS section of the sync(2) manpage is a little bit shivering: > > BUGS > The sync() system call may return before the buffers are completely > flushed. > > > Can any enlightened person answer this? sync(2) does REQUEST an immediate write to disk. however for this to actually be the case, one has to disable softupdates and disable the write cache of that particular disk. the write cache of hdds is enabled by default, because disabling it will give you a huge performance drop. there's a small section about this in tuning(7). cheers. alex ps: SU+J also mustn't be enabled for immediate writes to happen. > > -- > Jeremie Le Hen > > Men are born free and equal. Later on, they're on their own. > Jean Yanne