Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2017 13:06:26 -0500
From:      Alan Cox <alc@rice.edu>
To:        Benjamin Kaduk <bjkfbsd@gmail.com>, Alan Cox <alc@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r315318 - in head/sys: kern vm
Message-ID:  <4fd159d0-6509-98a9-7af0-6efada1def26@rice.edu>
In-Reply-To: <CAJ5_RoCZKumshQ_17g5qqH2Q2A5s=NzMmThxOurJkGhU=mogyA@mail.gmail.com>
References:  <201703151743.v2FHhjLn066656@repo.freebsd.org> <CAJ5_RoCZKumshQ_17g5qqH2Q2A5s=NzMmThxOurJkGhU=mogyA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <alc@freebsd.org
> <mailto:alc@freebsd.org>> wrote:
>
>     Author: alc
>     Date: Wed Mar 15 17:43:45 2017
>     New Revision: 315318
>     URL: https://svnweb.freebsd.org/changeset/base/315318
>     <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
>     <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 <mailto:svn-src-all@freebsd.org> mailing list
>     https://lists.freebsd.org/mailman/listinfo/svn-src-all
>     <https://lists.freebsd.org/mailman/listinfo/svn-src-all>;
>     To unsubscribe, send any mail to
>     "svn-src-all-unsubscribe@freebsd.org
>     <mailto:svn-src-all-unsubscribe@freebsd.org>"
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4fd159d0-6509-98a9-7af0-6efada1def26>