From owner-svn-src-head@FreeBSD.ORG Wed Oct 1 15:40:12 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 E422F19C; Wed, 1 Oct 2014 15:40:11 +0000 (UTC) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com [IPv6:2a00:1450:4010:c04::232]) (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 DA59D95D; Wed, 1 Oct 2014 15:40:10 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id w7so583324lbi.23 for ; Wed, 01 Oct 2014 08:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tpSHQ58/PnsARP0x6KHi4vxxbWpS3urSic2Ig2Djnuw=; b=hTownlW+EFANCmJM+vhTUQAAoN8AMzO2WA47v2BMhk5dHvHT0tgsNb8mNqeb7qu+kT /FzG65bl6GNPk8FQrpY5j/uA+P6fywAdB/hKX8cnXDgD/QFzYlkpCV0O3MrQn4H/nMZG r8kfWbKuSn21AUXekPM4FZQnIdLaEjuYd3Kuh9vz/qiUnFhXK619RCAtERyvPDE5RZop 80VjHmPZBMtGfsMfbUwysRarhpVHrRTHnSeveT25ZRQGquDBzOdQ/WjqmGw2dAkuHFRh 8F6gipG4fIIlfcmtOssPxfUG65YhJegEdOEsQqM5dNP0c1iHko2ct9pKz6G86owj341Q unMQ== MIME-Version: 1.0 X-Received: by 10.152.19.167 with SMTP id g7mr6787950lae.31.1412178008770; Wed, 01 Oct 2014 08:40:08 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.25.207.74 with HTTP; Wed, 1 Oct 2014 08:40:08 -0700 (PDT) In-Reply-To: <201410011532.s91FWTZL050853@svn.freebsd.org> References: <201410011532.s91FWTZL050853@svn.freebsd.org> Date: Wed, 1 Oct 2014 08:40:08 -0700 X-Google-Sender-Auth: MinPZJwDnONacQ5PsdGqrdTlF24 Message-ID: Subject: Re: svn commit: r272366 - head/sys/kern From: Davide Italiano To: Will Andrews Content-Type: text/plain; charset=UTF-8 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 15:40:12 -0000 On Wed, Oct 1, 2014 at 8:32 AM, 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). > > 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) > I introduced something like this back in the days when I was at iX but never convinced myself this is completely safe -- I assume you investigated about possible races opened by releasing the syncer mutex, and I would be happy if you can elaborate a bit more. -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare