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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCFFEC433F5 for ; Fri, 4 Feb 2022 22:41:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ABE96B0072; Fri, 4 Feb 2022 17:41:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 25BDD6B0073; Fri, 4 Feb 2022 17:41:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14AEC6B0074; Fri, 4 Feb 2022 17:41:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 039CD6B0072 for ; Fri, 4 Feb 2022 17:41:36 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BD3E298C22 for ; Fri, 4 Feb 2022 22:41:35 +0000 (UTC) X-FDA: 79106570550.21.8F045D4 Received: from server.lespinasse.org (server.lespinasse.org [63.205.204.226]) by imf13.hostedemail.com (Postfix) with ESMTP id 5EC2320003 for ; Fri, 4 Feb 2022 22:41:35 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-54-ed; t=1644014493; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=6XiOkxTd7ZF/eRFGSH0vBhmdjaQxUXpaLiEfJFIQrUA=; b=VDZy9V4wnAaM1ZfzB5BN3NDq1QWW0eVo3rMKPHRBV1yyZseuYM+Tq/I1sRDmQPRMrsXX4 nVtBFZt+2q74xwtBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-54-rsa; t=1644014493; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=6XiOkxTd7ZF/eRFGSH0vBhmdjaQxUXpaLiEfJFIQrUA=; b=Yz53iAF3nbAQWs032V+7D18WhqS8KOvhlql59JSibAOJ0hPeaAV5kzjn/p1DukCos3tZZ QQOInJMu6ox5qiBKOyscvJ47A+MFiyXZdoJuc0oJTmpziIrZbrg0uJ3rjdxbVJi0W9usE4u GkZ3Bz4q24ijmKrUUd/WYTN1VfpDTfZJxZ6FdNRVsTpDdoqrY2n7ZqBjwOQZeuSgCDTe/wd l8arsv7KghGR0rLO5YkrjOIgUFXoCXJXBhEDmXUQ8jyHY+ZoBBVnRb3t3QXzlfjqn2SjCTr 76C1+S1Mwidt8O6+i2LWydFdhp9m28gblWuq4MHEYF4GV8TBUYT6TnnV/u8w== Received: by server.lespinasse.org (Postfix, from userid 1000) id 2440C160B1D; Fri, 4 Feb 2022 14:41:33 -0800 (PST) Date: Fri, 4 Feb 2022 14:41:33 -0800 From: Michel Lespinasse To: Matthew Wilcox Cc: Michel Lespinasse , Linux-MM , linux-kernel@vger.kernel.org, Andrew Morton , kernel-team@fb.com, Laurent Dufour , Jerome Glisse , Peter Zijlstra , Michal Hocko , Vlastimil Babka , Davidlohr Bueso , Liam Howlett , Rik van Riel , Paul McKenney , Song Liu , Suren Baghdasaryan , Minchan Kim , Joel Fernandes , David Rientjes , Axel Rasmussen , Andy Lutomirski Subject: Re: [PATCH v2 12/35] mm: separate mmap locked assertion from find_vma Message-ID: <20220204224133.GA1559@lespinasse.org> References: <20220128131006.67712-1-michel@lespinasse.org> <20220128131006.67712-13-michel@lespinasse.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5EC2320003 X-Stat-Signature: 9s7wewur7ccrons3n44pdozdfqndfmxz Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=lespinasse.org header.s=srv-54-ed header.b=VDZy9V4w; dkim=pass header.d=lespinasse.org header.s=srv-54-rsa header.b=Yz53iAF3; dmarc=pass (policy=none) header.from=lespinasse.org; spf=pass (imf13.hostedemail.com: domain of michel@lespinasse.org designates 63.205.204.226 as permitted sender) smtp.mailfrom=michel@lespinasse.org X-Rspam-User: nil X-HE-Tag: 1644014495-82200 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, Jan 31, 2022 at 02:44:55PM +0000, Matthew Wilcox wrote: > On Fri, Jan 28, 2022 at 05:09:43AM -0800, Michel Lespinasse wrote: > > This adds a new __find_vma() function, which implements find_vma minus > > the mmap_assert_locked() assertion. > > > > find_vma() is then implemented as an inline wrapper around __find_vma(). > > You might like to take inspiration from the maple tree patches > where we assert that either the RCU lock is held or the mmap_lock > is held. I've been considering it, but I'm not sure we want to go that way: it's not sufficient for the caller to have an RCU read lock, they also need to do the proper mmap_seq_read_check() after dereferencing the vma... So I think having this different set of expectations for the two cases warrants using a different name to keep things more explicit. -- Michel "walken" Lespinasse