From owner-svn-src-head@freebsd.org Wed Mar 15 18:06:34 2017 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 6CCD8D0D820; Wed, 15 Mar 2017 18:06:34 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 489591D1D; Wed, 15 Mar 2017 18:06:33 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v2FGPwuv018263; Wed, 15 Mar 2017 13:06:27 -0500 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp1.rice.edu with ESMTP id 29794h82gg-1; Wed, 15 Mar 2017 13:06:27 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id EBAD350015F; Wed, 15 Mar 2017 13:06:26 -0500 (CDT) Subject: Re: svn commit: r315318 - in head/sys: kern vm To: Benjamin Kaduk , Alan Cox References: <201703151743.v2FHhjLn066656@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Alan Cox Message-ID: <4fd159d0-6509-98a9-7af0-6efada1def26@rice.edu> Date: Wed, 15 Mar 2017 13:06:26 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=12 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 15 Mar 2017 18:06:34 -0000 On 03/15/2017 12:59, Benjamin Kaduk wrote: > Should __FreeBSD_version be bumped, e.g., for out-of-tree filesystems > that have custom vop_advise? No, I don't think so. > On Wed, Mar 15, 2017 at 12:43 PM, Alan Cox > wrote: > > Author: alc > Date: Wed Mar 15 17:43:45 2017 > New Revision: 315318 > URL: https://svnweb.freebsd.org/changeset/base/315318 > > > Log: > Relax the locking requirements for vm_object_page_noreuse(). While > reviewing all uses of OFF_TO_IDX(), I observed that > vm_object_page_noreuse() is requiring an exclusive lock on the > object > when, in fact, a shared lock suffices. > > Reviewed by: kib, markj > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D10011 > > > Modified: > head/sys/kern/vfs_default.c > head/sys/vm/vm_object.c > > Modified: head/sys/kern/vfs_default.c > ============================================================================== > --- head/sys/kern/vfs_default.c Wed Mar 15 17:26:19 2017 > (r315317) > +++ head/sys/kern/vfs_default.c Wed Mar 15 17:43:45 2017 > (r315318) > @@ -1100,10 +1100,10 @@ vop_stdadvise(struct vop_advise_args *ap > if (vp->v_object != NULL) { > start = trunc_page(ap->a_start); > end = round_page(ap->a_end); > - VM_OBJECT_WLOCK(vp->v_object); > + VM_OBJECT_RLOCK(vp->v_object); > vm_object_page_noreuse(vp->v_object, > OFF_TO_IDX(start), > OFF_TO_IDX(end)); > - VM_OBJECT_WUNLOCK(vp->v_object); > + VM_OBJECT_RUNLOCK(vp->v_object); > } > > bo = &vp->v_bufobj; > > Modified: head/sys/vm/vm_object.c > ============================================================================== > --- head/sys/vm/vm_object.c Wed Mar 15 17:26:19 2017 > (r315317) > +++ head/sys/vm/vm_object.c Wed Mar 15 17:43:45 2017 > (r315318) > @@ -1978,7 +1978,7 @@ vm_object_page_noreuse(vm_object_t objec > struct mtx *mtx, *new_mtx; > vm_page_t p, next; > > - VM_OBJECT_ASSERT_WLOCKED(object); > + VM_OBJECT_ASSERT_LOCKED(object); > KASSERT((object->flags & (OBJ_FICTITIOUS | OBJ_UNMANAGED)) > == 0, > ("vm_object_page_noreuse: illegal object %p", object)); > if (object->resident_page_count == 0) > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to > "svn-src-all-unsubscribe@freebsd.org > " > >