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.7 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,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 C70C9C4361B for ; Mon, 14 Dec 2020 17:55:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F3FF21D7F for ; Mon, 14 Dec 2020 17:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502467AbgLNRzh (ORCPT ); Mon, 14 Dec 2020 12:55:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408047AbgLNRzK (ORCPT ); Mon, 14 Dec 2020 12:55:10 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59FB1C0613D6 for ; Mon, 14 Dec 2020 09:54:28 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id o19so6728718lfo.1 for ; Mon, 14 Dec 2020 09:54:28 -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=Vslyeko1nz1e3lDCFmsHzjKrnysTYaYylKWAwHYW8xlTd3WDcS2PZ3k0isHwtKuJyi BGRtDJaLp/LqJpfcHmgr2LlZwGIvojv1xd8G++4TGj5bBFmJxjSRFD39E8BPOSfXF5op /Hgiu7NotqlKT3rBfvDqoTAvEP4lqyzB4sQz4h8Ojqwqjsguu+04jiHHQ7wExHVWQlBn FGF5xeoPbafVMSDOd4kUB83IkSBu0S/j56+jF6EDrETy4P0tx6iGs/fXFrNXj7M+l2yG gGojNwJ5yevbTCmnJU+5rn263s+p+6VYQXses3GCLTuU14+pcgLu6eDU6mWnIN/eTjQw MQ/A== X-Gm-Message-State: AOAM531OrzydNmIgV5tdt5sW3FzixJWWs7TLAO4+v+ysU2vHCxVhQuuj UPX674C90GJEO/NxK3v0C2TG2zB89OsYjw== X-Google-Smtp-Source: ABdhPJzhIIgg8G/0H0shebnkYAf131KQXeQh0pYQcGTNidqpj6vfWz5NcI+XSPG00GAtGXzlmQKqQw== X-Received: by 2002:a05:6512:110a:: with SMTP id l10mr9729341lfg.167.1607968465218; Mon, 14 Dec 2020 09:54:25 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id z7sm2454191ljm.126.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-f46.google.com with SMTP id x20so12816220lfe.12 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 Cc: "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , Vinayak Menon , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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.7 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,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 4034CC4361B for ; Mon, 14 Dec 2020 17:54:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8613A21D7F for ; Mon, 14 Dec 2020 17:54:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8613A21D7F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8AD566B0036; Mon, 14 Dec 2020 12:54:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8351E6B005C; Mon, 14 Dec 2020 12:54:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FCBD6B005D; Mon, 14 Dec 2020 12:54:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 53E406B0036 for ; Mon, 14 Dec 2020 12:54:28 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0F0372464 for ; Mon, 14 Dec 2020 17:54:28 +0000 (UTC) X-FDA: 77592637416.02.sleep61_32130af2741c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id E403610097AA2 for ; Mon, 14 Dec 2020 17:54:27 +0000 (UTC) X-HE-Tag: sleep61_32130af2741c X-Filterd-Recvd-Size: 5566 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Mon, 14 Dec 2020 17:54:27 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id w13so32356800lfd.5 for ; Mon, 14 Dec 2020 09:54:27 -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=tEXDeAN/96chmac512LyMD/G9qK0an48H7Ywkla6Kd9EDrtCKEDwyZoDSpPE/nb+4M IwOMW0Mo7LJtNrg0PTTbX5ncBWpOMsvXy1Jt41X01Dw2gbZyx+BBOnihpJ7J76gftm6W BbzBwAfTmCNPQz+FFRrtCuuJKe07G/Fz+rpYQSMhszhoaK7S2s2nyJh8gQZNdoynaAgY Z6Pauwj6OlAR7PTrDMrkEG73qf4unIHDOokZKWkPdI5CVrgfr284K5F4+XsfAwhk3dTZ QHVOn50EaookDswbDFZG5Cb7KLyPwsBFVJ4U5/LEdaddz1pqn46E3zfQW5PyB0XKe5ru zDRg== X-Gm-Message-State: AOAM530x5zR17t2UC1qgEN6LYCpZeVWOxT7196PEbShwaQFX+KTKn8o8 BLsGS/0LzS6Or840u9OPmjwuHVe2FGfa4Q== X-Google-Smtp-Source: ABdhPJxWy+qIuLrNTYzrwAIv88BHRusW0dS5HNtWfr1bF6eqap9ZAHL4yHhhNF42oLzaDMdGU/82fg== X-Received: by 2002:a05:651c:1255:: with SMTP id h21mr11837091ljh.8.1607968465030; Mon, 14 Dec 2020 09:54:25 -0800 (PST) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id q5sm2002816ljg.122.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-f42.google.com with SMTP id o13so9191232lfr.3 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 Cc: "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , Vinayak Menon , Android Kernel Team Content-Type: text/plain; charset="UTF-8" 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 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 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