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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 D9FCFC433E0 for ; Tue, 19 May 2020 13:21:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE33120823 for ; Tue, 19 May 2020 13:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728894AbgESNVn (ORCPT ); Tue, 19 May 2020 09:21:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42888 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726471AbgESNVn (ORCPT ); Tue, 19 May 2020 09:21:43 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04JD3drg070898; Tue, 19 May 2020 09:20:47 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 312bg78hx5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 May 2020 09:20:46 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04JD3mZ4071886; Tue, 19 May 2020 09:20:46 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 312bg78hwb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 May 2020 09:20:46 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 04JDKXmH027708; Tue, 19 May 2020 13:20:44 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 313xehhpdg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 May 2020 13:20:43 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04JDKfu7196920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 May 2020 13:20:41 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C388742045; Tue, 19 May 2020 13:20:41 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F03E142049; Tue, 19 May 2020 13:20:40 +0000 (GMT) Received: from pomme.local (unknown [9.145.185.3]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 19 May 2020 13:20:40 +0000 (GMT) Subject: Re: [PATCH v5.5 10/10] mmap locking API: rename mmap_sem to mmap_lock To: Michel Lespinasse 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 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> <20200519131009.GD189720@google.com> From: Laurent Dufour Message-ID: <7c540ac9-ba44-7187-5dc2-60b4c761e91c@linux.ibm.com> Date: Tue, 19 May 2020 15:20:40 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200519131009.GD189720@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-19_03:2020-05-19,2020-05-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 bulkscore=0 cotscore=-2147483648 malwarescore=0 mlxscore=0 suspectscore=0 spamscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005190117 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 19/05/2020 à 15:10, Michel Lespinasse a écrit : > On Mon, May 18, 2020 at 03:45:22PM +0200, Laurent Dufour wrote: >> Le 24/04/2020 à 03:39, Michel Lespinasse a écrit : >>> 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. >>> >>> 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 etnaviv_gem_object *etnaviv_obj) >>> struct etnaviv_gem_userptr *userptr = &etnaviv_obj->userptr; >>> int ret, pinned = 0, npages = etnaviv_obj->base.size >> PAGE_SHIFT; >>> - might_lock_read(¤t->mm->mmap_sem); >>> + might_lock_read(¤t->mm->mmap_lock); >> >> Why not a mm_might_lock_read() new API to hide the mmap_lock, and add it 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... I guess at one time the API would become might_lock_read_a_range(), isn't it? Furthermore this would hiding the lock's name which the goal of this series.