From patchwork Wed Sep 13 09:51:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 138732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp974531vqx; Wed, 13 Sep 2023 03:06:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoGDJsAyDLyROLMeCCL+db59TNDcwOUl/tmXp2PTRUKH17vHzSLL4KLkv6Agox+q5oJkCG X-Received: by 2002:a17:903:2308:b0:1c2:36a:52a5 with SMTP id d8-20020a170903230800b001c2036a52a5mr2295900plh.57.1694599600787; Wed, 13 Sep 2023 03:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694599600; cv=none; d=google.com; s=arc-20160816; b=FRk4tGptTmBIK98PkbgzuF0XAFuEz/nZ0jJK2KpNwTTrzl7kPbGtD0uYMEcDqP/YAK N9wYBtbTPWVhLv4bN2tgN23oEzZefaaL1xzj+wRbb3+/CPkNDKh0J2ouUjDQEBae9oE6 5vezcfpqbxuT3hEYqNVnoKi2yQC7zWBV48+M1RyKtpdMQvlalSOiIF790/Fs11d/8JnW b1OVSG4WdJ7OKGI+nA28mo5J7vnGuGdSxTf58/eAQQqwnmahiB+qA9j4WXI9dWJoep4y mMDxXtm6URUyGg7SNBjBnm96szv3IfELy6Y+Nl8W2lMb6DO+Us+KJdmwxjGHc8Up+YfD EDnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CWyPKwL02nbvAgHk+hv8KgCviWU/Da8QA7ydynsElH8=; fh=Je6qNyAM729b1goCtB6PkBk+yQrlQCIjJMRY6BFgKTo=; b=n6Yzs19UvX7AxrCWW+D7XtyWDHerj6gKsH9cQ+x/Xm2exY9BfasfchPkQNSk6lyxgH ogWzJVL/1Xu733r2dHtI/FezDtWO04JZn5y8hga4/cuv/I9IOrDYAqu/E55P1CdfexV0 MkD5wZK7KXkbkRn/MbRAbx2vmhqo1YmkuUk4JhO1Ic9ggWoqoNvEWP394AUyQptCZMNb 7vas9MeDfMqlRaJIgRr+nE6EGyZrHNVVVCSsqgFkbjc0vGixtnoUVGcDEmxD+vV6Hzq2 Cdv4Pz9V2iNqW8wQVgL4rkNMwgv6MvmhR03NWmdl05KVp2Ux8cG8bqDyEzW9DkwYi6Iw /bFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id z11-20020a170903018b00b001b89b63b877si10407936plg.446.2023.09.13.03.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 03:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0AF3180257B8; Wed, 13 Sep 2023 02:52:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239513AbjIMJwN (ORCPT + 36 others); Wed, 13 Sep 2023 05:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236400AbjIMJwG (ORCPT ); Wed, 13 Sep 2023 05:52:06 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B13501BC7 for ; Wed, 13 Sep 2023 02:52:01 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Rlwcw06PkzMlGs; Wed, 13 Sep 2023 17:48:32 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 13 Sep 2023 17:51:59 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Mike Kravetz , , Kefeng Wang Subject: [PATCH v3 2/8] mm: migrate: remove THP mapcount check in numamigrate_isolate_page() Date: Wed, 13 Sep 2023 17:51:25 +0800 Message-ID: <20230913095131.2426871-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230913095131.2426871-1-wangkefeng.wang@huawei.com> References: <20230913095131.2426871-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 02:52:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776916470940207481 X-GMAIL-MSGID: 1776916470940207481 The check of THP mapped by multiple processes was introduced by commit 04fa5d6a6547 ("mm: migrate: check page_count of THP before migrating") and refactor by commit 340ef3902cf2 ("mm: numa: cleanup flow of transhuge page migration"), which is out of date, since migrate_misplaced_page() is now using the standard migrate_pages() for small pages and THPs, the reference count checking is in folio_migrate_mapping(), so let's remove the special check for THP. Suggested-by: Matthew Wilcox (Oracle) Reviewed-by: "Huang, Ying" Signed-off-by: Kefeng Wang --- mm/migrate.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 646d8ee7f102..f2d86dfd8423 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2483,10 +2483,6 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page) int nr_pages = thp_nr_pages(page); int order = compound_order(page); - /* Do not migrate THP mapped by multiple processes */ - if (PageTransHuge(page) && total_mapcount(page) > 1) - return 0; - /* Avoid migrating to a node that is nearly full */ if (!migrate_balanced_pgdat(pgdat, nr_pages)) { int z;