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=-3.6 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 39193C433DF for ; Tue, 19 May 2020 13:10:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E2A81206C3 for ; Tue, 19 May 2020 13:10:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="h5BqlN/+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2A81206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 83D40900003; Tue, 19 May 2020 09:10:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EDE9900002; Tue, 19 May 2020 09:10:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DC05900003; Tue, 19 May 2020 09:10:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 551BA900002 for ; Tue, 19 May 2020 09:10:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 14619582A for ; Tue, 19 May 2020 13:10:17 +0000 (UTC) X-FDA: 76833502074.07.feast85_768a5381c013f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id A92191803F9B8 for ; Tue, 19 May 2020 13:10:15 +0000 (UTC) X-HE-Tag: feast85_768a5381c013f X-Filterd-Recvd-Size: 5158 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 May 2020 13:10:14 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id u22so5593067plq.12 for ; Tue, 19 May 2020 06:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=/t5Q76brEmiFOkE+Fa8TY6sSlQLt/nYO/w8O35DojmA=; b=h5BqlN/+Hn9SGQ7i05BQI6KcD+y4PK5BC4LW9aaiaupa6G3aE45naOipKdwg6RCH+z B1aROfQf/swVtAmV9Q3WeWZ6cxIsb+NILK6oCN+zT/pcV6GNvbUxUZShW7odj65ms9R+ xIHvXzL8IXOcwWQWXRWasRMqYVHG+zpsWktfOzu/vaVlJ6dY+5GV5WqPfDhIKy3bmBMI IxR34xfF9zHeKIsmCn0KXpRlOJNbyyejvuM01J+4gWx251icBsDDdvF5y1PkMqlTyBzq k1114wNiX4ZBbXhPocM00mrka6IDLFqrh7hNym8mGF/Qh3XdmakcA4euR3EnadEZskH9 rTpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=/t5Q76brEmiFOkE+Fa8TY6sSlQLt/nYO/w8O35DojmA=; b=t/XCj5Ro3J1yi+es/Ab9sFGuvLM4iPkuCwnRKL2YaXLI07umP0QAAU0s6bFT3K/4N9 vy6n67a5jwZnY/nqDA3Pi/fE8/0oTPyJPl26pS8svuJmj69DP8Ii88Ij+oSbaF7z9bTS 9u/i8zW7ykpAcpVX/IaDNrUcXSPj+W1ogaCAI3DVwBDtF0WP+DNocxeD4TRwRI9jPmEE IHRzbWpIbgdWVDTwjRfgnpLQTp2Z+IT5ur9jqYcy5UC8lT7DJQpswM0RJSilFDKmXEv0 HLf2xQpVtGGiHK1iCLKN48DoH0KePNwpMRCLLwhVT0J2aTHK59Jq8zxcolRMpwLrlqBg Vthw== X-Gm-Message-State: AOAM533V//qoQIE/lr+AMEKMC7lHu/npEjPVVdGw5G+zSnGPw7jOHi+4 vuRkGjaC/6iVgTfxIm93uq5JCg== X-Google-Smtp-Source: ABdhPJyRXNx07N2fTf9QLSdqn0WHYd/NSH1ZR/mcHjoNMJ6OQpXvCcLfl4Fg32pYTm7gQbAm2QJ0Sg== X-Received: by 2002:a17:902:d693:: with SMTP id v19mr15203765ply.288.1589893813434; Tue, 19 May 2020 06:10:13 -0700 (PDT) Received: from google.com ([2620:15c:2cd:202:2523:d194:de3b:636f]) by smtp.gmail.com with ESMTPSA id 7sm8757569pfc.203.2020.05.19.06.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:10:11 -0700 (PDT) Date: Tue, 19 May 2020 06:10:09 -0700 From: Michel Lespinasse To: Laurent Dufour Cc: Matthew Wilcox , Andrew Morton , linux-mm , LKML , Peter Zijlstra , Vlastimil Babka , Liam Howlett , Jerome Glisse , Davidlohr Bueso , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Daniel Jordan Subject: Re: [PATCH v5.5 10/10] mmap locking API: rename mmap_sem to mmap_lock Message-ID: <20200519131009.GD189720@google.com> References: <20200422001422.232330-1-walken@google.com> <20200422001422.232330-11-walken@google.com> <20200422015829.GR5820@bombadil.infradead.org> <20200423015917.GA13910@bombadil.infradead.org> <20200424012612.GA158937@google.com> <20200424013958.GC158937@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable 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 Mon, May 18, 2020 at 03:45:22PM +0200, Laurent Dufour wrote: > Le 24/04/2020 =E0 03:39, Michel Lespinasse a =E9crit=A0: > > Rename the mmap_sem field to mmap_lock. Any new uses of this lock > > should now go through the new mmap locking api. The mmap_lock is > > still implemented as a rwsem, though this could change in the future. > >=20 > > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/= etnaviv/etnaviv_gem.c > > index dc9ef302f517..701f3995f621 100644 > > --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c > > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c > > @@ -661,7 +661,7 @@ static int etnaviv_gem_userptr_get_pages(struct e= tnaviv_gem_object *etnaviv_obj) > > struct etnaviv_gem_userptr *userptr =3D &etnaviv_obj->userptr; > > int ret, pinned =3D 0, npages =3D etnaviv_obj->base.size >> PAGE_S= HIFT; > > - might_lock_read(¤t->mm->mmap_sem); > > + might_lock_read(¤t->mm->mmap_lock); >=20 > Why not a mm_might_lock_read() new API to hide the mmap_lock, and add i= t to > the previous patch? I'm not sure why this is needed - we may rework the lock to be something else than rwsem, but might_lock_read should still apply to it and make sense ? I'm not sure what the extra API would bring... --=20 Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.