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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2813EC433F5 for ; Sun, 6 Mar 2022 22:07:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0500A8D0002; Sun, 6 Mar 2022 17:07:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3FBE8D0001; Sun, 6 Mar 2022 17:07:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E08178D0002; Sun, 6 Mar 2022 17:07:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id D248D8D0001 for ; Sun, 6 Mar 2022 17:07:43 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9ACDA20BAE for ; Sun, 6 Mar 2022 22:07:43 +0000 (UTC) X-FDA: 79215349206.14.5B0314A Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf15.hostedemail.com (Postfix) with ESMTP id 1605AA0004 for ; Sun, 6 Mar 2022 22:07:42 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id m22so11683810pja.0 for ; Sun, 06 Mar 2022 14:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=ott2Fy6zW0YAlx8wzwMZzzUaVRMCd6cEJUB+xxtueUk=; b=Qj1awOLyyLqVwaOgk5PKOi4INIcAaAkqsf36jgPyP1DIXghU7kqsv5eoerO37U4A1s uA1pf8jYDMytw9X3Pym0vYmxpdndetiW9tBjHRPBYGuM+c5cOEG2Nbv3f56pUmPRWgRR vOpuYVWNO980M3HylaUGpMGZMy+4X1qCl+umpTPVDLXCa3maWuuQAN6ZkLT+GrISWGZp s1QLKinV/QLGQYwgaG1loQQCFUNB5QE5cYSPrOGMWPTIZ/GxTghHMXYsIwcNH7PvdSi+ V54Bg4kfWKfIVoBHMD1uGX9qERNIxnGWS4RF85iT9z6M0ivKRbBI8CIHYgpRnHZTmzKb RpAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=ott2Fy6zW0YAlx8wzwMZzzUaVRMCd6cEJUB+xxtueUk=; b=3gaufZ3KHmrpXNF7XO5Rx6mBCPH/8M/zmPLCkFizPHq0hP0N4HWAhOGo4xaQJY+zRy tQg//+PL7NLZ1HRaIsHmup5kLykuKKmyPERL700iN8OhOqqp5yMLYeaNDk0zhm8fHdy+ ET3EJQX8OJS6fB+nblQ8WLlccwv92yb7/J7TqOTgvA+/qJQTBjZrW7m45tt/50CLZguY JM/dI28Tpwt0KDZ4JLNGKrlTitVTdPiOvfD6UkdQPNDXtbQFbOdMyCDAT0H8xjuqGwQI wxHpInMbuO27hzowV53Sxzm0YdGlSiOR9ilQaV94IyaOUZOIQQg6CJRFBgtyl8DG/nzg YUeQ== X-Gm-Message-State: AOAM530kB+4yjSrbdLA6Tj6M+tG0c7VnY/OleszdqJSnBVYe2GvYpnXM N1Ih4fXJT4R4d7/WtnmXaCPhNQ== X-Google-Smtp-Source: ABdhPJxWgicViQ9wemdU1MnHl7NEto1XHjnw/D9hyBaoAh07z1cixmUct+1ujUEekw/FlGuF5PBORw== X-Received: by 2002:a17:902:e552:b0:14f:bfec:eb2c with SMTP id n18-20020a170902e55200b0014fbfeceb2cmr9248566plf.108.1646604461700; Sun, 06 Mar 2022 14:07:41 -0800 (PST) Received: from [2620:15c:29:204:5f87:a605:2b59:e392] ([2620:15c:29:204:5f87:a605:2b59:e392]) by smtp.gmail.com with ESMTPSA id s21-20020a63dc15000000b00378c9e5b37fsm9670409pgg.63.2022.03.06.14.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Mar 2022 14:07:41 -0800 (PST) Date: Sun, 6 Mar 2022 14:07:40 -0800 (PST) From: David Rientjes To: Hugh Dickins cc: Andrew Morton , Alex Shi , Alexander Duyck , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH mmotm] mm: __isolate_lru_page_prepare() in isolate_migratepages_block() In-Reply-To: <879d62a8-91cc-d3c6-fb3b-69768236df68@google.com> Message-ID: References: <879d62a8-91cc-d3c6-fb3b-69768236df68@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1605AA0004 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Qj1awOLy; spf=pass (imf15.hostedemail.com: domain of rientjes@google.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=rientjes@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: gjhtpn9pu46mzjnou6hzsakedzx4jkdx X-HE-Tag: 1646604462-946081 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, 4 Mar 2022, Hugh Dickins wrote: > __isolate_lru_page_prepare() conflates two unrelated functions, with > the flags to one disjoint from the flags to the other; and hides some > of the important checks outside of isolate_migratepages_block(), where > the sequence is better to be visible. It comes from the days of lumpy > reclaim, before compaction, when the combination made more sense. > > Move what's needed by mm/compaction.c isolate_migratepages_block() inline > there, and what's needed by mm/vmscan.c isolate_lru_pages() inline there. > > Shorten "isolate_mode" to "mode", so the sequence of conditions is easier > to read. Declare a "mapping" variable, to save one call to page_mapping() > (but not another: calling again after page is locked is necessary). > Simplify isolate_lru_pages() with a "move_to" list pointer. > > Signed-off-by: Hugh Dickins Acked-by: David Rientjes