Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp103988pxb; Mon, 7 Feb 2022 07:16:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJynak/pSbHdPOatuIaMeoQevuQmuPdqf3rohFlxCCri4+IRfkxe8Ca8HvCLuEmPIoQu8iy8 X-Received: by 2002:a05:6a00:2445:: with SMTP id d5mr19416pfj.64.1644247015054; Mon, 07 Feb 2022 07:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644247015; cv=none; d=google.com; s=arc-20160816; b=KaOPe8/Wn/H70WU2jGdf2dE0I9WgFQjtMoMV2Ad9KKPpdGXTCwcfKOufFYfXnag54W XoZi6nEwpoRMlaDUfQU3B0Vqosjje8fbR7uFMQtwZL/mQHIEJJEE7UwawZhC1EBIzGLI mRZgqi6wu5uzJ7un4dkD7L/CaL/j/aYfLCITR2W/6pCccgH374phhlsGj1ruRv9lcETp UOZtIR+iOCZIFCAxXoE0LsMDauVDR1RTlBA39CtHihAXdooQ5b5NLAN0WdZmdLr0uPhd lEt8ptkDuhO/rpMH33B2YUS2WGt/KgWInAnzVpQ0ewP6YUQ0TcMKY2bgAiJbeM8/Cw8C CosA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=6XiOkxTd7ZF/eRFGSH0vBhmdjaQxUXpaLiEfJFIQrUA=; b=F5/VBvlV8QNl14TDWac+NxSrGTFAhwkTb+I4cJ7yLnfTpd+h9l5KZWUqlhyVf8/pmP eqDFAORHMh6cF2dobhKmyFgnXWEiEbjgyK++wPMBKA4+RgqMr8kSpvBkp+1Tl2CzZnWU mUgbz5Y26N3dXslJYWlUOBLCPAB6t3+m2XO95kYXem3Dao0yPO0yf4PT5DAG2pL2EsIo ZZuM56jmz9G6QF2nqfHzcuI7WpHV64Yfhi/LvGyZ22tFIrBNcATUX9i2BtxvHUlObteB UMBDJUVU/2Pr10h9ci2qObDArk0bGe6rxvEs+zn3xwuh56hh2eabrd5tD+bqI705chpm yN8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-54-ed header.b=VDZy9V4w; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-54-rsa header.b=Yz53iAF3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw8si21872259pjb.0.2022.02.07.07.16.42; Mon, 07 Feb 2022 07:16:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-54-ed header.b=VDZy9V4w; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-54-rsa header.b=Yz53iAF3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351598AbiBDWle (ORCPT + 99 others); Fri, 4 Feb 2022 17:41:34 -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