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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C370BC433EF for ; Fri, 4 Feb 2022 22:41:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351628AbiBDWlf (ORCPT ); Fri, 4 Feb 2022 17:41:35 -0500 Received: from server.lespinasse.org ([63.205.204.226]:56713 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237110AbiBDWld (ORCPT ); Fri, 4 Feb 2022 17:41:33 -0500 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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