From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED9F2C55185 for ; Thu, 23 Apr 2020 01:59:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ACB9E2075A for ; Thu, 23 Apr 2020 01:59:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="czkNk+sm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACB9E2075A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 43A538E0008; Wed, 22 Apr 2020 21:59:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EA878E0003; Wed, 22 Apr 2020 21:59:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FF128E0008; Wed, 22 Apr 2020 21:59:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id 170678E0003 for ; Wed, 22 Apr 2020 21:59:24 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C5B2D8248076 for ; Thu, 23 Apr 2020 01:59:23 +0000 (UTC) X-FDA: 76737462606.23.verse17_17c2c06e1bd45 X-HE-Tag: verse17_17c2c06e1bd45 X-Filterd-Recvd-Size: 3571 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 01:59:23 +0000 (UTC) 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: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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'.