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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 DAE57C4361B for ; Mon, 14 Dec 2020 18:57:48 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F8CF22525 for ; Mon, 14 Dec 2020 18:57:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F8CF22525 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YPlqFIQj/vJeO6lNJGpGYJVRO3tjR/HNzT5ChA9kk94=; b=ID2G/pcCt46acV5edYp2drFXC 4xqTdcQbRuYzDtaS0AJ15LoWVLfjHauCW+HSbMEdP1o+pCC0lA+uOyawajBYdDXtQlkIfLcdJ0FPx pDDz+KM6S0jt/vp8O6KUGtv8UIDWly96NsoJGvqKXldaAUcRD2bmcyAVIcrxVimagAtjJUXghw1bQ HuO+lAhzPYU9hPLO6Uf1I33ic1UJclquqWa9FKY5DgQut6NCvs8egi1XOVC6VqjyRampg/eRlMGeX OA3exfXid52puhumejssKDJt7ggzgiKHUPo5YJzn7gYyD7Df6RdMiwfNQDMFB6+dfEY67MTb3iG7a r+ytfX8Ig==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kot15-0000fy-MK; Mon, 14 Dec 2020 18:56:15 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kot13-0000fq-8m for linux-arm-kernel@merlin.infradead.org; Mon, 14 Dec 2020 18:56:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=E9p2fQLU+kZ8mfKkC7toHhZ7VgcwGHnKqCLNvwn4P8k=; b=OcxiEbZrXxgCVxht7qvEu0hTvo KOWCihxnceuUesbzpigpQQDzZu57/6+67M09uB1UJw5q2wjhbsZFLKMUz6ciZVDjrJnd/2WQ8VJkC VAJmu+E+ZhJGCoIyKWkBWk7EyImlTy2oIb/TnmvnpKGKTI50hz7Bj0CeF8izMe6eaKkslFTcIYMxr dKpGe5eFZVuxE1UDB5YF9V7xfBr9mXbPPdWxEMUor/Oql/nzB0RKd8Xzlr69bbGH41lu/ysEMx8Aw sOH8DEpzUZA6HMhosyGEDG3m7/O4t0+uejJ4ZpnYsNfBlAoEjW4rQrzz/f4kpYzaQw70OqnL1GxLF VuZSeAzg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kot10-0008QV-90; Mon, 14 Dec 2020 18:56:10 +0000 Date: Mon, 14 Dec 2020 18:56:10 +0000 From: Matthew Wilcox To: Linus Torvalds Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting Message-ID: <20201214185610.GO2443@casper.infradead.org> References: <20201209163950.8494-1-will@kernel.org> <20201209163950.8494-2-will@kernel.org> <20201209184049.GA8778@willie-the-truck> <20201210150828.4b7pg5lx666r7l2u@black.fi.intel.com> <20201214160724.ewhjqoi32chheone@box> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Android Kernel Team , Jan Kara , Minchan Kim , Catalin Marinas , Linux Kernel Mailing List , Linux-MM , Vinayak Menon , "Kirill A. Shutemov" , "Kirill A. Shutemov" , Andrew Morton , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 14, 2020 at 09:54:06AM -0800, Linus Torvalds wrote: > > I expected to hate it more, but it looks reasonable. Opencoded > > xas_for_each() smells bad, but... > > I think the open-coded xas_for_each() per se isn't a problem, but I > agree that the startup condition is a bit ugly. And I'm actually > personally more confused by why xas_retry() is needed here, bit not in > many other places. That is perhaps more obvious now that it shows up > twice. > > Adding Willy to the cc in case he has comments on that, and can > explain it to me in small words. > > [ https://lore.kernel.org/lkml/20201214160724.ewhjqoi32chheone@box/ > for context ] The xas_retry() is something I now regret, but haven't got annoyed enough by it yet to fix (also, other projects). It originated in the radix tree where we would get a radix_tree_node and then iterate over it in header macros. If we're holding the rcu_read_lock() and somebody else deletes an entry leaving the entry at index 0 as the only index in the tree, we tell the RCU readers to rewalk the tree from the top by putting a retry entry in place of the real entry. It's not entirely clear to me now why we did that. Just leave the entry alone and the RCU-walkers will see it, then the rest of the node is empty. As to why we need to do this in some places and not others; you can only see a retry entry if you're only protected by the RCU lock. If you're protected by the spinlock, you can't see any nodes which contain retry entries. But I now think we should just get rid of retry entries. Maybe I'm missing a good reason to keep them. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel