Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3505874ybk; Tue, 19 May 2020 06:24:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwabIvlJXS4AWDrSKmUTcWxs2HUG/lS7Pt7j8+VtjJsEV7ob6g9cTyBSWS6QBXtf/0pQJ2t X-Received: by 2002:a50:9dcd:: with SMTP id l13mr1455981edk.126.1589894642312; Tue, 19 May 2020 06:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589894642; cv=none; d=google.com; s=arc-20160816; b=LRG50uaSyGn6/CECsllDGinQeKa0gl7oEKgkKBXs3qbbCSQ/WRUXpAGE4K9R/iiQuR 1g1HiggSyEh4ANNbgRbPi66hidPd34XnB43Bd5hqbDeQ06RSCpLAPMmfwZgpfCwmPoGq eBTj/gZJ1BYMmxx2LYxXLh55IgR8AEGEFW3ij6glW0Brl/BM0DqhOfyjIOVuTQcGdlpB Om50IY7UjqlPl6tokcr31Lj2CtzGhgXyrbSU1K7E/kVjCPKrOeQ0D9kdgrGnVgd0nVHY wNonnWjjDZDh/qK8Jb89wMZkJT6gRryqkff+qo2pPLnTwAwqamiAcN6Vy8PwMTS23d96 3AVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0hMrqmQ/9SoJvz0CX+EBhFfBLv8Hp7UpOoizZdj4MTI=; b=I9xwEeyMrb5G6bfLzZF1koOvLZUohBcEDjjZznhWt3h5/fkIgCox8ilVdfgRFR7VTL /EU1SQZFSifTpJ82yl5S7KpWpJFUjnKyjkpdVD4XSEKFJCw2YoSi5YnNIHzY2tuHQHrW lfiUuUT9HJR5KdX4fW7Equa9JzCDDVFz1kkkPwzcX1/e/nnBBqTYZwduRhvh99DJoysD NbVC/Ws71kp+NS/itcrVpAx7MeuL77HvuUOD5b0WsFCWV4PaFj67oPr0RQJ7nuDuH1/4 F5LEhSVn9v/sW63oxRX5hMk4pvonq8pGhm2yjy1419+Uk13Avb9WxP2J04nRxIW+UWVR A6Sw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si122180ejw.726.2020.05.19.06.23.38; Tue, 19 May 2020 06:24:02 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728855AbgESNVn (ORCPT + 99 others); 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.