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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 861A4C433DB for ; Fri, 26 Feb 2021 16:21:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E6F0764EBA for ; Fri, 26 Feb 2021 16:21:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6F0764EBA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8271B8D0003; Fri, 26 Feb 2021 11:21:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D76D8D0001; Fri, 26 Feb 2021 11:21:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F1E88D0003; Fri, 26 Feb 2021 11:21:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 595C28D0001 for ; Fri, 26 Feb 2021 11:21:46 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2682B18150C3A for ; Fri, 26 Feb 2021 16:21:46 +0000 (UTC) X-FDA: 77860935012.12.E340482 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by imf21.hostedemail.com (Postfix) with ESMTP id 76F00E005F13 for ; Fri, 26 Feb 2021 16:21:41 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id d20so8588555qkc.2 for ; Fri, 26 Feb 2021 08:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wKhee+wwyY8wAQtAwhfFGxIYlymbanXy7c8d3WGe9uw=; b=UbX00wvuuvMEYhRJX3nCu4zXb85v13Cqv2r7hy9O+bowY1FaIbOHtDcePeLY0/B0Da SF2Rt/j2i5vqV+2nd6y/YV7vdWi7UcnYCo6GUDusZkQq2I/4QAMG5NnybLXlvhoAWc4E CB07JSKy/zS1mTJuVrl1tmyNn9/lGP5fKjyqtPqmEH+ZLIUFG0B2e4C+3p28fkRswuxC hFXweOu/200WMxTdg7r9jyhUcvqhegxsjllPJTsf9QRFCspOmTW4FmlmbibPyeQkxmm0 eTduKaFz+s5eAm4qAnHn5719bNNg6/TZ7O3TMvWSTpqPFuHHbDX0UTpRpz8DWGQYjFaf L6OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wKhee+wwyY8wAQtAwhfFGxIYlymbanXy7c8d3WGe9uw=; b=UZB4qrFj97OMSfnJb9EVZP4PQo+oaFM4mvsNlr+L+g2ymAh36oGHu3gKl9VGLXDcj5 Lql6HAXXRHyZsqfjnffKEmUzO2UeOPYQqSa+UfNZzqE+UFiptJJXZN27ukc8xfuAEzPV HNU5Jhk5dPM8pG6qL8puTWWy9Bfvx7ahvDNyX3RboKabPer/G7uTulnGL/lFM86g1dCJ fss6ryDQmLovOU7YHvp6PwVMuGGEo+sp5JRCwyXfLk3zlU+3rsfhcT52Jz0nJOvsHvOX rZjXK7d9rzCxagcEO2UDue9VwP7agEO7cB0zy02eeK0Zc7wSHfKjCDf3DKbTx00F/1Hd CN4Q== X-Gm-Message-State: AOAM533lk/HOux+EoDXwgRiaQY+KkjX3D7VhUs60Jr0DECQ85mwA7mGQ 9W3Sit0+mId+r86Ft3D4E2sjLw== X-Google-Smtp-Source: ABdhPJwJdZL4xF23yJV09qXQ0a4Ybxm3pNDa6pceKSCI9bofx7wUXwpD/kCLchRD1oPm3hWZue3Zhg== X-Received: by 2002:a37:dc41:: with SMTP id v62mr3158437qki.457.1614356503934; Fri, 26 Feb 2021 08:21:43 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id x3sm6801311qkd.94.2021.02.26.08.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 08:21:43 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lFfs7-000yvy-1U; Fri, 26 Feb 2021 12:21:43 -0400 Date: Fri, 26 Feb 2021 12:21:43 -0400 From: Jason Gunthorpe To: Matthew Wilcox Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Freeing page tables through RCU Message-ID: <20210226162143.GW2643399@ziepe.ca> References: <20210225205820.GC2858050@casper.infradead.org> <20210226144200.GV2643399@ziepe.ca> <20210226160354.GE2723601@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210226160354.GE2723601@casper.infradead.org> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 76F00E005F13 X-Stat-Signature: f8xygrkx3a5rtzmczf1kjbejgb1ybxyh Received-SPF: none (ziepe.ca>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=mail-qk1-f175.google.com; client-ip=209.85.222.175 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614356501-769466 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 Fri, Feb 26, 2021 at 04:03:54PM +0000, Matthew Wilcox wrote: > On Fri, Feb 26, 2021 at 10:42:00AM -0400, Jason Gunthorpe wrote: > > On Thu, Feb 25, 2021 at 08:58:20PM +0000, Matthew Wilcox wrote: > > > > > I'd like to hear better ideas than this. > > > > You didn't like my suggestion to put a sleepable lock around the > > freeing of page tables during flushing? > > > > I still don't see how you convert the sleepable page walkers to use > > rcu?? > > I don't want to convert the sleepable ones to use RCU ... I want to > convert the non-sleeping ones to use RCU. Why? Convert them to use the normal page table spinlocks? It makes everything much more understandable if it is locked properly. The lockless walks should be reserved for special places because they are actually hard to do properly. > A page_table_free_lock might work, but it might have its own > problems later (eg a sleeping lock can't be acquired under RCU or > spinlock, and it can't be a spinlock because it'd have to be held > while we wait for IPIs). The mmap_sem today is serving the function of the page_table_free_lock idea, so I think a sleepable lock is already proven to work? Jason