From owner-svn-src-head@freebsd.org Wed Mar 15 17:59:30 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 47CB6D0D46D; Wed, 15 Mar 2017 17:59:30 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x233.google.com (mail-ot0-x233.google.com [IPv6:2607:f8b0:4003:c0f::233]) (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 15CEF1588; Wed, 15 Mar 2017 17:59:30 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x233.google.com with SMTP id x37so27775310ota.2; Wed, 15 Mar 2017 10:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JPen19aQ+S6AwjZ8vzodPaRUI17C8y8SPoTBYxhRwr0=; b=AeZWma2u5bY9SboLbGy1rw8XbSFCIF1spVqkqfoZQYriYkAYxDcrc7P3Xv+MsiwJy3 P/U+6DdZ4FRzYvqMpP/XKa69+e+Ea6yIQr3mHA2LjaHqtkgzw4x+3QWNdz7IYE90VTHg xaF0HZ9JZ4d3C/LWbludM0ptuybJh/f8wweby+Idf1iJArI5TcAJBUvBp9gVIaSGQMqk EHV5Sa3+Fq1TXG9NmecfrXMLe5zP5+lUCEhde9ixr6rUBQDShQC8Fdnocz+THL2LySu2 7F8aOo3IIUgj82865JlbJQ2eWWqkG3B69t/ONMNqa13CcxCK+BEMHB76XNopY4kKKUF4 i0Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JPen19aQ+S6AwjZ8vzodPaRUI17C8y8SPoTBYxhRwr0=; b=NGXXS2yAoriP0SpfLpM8xdh5ovU+eChawbdNT6JM3rDBLd/DejogMwgKp++1Mtyg5h wY7+eoRb1JtHN370RQl/m5TlVpkfKJHxNobAUrLpo3bV1Ole+1ypjLv+14UNf6vspPoG IIuYzR6ipuaL2U6rZ4cx79yQKvOmfrziY6RWT0hbUJxqfygFtDbMww+2iFmbWT5GUMdM vBN3v53gi+BMcpTB9nbeRCNdrZ+khMMd2lAwYZNsSOELlpXtbimFQQBaRIhv4VisEIJ9 25BsO/CtI+C4D+/faENpWbKu0F6HJlHpOm3Txx0E8qWS49oavFlVOqskqMcLPmdQXmme uISA== X-Gm-Message-State: AFeK/H3ikQpuRUU/vQeG4Cy+ry/ws3kCQ7DdBSQ+Hnda9lj2fgY9vz5rKnZbUovGz9EKzv09s9Hu5qbS17C1IA== X-Received: by 10.202.216.8 with SMTP id p8mr2398857oig.109.1489600768900; Wed, 15 Mar 2017 10:59:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.88.138 with HTTP; Wed, 15 Mar 2017 10:59:28 -0700 (PDT) In-Reply-To: <201703151743.v2FHhjLn066656@repo.freebsd.org> References: <201703151743.v2FHhjLn066656@repo.freebsd.org> From: Benjamin Kaduk Date: Wed, 15 Mar 2017 12:59:28 -0500 Message-ID: Subject: Re: svn commit: r315318 - in head/sys: kern vm To: Alan Cox Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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 17:59:30 -0000 Should __FreeBSD_version be bumped, e.g., for out-of-tree filesystems that have custom vop_advise? -Ben 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" >