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 F280FC4361B for ; Mon, 14 Dec 2020 17:55:54 +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 A4CDE21D7F for ; Mon, 14 Dec 2020 17:55:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4CDE21D7F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AfbrBA2hV0Ezx52hLLY/eOedXMqBp91OXT7lC0KnUzM=; b=DS+DpqOPdcwrUvUOqKxRpR7E/ 1JUEp7O94/AeTZynipf8Cx9U+EHjI9P/nM/7huS4VlMkP5h9rztatJtP3qBN9Ia72GtIKo60gbp9I TAlZqbzYI2Sq2dZYRMoNdgdOn83Ik32MVQFAqPqoxdvczRW326JOgSLlGtai7+DbWDkN4N3OM19Ax VCDw91ldFcfgz1YkZYClmZLrKX0HaEdLMVYmjK4MFCa+KCDFam3XIuwOMtMTCAhSstUJ7YPunJ9F6 9GsqnEKhFRGuKotKLoq8aU1P3AINnTcJksvsjtTrEgmUcV3pGZrmNjWYSXI0IF/UsppVksl0pacLb O0dL9dO5A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kos3M-0004IX-LM; Mon, 14 Dec 2020 17:54:32 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kos3I-0004FN-KB for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 17:54:30 +0000 Received: by mail-lf1-x143.google.com with SMTP id a12so32364875lfl.6 for ; Mon, 14 Dec 2020 09:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3LqrgkPy+zCNpdGlJy55sEFO1oQMSaaqQeWb7wVUwHM=; b=hmuyZCwirZ2/zGJKCeArmXdo6mSFxQOCOGuqa/Ao64WDftm8tQ/xhZi5Sc8oANDJ0g rQ6KOrZY7kx8LiaWvmMMd/x7m5erN8vLQcKKFxMz15g/biusPM3Dwscs2gXIuRKCVkkF 9HTacsBGIwnx354xB5tyw1XD0oJ05atjrlfoQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3LqrgkPy+zCNpdGlJy55sEFO1oQMSaaqQeWb7wVUwHM=; b=c8zWU3dj5WP11ZSdW8CMsE4BKYX+/7em9BnIQAAspN5PHOu46Si2A3zmnwSyMB9xCd UU8qWQf7jZriy2izBdCIMNCpIuHXSCWQ9KxO2RS/o5ygNMtrfw71wfi/uLd8GPFYvgJS /1xpuhURZ+xSTVHSmmNKKKV/pu0nj3aSS2jlYD1ZxoA0P0rK/4hqZP/8estt6l9M+8q2 GULLSmgVbSkUwFYaqOQqi/CWZGesojTf8aE0BuWy3J9nrh/4xxTpucpf7sP95kGRaTd+ 6+hm2lZ/BR1n4QMCMHw6v1YDFYOpMt+IM8iaUeBVIRWdGOEut2AHG9f/7T/MU/wFZUK7 gh/A== X-Gm-Message-State: AOAM532Pwdbw9SdR7ylaTjSaNNbkaS2bwijfSuemieMQoiKn09J0erUd vUD7HsBtpgmERDqjQLGUY2+W8BuCIYH2sQ== X-Google-Smtp-Source: ABdhPJyv5jYaVerAW36CxuYCcHL2bVzBZRwnGitt4LrIFeAA6rHUT4GWzl6oHe0buTWN2syc7nHCmg== X-Received: by 2002:ac2:5cac:: with SMTP id e12mr9746807lfq.216.1607968464845; Mon, 14 Dec 2020 09:54:24 -0800 (PST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id q17sm1794425lfa.32.2020.12.14.09.54.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Dec 2020 09:54:23 -0800 (PST) Received: by mail-lf1-f51.google.com with SMTP id o19so6728221lfo.1 for ; Mon, 14 Dec 2020 09:54:22 -0800 (PST) X-Received: by 2002:a19:8557:: with SMTP id h84mr9392758lfd.201.1607968462385; Mon, 14 Dec 2020 09:54:22 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <20201214160724.ewhjqoi32chheone@box> From: Linus Torvalds Date: Mon, 14 Dec 2020 09:54:06 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: "Kirill A. Shutemov" , Matthew Wilcox X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201214_125428_762306_F36AC95D X-CRM114-Status: GOOD ( 15.95 ) 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" , 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 8:07 AM Kirill A. Shutemov wrote: > > Here it is. Still barely tested. Ok, from looking at the patch (not applying it and looking at the end result), I think the locking - at least for the filemap_map_pages() case - is a lot easier to understand. So you seem to have fixed the thing I personally found most confusing. Thanks. > 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 ] And I actually think it might make even more sense if you moved more of the pmd handling into "filemap_map_pages_pmd()". Now it's a bit odd, with filemap_map_pages() containing part of the pmd handling, and then part being in filemap_map_pages_pmd(). Could we have a "filemap_map_pmd()" that does it all, and then the filemap_map_pages() logic would be more along the lines of if (filemap_map_pmd(vmf, xas)) { rcu_read_unlock(); return; } ... then handle pte's ... Hmm? There may be some shared state thing why you didn't do it, the above is mostly a syntactic issue. Thanks, Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel