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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 3FF96C2D0ED for ; Fri, 27 Mar 2020 04:48:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0C27D2076B for ; Fri, 27 Mar 2020 04:48:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C27D2076B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=stgolabs.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9C1F56B0010; Fri, 27 Mar 2020 00:48:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 973516B0032; Fri, 27 Mar 2020 00:48:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8AFEF6B0036; Fri, 27 Mar 2020 00:48:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 72C4C6B0010 for ; Fri, 27 Mar 2020 00:48:32 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 47A4D585F for ; Fri, 27 Mar 2020 04:48:32 +0000 (UTC) X-FDA: 76639911264.29.store26_4a773da883315 X-HE-Tag: store26_4a773da883315 X-Filterd-Recvd-Size: 2733 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 04:48:31 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 033EFAE87; Fri, 27 Mar 2020 04:48:29 +0000 (UTC) Date: Thu, 26 Mar 2020 21:46:47 -0700 From: Davidlohr Bueso To: Michel Lespinasse Cc: Andrew Morton , linux-mm , LKML , Peter Zijlstra , Laurent Dufour , Vlastimil Babka , Matthew Wilcox , Liam Howlett , Jerome Glisse , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Markus Elfring Subject: Re: [PATCH v2 07/10] mmap locking API: add mmap_read_release() and mmap_read_unlock_non_owner() Message-ID: <20200327044647.wgfsmjy37n72dixe@linux-p48b> Mail-Followup-To: Michel Lespinasse , Andrew Morton , linux-mm , LKML , Peter Zijlstra , Laurent Dufour , Vlastimil Babka , Matthew Wilcox , Liam Howlett , Jerome Glisse , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Markus Elfring References: <20200327021058.221911-1-walken@google.com> <20200327021058.221911-8-walken@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200327021058.221911-8-walken@google.com> User-Agent: NeoMutt/20180716 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 Thu, 26 Mar 2020, Michel Lespinasse wrote: >Add a couple APIs to allow splitting mmap_read_unlock() into two calls: >- mmap_read_release(), called by the task that had taken the mmap lock; >- mmap_read_unlock_non_owner(), called from a work queue. > >These apis are used by kernel/bpf/stackmap.c only. I'm not crazy about the idea generalizing such calls into an mm api. We try to stay away from non-owner semantics in locking - granted the IS_ENABLED(CONFIG_PREEMPT_RT) warning, but still. Could this give future users the wrong impression? What about just using rwsem calls directly in bpf? Thanks, Davidlohr