From patchwork Tue Apr 13 21:24:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12201457 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 B8971C43462 for ; Tue, 13 Apr 2021 21:24:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 67F8961242 for ; Tue, 13 Apr 2021 21:24:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67F8961242 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 0434B6B0078; Tue, 13 Apr 2021 17:24:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F0B206B007B; Tue, 13 Apr 2021 17:24:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5DD66B007D; Tue, 13 Apr 2021 17:24:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id B14216B0078 for ; Tue, 13 Apr 2021 17:24:40 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6AC3135A1353 for ; Tue, 13 Apr 2021 21:24:40 +0000 (UTC) X-FDA: 78028623120.21.9483BB5 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf04.hostedemail.com (Postfix) with ESMTP id 77A0513A for ; Tue, 13 Apr 2021 21:24:38 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id z22-20020a17090a0156b029014d4056663fso9701741pje.0 for ; Tue, 13 Apr 2021 14:24:39 -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=w6LlC7e6qPBv/DFANfawt2CvXuDZCeYDosf1+Pz2+ts=; b=iE9WM8EBKV5aqe7bVrS2wJeFBV1IT4YtJyiImW0a6iK5SLKlcjpXJyB4HbZU6uTNAh +Zg1V+1OsAruwtxi3bUb7wvRNYJkSSu0K3Fe2/D+D6SX09BPrsZxu1y3gmQwWmiaqRZo rpEEtoNIHZEbDUTv2KOSim2R4Hbe3c2sGbr/7ArtBmWf2ePJPu4za1U7JXB0muQ+ZXaV NEpSPouCHt6XY1qNmzMYD0Kny3niGAKCoDqG2F2VGGIKTQG9nSjZl9xgkWWLT8xg/Fds htFwiTIvNWesTRIHp/BEPmyg1a9DmRR3jR9+En280LgLIjCHUQDeX8Y6ASS45SuON+4N Zybg== 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=w6LlC7e6qPBv/DFANfawt2CvXuDZCeYDosf1+Pz2+ts=; b=GsinKcxmYMrlrLTgLUEE1XAHjj36CzllGxhUFN01dWkp5AMabVH48AdfMLF9u63QvJ DmKO9rlh4We1spg5pdkXOGkJbfWfgLz49mJhWqYmlEHeoskG6fDzVR5AvuTnIJEGhvFG PrxYEB48atW9nSyhht2C3LxsqT5Uvb/muvJ+3r5Y39nYeiP3Idl5HjSNqUKtCwvgXYGR TzQ+SKfkXN4m8fQqCv+hgrM52NUrURFoQa9bF67vF0/xj+zedGzsOwuEBGt+BeXGC2vc tb0BGrN5OdNsChz/3AzYQBGeg2nrN/8TzmZDOYT/Ca/J90n7rTXSC07kdNv+wzFJAiue 7i1g== X-Gm-Message-State: AOAM533ja51fo1CcFvVIUtqwX4EInOqOXsoGmeCIIDgYw9OYxyDKznYY bhJ9Ee2Q3MXW2+HEIC2wIAA= X-Google-Smtp-Source: ABdhPJxo7MBByycqzfC3pAyOVupxOhelSDT7jOQ4KiIdzVmez62LtHArR8gJdQ7X0jtuHVX3vGl75Q== X-Received: by 2002:a17:90a:5418:: with SMTP id z24mr2117305pjh.189.1618349079422; Tue, 13 Apr 2021 14:24:39 -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 fw24sm3069345pjb.21.2021.04.13.14.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 14:24:38 -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, gerald.schaefer@linux.ibm.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: [v2 PATCH 5/7] mm: migrate: don't split THP for misplaced NUMA page Date: Tue, 13 Apr 2021 14:24:14 -0700 Message-Id: <20210413212416.3273-6-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210413212416.3273-1-shy828301@gmail.com> References: <20210413212416.3273-1-shy828301@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 77A0513A X-Stat-Signature: pb5wukwcj7ibebjycdakk1yph3hic8u9 X-Rspamd-Server: rspam02 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=mail-pj1-f49.google.com; client-ip=209.85.216.49 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618349078-394937 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: The old behavior didn't split THP if migration is failed due to lack of memory on the target node. But the THP migration does split THP, so keep the old behavior for misplaced NUMA page migration. Signed-off-by: Yang Shi Acked-by: Mel Gorman --- mm/migrate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index a473f25fbd01..a72994c68ec6 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1417,6 +1417,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, int swapwrite = current->flags & PF_SWAPWRITE; int rc, nr_subpages; LIST_HEAD(ret_pages); + bool nosplit = (reason == MR_NUMA_MISPLACED); trace_mm_migrate_pages_start(mode, reason); @@ -1488,8 +1489,9 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, /* * When memory is low, don't bother to try to migrate * other pages, just exit. + * THP NUMA faulting doesn't split THP to retry. */ - if (is_thp) { + if (is_thp && !nosplit) { if (!try_split_thp(page, &page2, from)) { nr_thp_split++; goto retry;