From owner-svn-src-head@freebsd.org Wed Dec 16 17:44:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AB7A48D44; Wed, 16 Dec 2015 17:44:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66B0E1068; Wed, 16 Dec 2015 17:44:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22c.google.com with SMTP id to18so58538045igc.0; Wed, 16 Dec 2015 09:44:32 -0800 (PST) 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=VazcnaIPQyF23xU9XEPbHhG3JhFFO3QPy7+jfH/+chY=; b=v9gm67fY1eBSctVCaVFrDkZzw+h3Dnt0EqXJZ67swuV2gmWbSYKDqOh1zeSTlGWw8G 9Zv2i2t2ZJrQZJtSaFEb8ShUr/qhvMX3ePaVhnZHR8N4HSt93E1QXmixxrZ4pHUYiMMX b4sJPWbecRmMFgmpWqGRWmwKm0YVmJ1antUNEH7SsYwKO1cunxhdJxjUiwGiHG789ST+ vqC93/fD/nY0rTGj/2ysATaLxLzy6M0H3n9H2k4AaZxxpNw0V+wwJvp50rsubNE+58VA JJMZC1KdyzBzRQA4m3ZpCGDJWwUeaQTfBRoggl7vY2pydbik9G+4v89nizN5dpjRf5WQ rmug== MIME-Version: 1.0 X-Received: by 10.107.10.199 with SMTP id 68mr41104471iok.75.1450287871855; Wed, 16 Dec 2015 09:44:31 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Wed, 16 Dec 2015 09:44:31 -0800 (PST) In-Reply-To: <20151216080154.GP3625@kib.kiev.ua> References: <201512160013.tBG0DGhd048910@repo.freebsd.org> <20151216080154.GP3625@kib.kiev.ua> Date: Wed, 16 Dec 2015 09:44:31 -0800 X-Google-Sender-Auth: Ju4Qxxd74R12lDVg_P5143SEndQ Message-ID: Subject: Re: svn commit: r292299 - head/sys/kern From: Adrian Chadd To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 16 Dec 2015 17:44:32 -0000 On 16 December 2015 at 00:01, Konstantin Belousov wrote: > On Wed, Dec 16, 2015 at 12:13:16AM +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Wed Dec 16 00:13:16 2015 >> New Revision: 292299 >> URL: https://svnweb.freebsd.org/changeset/base/292299 >> >> Log: >> Don't call wakeup if we're just returning reserved space; just >> return the reservation and wait for more space to appear. > Issue which is supposedly fixed by the commit is not due to the possibly > excessive wakeups. bufspace_release() and bufspace_wakeup() clear > the needsbuffer variable, while the code flow in getnewbuf() calls > bufspace_wait() to wait for the condition, which prevented the buffer > allocation from succeeding, to pass. Right. There's still some more work to do there to chase issues down so I can remove that sched_yield() workaround I added. > >> >> Submitted by: jeff >> Reviewed by: kib >> >> Modified: >> head/sys/kern/vfs_bio.c >> >> Modified: head/sys/kern/vfs_bio.c >> ============================================================================== >> --- head/sys/kern/vfs_bio.c Wed Dec 16 00:09:57 2015 (r292298) >> +++ head/sys/kern/vfs_bio.c Wed Dec 16 00:13:16 2015 (r292299) >> @@ -2909,7 +2909,7 @@ getnewbuf(struct vnode *vp, int slpflag, >> } while(buf_scan(false) == 0); >> >> if (reserved) >> - bufspace_release(maxsize); >> + atomic_subtract_long(&bufspace, maxsize); >> if (bp != NULL) { >> bp->b_flags |= B_INVAL; >> brelse(bp); >