Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1340393ybz; Wed, 22 Apr 2020 19:03:07 -0700 (PDT) X-Google-Smtp-Source: APiQypK3+oKjl/+OpIF+dyIkcw7Nn0vI+dJZE5mipeFwgQsWzgBcRK0C4XQVFHeQz0rhGNJL4ugu X-Received: by 2002:a50:fc82:: with SMTP id f2mr1015571edq.38.1587607387072; Wed, 22 Apr 2020 19:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587607387; cv=none; d=google.com; s=arc-20160816; b=i//mokQs/5R48FUoc5pMJSsZMbRGAoMwGIiK3jVIgOvXKugSiwMestFzXsr+0OkbjN nlXG0SGZKi3dRUhF3Achp9nUrgtlSczr1+yIB6q+Nsyj3eYo+EiibFznZE1Ysy/TElDM fob9EncI6GAr13syzUFqwisMYwG6mDdhoDGXfLjex2+/Pdb86McX13cWnd3hbyqX4kuO yeIwPaSKPTBwU19xhwxJYGwb3xtq8prWC6iwRwsFkVXEhgoMv1YugV+8Fnng+AQFVJmD uqKz0VGSVYdQOfPLoZheI0Sds1/n0JxM/h8hWFdxCEi9OVCByc2r+iwXlTG6XrtIjTSe vSOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HhOesuEDxibfK6S65js7amlCplnHInNR5VyiDvIuF4g=; b=cdpq+sFd0IQCj0fUeg7e18kSukxW06SO9mBb+XCuWFWvvBwP3/4egeVDvaMIId/UJh OmR4BzULap+nkwQ3b7z7Sgd5c7TGKktK1CDpGh5atR2lkqlUeHzeXoJNdUZ6Izm9TO6Q /Y1ZAS4IWbnP4wWtMUfDT24CdCTGb1PdkedKOPFm5Kdw9KFQ599NfoMMA5MPm3FFVoD8 VLW7ZJL1GED5Ej3Uda87P0DoH4XFaQoMOVgps/Xa2wa6QnYcxSMybl1DIJPCXnUZ6eG8 Y+cYjjk/DCvL5XclGxa6Zstx4PzJLM21jmZ1kLmLurWyJ75E+D27ZH9fk+5vLOmmk73R t5DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=czkNk+sm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si400786edq.517.2020.04.22.19.02.45; Wed, 22 Apr 2020 19:03:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=czkNk+sm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbgDWB70 (ORCPT + 99 others); Wed, 22 Apr 2020 21:59:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbgDWB70 (ORCPT ); Wed, 22 Apr 2020 21:59:26 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BDC5C03C1AA for ; Wed, 22 Apr 2020 18:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HhOesuEDxibfK6S65js7amlCplnHInNR5VyiDvIuF4g=; b=czkNk+smvOu1E/3PuI9KKGloew qzx6uhdq/lK9HujSyydA+abTHL3ctT0kIfMhgpbP2COqLcsNmf/UG29OxMsAJHtJHjTXZ6wiF29f9 cYKnIVtzIC9lRhuczHj3v4VmD8Ap4pdlK4xCyyZGPcdUupzDKmnhlvH3JdoQmAJyeU01+aWywksi8 bPRxZmlEqE4Wy46wiCC8jz88l4YeKTQni4kAewldndXgSeKwmddy0hwweP0+x05EwNEicaIYGLHGg uVw8nh1dow367QtERsMonyp2pg14F0MWYvCEdg7B6ujdtErND+YC476UfBTCb9M4EZnBi+wQ6F8Sn EKtHzYoQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRR93-0006gc-8R; Thu, 23 Apr 2020 01:59:17 +0000 Date: Wed, 22 Apr 2020 18:59:17 -0700 From: Matthew Wilcox To: Michel Lespinasse Cc: Andrew Morton , linux-mm , LKML , Peter Zijlstra , Laurent Dufour , Vlastimil Babka , Liam Howlett , Jerome Glisse , Davidlohr Bueso , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Daniel Jordan Subject: Re: [PATCH v5 10/10] mmap locking API: rename mmap_sem to mmap_lock Message-ID: <20200423015917.GA13910@bombadil.infradead.org> References: <20200422001422.232330-1-walken@google.com> <20200422001422.232330-11-walken@google.com> <20200422015829.GR5820@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 03:54:32PM -0700, Michel Lespinasse wrote: > On Tue, Apr 21, 2020 at 6:58 PM Matthew Wilcox wrote: > > > > On Tue, Apr 21, 2020 at 05:14:22PM -0700, Michel Lespinasse wrote: > > > Rename the mmap_sem field to mmap_lock. Any new uses of this lock > > > > Shouldn't some of these be folded into the previous patch? > > So, I didn't do it because previous patch only handled rwsem_is_locked > call sites. I leaned towards adding as few new API functions as > possible until we figure out exactly what is required. > > That said, I agree it seems reasonable to split mmap_assert_locked() > into mmap_assert_read_locked() and mmap_assert_write_locked(), and > convert the lockdep asserts to use these instead. Just add mmap_assert_write_locked() -- some of these places can be called with the rwsem held for either read or write; it doesn't matter which. Others need it held for write. There aren't any places (that I'm aware of) that need to assert that it's held for read, and not held for write. > I'm not sure we need to do it right away though; we are at least not > losing any test coverage with the existing version of the patchset... It seems like a better way to remove users of the term 'mmap_sem' than just converting them to use the new 'mmap_lock'.