Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1692165pxp; Sun, 6 Mar 2022 23:37:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLmTn2pRYT9RI2FkjWkCHUs6ZNAKjWolQdH38wk5NbpUjTvEYsiAebgCpgb86PHSSmjejp X-Received: by 2002:a65:6643:0:b0:37c:94b6:f77b with SMTP id z3-20020a656643000000b0037c94b6f77bmr8723469pgv.345.1646638630142; Sun, 06 Mar 2022 23:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646638630; cv=none; d=google.com; s=arc-20160816; b=ZY6panqP2EtECYm18ncG52NXGCN4LVc9ek+X4t8t82SMbvuEO8Aq0ja25pPXAWVE1i Cq+DuRUgrvlAoY3mKelccnPifA0/do3PuZ/V+qsy9/lk9Bk2DxUFX6cK1FRYqOeYtGRs 2Pgnc3YMaIqB1STwqE6xCb47YjcW3YrGLHN7DhyHxket2uQ4TLUZ5W9OwpPAqA34HW7R imWbpFNPcQDO4NiarEV8mXO7Ux9wcfDJqax7EGDfLJGrwmYbLHAdECKR3TulYfryebes 6hHWH9cy6y6/51WEyIKrN1bnP/Y4RXR+wzFi2R0VU76DT74UUeuZjhBqEC2I+vFSjsRr wGDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ott2Fy6zW0YAlx8wzwMZzzUaVRMCd6cEJUB+xxtueUk=; b=KltFCGB2WWsZNf+9GvKyhBBTsApbyLxj9bI34drI+ojVupjrw2nxWQ/u9zzxMPFBFa rVg8lsJfYh0ngzmbPlLfNYhmEzRjt3pxUxi+rRsRpXlCkWwcDJ1MF9n/PsXMIr2BoyQB WaVBVjwh3kb0JngxGd0uFVmwSKUssI1Quz+/rCQ1Dt9iqKQ5XZQP5d80fFIf2PCHvH13 foHBs0mjAPWaqk7houh6ABNdizdjIeJ5Ykg1mBuUBTlwl6M/lPV9adevVkIkk2fS8U4c 5oKsLcwxtMTOpMuujZBsLGWTaDcUKAKFCxsu2X12/4SjY7btQ8dQ+GfhbldaLQ7wj+qm id8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Qj1awOLy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a056a00168800b004a4e3507c3csi12458702pfc.43.2022.03.06.23.36.55; Sun, 06 Mar 2022 23:37:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Qj1awOLy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232109AbiCFWIh (ORCPT + 99 others); Sun, 6 Mar 2022 17:08:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbiCFWIg (ORCPT ); Sun, 6 Mar 2022 17:08:36 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D18241D326 for ; Sun, 6 Mar 2022 14:07:42 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id s1so12166178plg.12 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=WawRKVigVrt5+EMa9K+VJSjMFz7Sl1+X6obav2+wGTF5LDFKtcmwQ29zVXUKI5I+wY 3j/484toRs+2JI5k7gAZKDkq1OWfuolnCdrOQK0TD1J+j1Xi+M8D5Yddj1UV9dUQL8r3 htlmWuDcVYCYmB7t7ERrHYUjTohsR59twMaLJ8jZE7+DxdyQqGP7sgb1HaVhTULGG4SC bl8wFWwXiUqCpCK/S2gyWD5bzBHhqdM1U8+f9fUXEEa6NeSp8E4q8DAsCM//GXX6F5FB 97xIicGGB00Nf78wWURDQ79exeglpBiK5kMjLcOJGRHsRFqMn4W0c9STYG905kvC7QmM s9dw== X-Gm-Message-State: AOAM531bkYBBsmwt+dzTh3ARo0mtBiqdaSe5AeYR1U2fDgiOGmnL4BLu xYx2VcZ12VzfYkfaD8YpmLAE6w== 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-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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