From owner-svn-src-all@FreeBSD.ORG Tue Aug 26 13:55:29 2014 Return-Path: Delivered-To: svn-src-all@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 071DDB81; Tue, 26 Aug 2014 13:55:29 +0000 (UTC) Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) (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 02C8839B9; Tue, 26 Aug 2014 13:55:27 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id w61so14704368wes.25 for ; Tue, 26 Aug 2014 06:55:26 -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=rcyKkkHKRFKy7o081gftNB6MS36+fW3ymsmoIJ9wfc0=; b=xCj1nOoFmWrW0VrQcbnoFEzPIK+d8TPVawK73K1M5ZaopAjxVHvIpQW5kOt/iWI3iw bpBo95ZKYzoUS+3OrqJff134tnvoO9WDErv8l9O+m5fWB0ympMnWkCqBRH4gd5TCdivs 3HkogZAw7u+6VjLyPbl1/rjzPTBm4LYwnXts0ya2s03VB01CjVHNwoTCGw82806yESKT GHoI0jpZm7yH0FamdNEZUXLqx2G6Ou2fwh4wxytvKKlOeyWPySqTpXpx0NwLtmhpUpBy HIKNopN+m/3p3sWCMrXa2WoeJYj3c3BwQvU+IE5NAlgP9Oeys8NDHdWUrFjR8kYXT8Ke s/Cw== X-Received: by 10.194.119.41 with SMTP id kr9mr2525670wjb.114.1409061326098; Tue, 26 Aug 2014 06:55:26 -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 lz1sm2642544wic.24.2014.08.26.06.55.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 26 Aug 2014 06:55:25 -0700 (PDT) Date: Tue, 26 Aug 2014 15:55:22 +0200 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r270648 - in head/sys: kern sys Message-ID: <20140826135522.GA10544@dft-labs.eu> References: <201408260817.s7Q8HMMT044455@svn.freebsd.org> <201408260945.39017.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201408260945.39017.jhb@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, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2014 13:55:29 -0000 On Tue, Aug 26, 2014 at 09:45:38AM -0400, John Baldwin wrote: > On Tuesday, August 26, 2014 4:17:22 am Mateusz Guzik wrote: > > Author: mjg > > Date: Tue Aug 26 08:17:22 2014 > > New Revision: 270648 > > URL: http://svnweb.freebsd.org/changeset/base/270648 > > > > Log: > > Fix up races with f_seqcount handling. > > > > It was possible that the kernel would overwrite user-supplied hint. > > > > Abuse vnode lock for this purpose. > > > > In collaboration with: kib > > MFC after: 1 week > > Do we care about this being correct enough to penalize reads by single- > threading them? This is just an optimization, if you lose the race it doesn't > actually break anything. > We don't singlethread reads, vnode is locked exactly as it was previously. What changes is that a rarely used (as compared to reads) function playing with f_seqcount now takes exclusive lock. If anything, this is an optimization since it removes an unnecessary load_acq. -- Mateusz Guzik