From patchwork Mon Mar 29 18:33:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12170757 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 DBADCC433DB for ; Mon, 29 Mar 2021 18:34:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 69FDE60231 for ; Mon, 29 Mar 2021 18:34:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69FDE60231 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B49B6B007E; Mon, 29 Mar 2021 14:34:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 08DE66B0080; Mon, 29 Mar 2021 14:34:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E71846B0081; Mon, 29 Mar 2021 14:33:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id C61CC6B007E for ; Mon, 29 Mar 2021 14:33:59 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 889D912CB for ; Mon, 29 Mar 2021 18:33:59 +0000 (UTC) X-FDA: 77973760998.20.DAD9EC4 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by imf07.hostedemail.com (Postfix) with ESMTP id D71CDA0003B2 for ; Mon, 29 Mar 2021 18:33:54 +0000 (UTC) Received: by mail-pl1-f172.google.com with SMTP id f17so4817863plr.0 for ; Mon, 29 Mar 2021 11:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TSaTkmfM+DlISEg5t2tvo/fEPeZL9Xe7bKqioL4lk60=; b=bwSINefQh0DoGNCOud81X4AaQE+ngF8kpjG+biWhNmTz4pYazW+mi2wvB77qTlmlHP Fu2xDJJkdiYCQD9isI2ieFMGdmgf6loayf/11lmPEFvZ1nKKgZE2MVXWvXes13LHTiRy j5LBrB7fb+t3l1/NCrv0ho+s8+0wmhFHFMqKtKbJgMwlKlHNK9sM18JOfCQ/hEQciLhW 0pSfFxOkgaFH0d67absszjG9JhmuyOwm6GLS4+dcNdVQy1eTme2Eqdq1+7FiNOEbqL1U easnt/9TBiSWC6P3gFEGmSI0LoIJo/yTON//oEtbpwqI5O6v7N3YzyXa9AOk/Xg0tvKQ t/vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TSaTkmfM+DlISEg5t2tvo/fEPeZL9Xe7bKqioL4lk60=; b=Cl0/FK5SQmvpeh6uZyRzeztAfeRkNxzPcYTexclHO9nF9PyIQ16+KWHjfOGYs0HBrx qFP2eEzSCn57aG/AHTpcwH18lZOK3pWevJ3ugekN2wYtV4/qyOpIx4Pc/QEdmpdXel53 hVkRyvKF57gDI1wooOYIx5cXZo1ioC8kHXI3rodDjsPymx0G9IUOBdDckYP03FOy0MVY 3M560IBbEgo71v24E1jTdTJI3qM66XRY+X7juLFQO2pbU0AZ4eUezqUxDV9144rQqqEM j2od9ShY7jn3EHopYGZdBZstJV1eCX0iHnc6c+dlaO3SGvxr+KwYLKmSDxdT5eIgSIBM 9eIw== X-Gm-Message-State: AOAM531l0KzOc8Y3ffGFrwRq+RGEgKlrPw3jVBDJCjQ2UGNR9Ixqin6u 8mGmyR449o18DqzezjAYqgo= X-Google-Smtp-Source: ABdhPJzXT70cKxSxdOXATE+ZMVo92pyvGaGyaTU+a/wsCVfCDUVP4b/fz9NpczD4sDKyoVDSZS9GNg== X-Received: by 2002:a17:90a:64c7:: with SMTP id i7mr435427pjm.95.1617042834227; Mon, 29 Mar 2021 11:33:54 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id x11sm1151158pjh.0.2021.03.29.11.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 11:33:53 -0700 (PDT) From: Yang Shi To: mgorman@suse.de, kirill.shutemov@linux.intel.com, ziy@nvidia.com, mhocko@suse.com, ying.huang@intel.com, hughd@google.com, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, akpm@linux-foundation.org Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] mm: migrate: remove redundant page count check for THP Date: Mon, 29 Mar 2021 11:33:12 -0700 Message-Id: <20210329183312.178266-7-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210329183312.178266-1-shy828301@gmail.com> References: <20210329183312.178266-1-shy828301@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D71CDA0003B2 X-Stat-Signature: figo1egb6s9zgr4t74hexm6zgpfwsna1 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=mail-pl1-f172.google.com; client-ip=209.85.214.172 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617042834-230932 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: Don't have to keep the redundant page count check for THP anymore after switching to use generic migration code. Signed-off-by: Yang Shi --- mm/migrate.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 1c0c873375ab..328f76848d6c 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2097,18 +2097,6 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page) if (isolate_lru_page(page)) return 0; - /* - * migrate_misplaced_transhuge_page() skips page migration's usual - * check on page_count(), so we must do it here, now that the page - * has been isolated: a GUP pin, or any other pin, prevents migration. - * The expected page count is 3: 1 for page's mapcount and 1 for the - * caller's pin and 1 for the reference taken by isolate_lru_page(). - */ - if (PageTransHuge(page) && page_count(page) != 3) { - putback_lru_page(page); - return 0; - } - page_lru = page_is_file_lru(page); mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON + page_lru, thp_nr_pages(page));