From owner-svn-src-all@FreeBSD.ORG Sun Jul 6 21:39:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24C7519C; Sun, 6 Jul 2014 21:39:06 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (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 415DC27E6; Sun, 6 Jul 2014 21:39:05 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id x12so3479317wgg.22 for ; Sun, 06 Jul 2014 14:39:03 -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=VjcKwX9AOKst+tGM50y2Jh69XF4m+4zZQQPGWCbBf7U=; b=Prr+Q0oY5uagNC1JgAoZBde305Zm1OfYUG2U3uD/gzMN5n3wnnLrVV2HfsWGgpIJRr HWyz9o54g1TBixm+79/0U35uOJvz+r/jk6WrbCigSNIEP/rdkKt50A+UNwWAA3yoWJ2k awMGm7pA/m0ILRDAMOzcIL5IR7vz68N1w/pc4ok3oEmY4s8DA/uaErYM0ihnrMtu82Tb ghll8v144bRHA29VFVB4YAEEqrPH0FbpuJY4eLBZrKkAUlaBddHHZigJkXh/Sfxwke8x bYkBOZ29tXCcDrlsuqp3AIKOBkEoXrkA0FBjGvQkFNexDLXFKXdTjJf1DqfMoURxA0Fu u6ug== X-Received: by 10.180.221.162 with SMTP id qf2mr31572838wic.75.1404682743474; Sun, 06 Jul 2014 14:39:03 -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 ja9sm107325573wic.8.2014.07.06.14.39.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 06 Jul 2014 14:39:02 -0700 (PDT) Date: Sun, 6 Jul 2014 23:39:00 +0200 From: Mateusz Guzik To: Konstantin Belousov Subject: Re: svn commit: r268087 - head/sys/kern Message-ID: <20140706213900.GB17706@dft-labs.eu> References: <201407010921.s619LXHL063077@svn.freebsd.org> <20140701114245.GO93733@kib.kiev.ua> <20140701115612.GA26696@dft-labs.eu> <20140701123058.GP93733@kib.kiev.ua> <20140701125410.GB26696@dft-labs.eu> <20140701180903.GT93733@kib.kiev.ua> <20140706211850.GA17706@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140706211850.GA17706@dft-labs.eu> 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 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: Sun, 06 Jul 2014 21:39:06 -0000 On Sun, Jul 06, 2014 at 11:18:51PM +0200, Mateusz Guzik wrote: > On Tue, Jul 01, 2014 at 09:09:03PM +0300, Konstantin Belousov wrote: > > On Tue, Jul 01, 2014 at 02:54:10PM +0200, Mateusz Guzik wrote: > > > It is passed down to MAC (mac_vnode_execve_will_transition and > > > mac_vnode_execve_transition) and then vfs_mark_atime. > > And we can lock it only there. > > > > I don't see how this code could be reorganized to reduce vnode lock > coverage and not add unlock + lock pair to the common case (no hwpmc and > no credential change). > > vfs_mark_atime is only called when execve cannot return an error > anymore, with vnode locked and proc unlocked. Moving it before hwpmc > checks would require additional pair of proc unlock/lock. > > That said, I would prefer to just commit previously proposed fixup. > hm, I only now notice that fexecve case does: vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY) I guess this can be safely changed to LK_SHARED. -- Mateusz Guzik