From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 18:18:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A973339; Wed, 1 Oct 2014 18:18:32 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 675A2FFE; Wed, 1 Oct 2014 18:18:31 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id y10so1230797wgg.3 for ; Wed, 01 Oct 2014 11:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9WWRYynxxFcFE4u8IYCLLFA7VMjbHQKPYGWYZ6fFDfk=; b=JC8SBfnyY5IcwOdcbd82rAnWf67KkeiGG1KKGtePvJamVpw2hO99/3ScZfSF5bSNQ1 IN3KciW1LHk/RghZPlzrKM92H1+cTtQCUhgvM7FrhjqHryW8vE6SI1DqLk85+JaqIGK6 p+GgCYbBgh8J4ntwoDDTMEXYeuDWntF0RvKweCNygiemJDTyu52N+QPQidRx3P1ejKdf b0tpjEm2Yb/UzVw8oWO59l+slBI1JZgOxX73J7eaHDb6hpbQXcpytVm3DrMVxaEjLRsL pyglAt4wApVx7cLocu8VDMfVZp8R+mee1s2/ijg1fktOTFdzOvsKL0+aFUzlBctiF+pX E04A== X-Received: by 10.180.211.36 with SMTP id mz4mr16580331wic.39.1412187509243; Wed, 01 Oct 2014 11:18:29 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id ji10sm19390178wid.7.2014.10.01.11.18.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 11:18:28 -0700 (PDT) Date: Wed, 1 Oct 2014 20:18:25 +0200 From: Mateusz Guzik To: Will Andrews Subject: Re: svn commit: r272366 - head/sys/kern Message-ID: <20141001181825.GA16048@dft-labs.eu> References: <201410011532.s91FWTZL050853@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201410011532.s91FWTZL050853@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 18:18:32 -0000 On Wed, Oct 01, 2014 at 03:32:29PM +0000, Will Andrews wrote: > Author: will > Date: Wed Oct 1 15:32:28 2014 > New Revision: 272366 > URL: https://svnweb.freebsd.org/changeset/base/272366 > > Log: > In the syncer, drop the sync mutex while patting the watchdog. > > Some watchdog drivers (like ipmi) need to sleep while patting the watchdog. > See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK). > Is not such malloc inherently bad in case of watchdog? It looks like the code waits for request completion and then frees it unconditionally. As such, a local var on stack would do the trick. The code msleeps later, so this hack of dropping sync_mtx is still needed. > Submitted by: asomers > MFC after: 1 month > Sponsored by: Spectra Logic > MFSpectraBSD: 637548 on 2012/10/04 > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Wed Oct 1 15:23:23 2014 (r272365) > +++ head/sys/kern/vfs_subr.c Wed Oct 1 15:32:28 2014 (r272366) > @@ -1863,8 +1863,15 @@ sched_sync(void) > continue; > } > > - if (first_printf == 0) > + if (first_printf == 0) { > + /* > + * Drop the sync mutex, because some watchdog > + * drivers need to sleep while patting > + */ > + mtx_unlock(&sync_mtx); > wdog_kern_pat(WD_LASTVAL); > + mtx_lock(&sync_mtx); > + } > > } > if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0) > -- Mateusz Guzik