From patchwork Mon Mar 29 18:33:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12170763 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 20A94C433DB for ; Mon, 29 Mar 2021 18:34:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE14B60231 for ; Mon, 29 Mar 2021 18:34:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE14B60231 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 4D56E6B0082; Mon, 29 Mar 2021 14:34:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4ABB16B0083; Mon, 29 Mar 2021 14:34:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34C796B0085; Mon, 29 Mar 2021 14:34:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0214.hostedemail.com [216.40.44.214]) by kanga.kvack.org (Postfix) with ESMTP id 121256B0082 for ; Mon, 29 Mar 2021 14:34:10 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C84605851 for ; Mon, 29 Mar 2021 18:34:09 +0000 (UTC) X-FDA: 77973761418.14.573F686 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by imf25.hostedemail.com (Postfix) with ESMTP id 575186000120 for ; Mon, 29 Mar 2021 18:33:57 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id h25so9982049pgm.3 for ; Mon, 29 Mar 2021 11:33:58 -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=+CRNvcMROqrESHeRKDz8ObLyGg8mIEbD/UzeVrHPcdA=; b=dwfbMHXO9rtx22/WgMfUY6cGe3JyGFIlA1Wor9r8FoMKQhg/8D6RV7seDwo52cXxMh s8gRBHYQMpBCWbnITkSxA/ewGhQxzHtx59bDfS3MUkIZdLIo5UJO99IVi1sZXZtZRXgY gG560qy54JPIFFDY8dJakHXavIqaQJohRgjOX2e4p1oYfMdKTmeaeVb9V6gY7ioRZtLc Av0ADSKfI3lkDFcVqxOZyq4uhhuaosjpx05sgL1LBqcKFIPMDEkQpQJ+Jw6fZsP/I/ZB 8E+HoJoIv5f7ei4tVchySYe3fYsMFzHkHyzQsnuAGW+AvlpvsXCpueoTfMMDag5I/o0b JC+g== 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=+CRNvcMROqrESHeRKDz8ObLyGg8mIEbD/UzeVrHPcdA=; b=Ty6IJNU7wJChYxBf5hxP8XyNBmikcQKtc60ISHsVDxg6x+YARHq+phouH9nLBGIrXI a793LhW2vleguvTcdiv/wRlCOWs302XMeSfjI1hsB2x7HsNlUp/lO4j1Wo358roX7sR8 g6XHhJF/gNnrjIZ/7S7R5zP2x7F+g8p6bS7yMt5hNxlIm92+dLAh2HXHuc1jiNcS9Qh6 nrC4rEKTRmZzbB6aeihZdycpLwF6AS8y0RMXdY+HbfMpQH9z8cNKP9NoLVQMK7tiSJSH tiaSU/vfb0YLfYmBRSe/EbdKUiywTZV4gwISwrNv1XRBVTd+bZ8PM0RxYbSAesozaHEW mA3Q== X-Gm-Message-State: AOAM53106npbp+FnuHyhQEuncQuA7B7jW+rZAYvW5hLO9slIHZyDwRLM 0+AuOSG5eBixHb9WzB+gyME= X-Google-Smtp-Source: ABdhPJzRrfzExBoG5WiegX0oe7EJkp86mMCbPiGhiwaIffVDW8BeQM+6Y/uubempegqUH6t4hmQzaA== X-Received: by 2002:a62:fc90:0:b029:213:be9a:7048 with SMTP id e138-20020a62fc900000b0290213be9a7048mr26647878pfh.4.1617042831909; Mon, 29 Mar 2021 11:33:51 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 11:33:50 -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 5/6] mm: migrate: don't split THP for misplaced NUMA page Date: Mon, 29 Mar 2021 11:33:11 -0700 Message-Id: <20210329183312.178266-6-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-Queue-Id: 575186000120 X-Stat-Signature: i1xd3xpjd8uwsf83t3at4qxdxcpur38n X-Rspamd-Server: rspam02 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf25; identity=mailfrom; envelope-from=""; helo=mail-pg1-f182.google.com; client-ip=209.85.215.182 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617042837-727643 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 --- mm/migrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 86325c750c14..1c0c873375ab 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1444,6 +1444,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); if (!swapwrite) current->flags |= PF_SWAPWRITE; @@ -1495,7 +1496,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, */ case -ENOSYS: /* THP migration is unsupported */ - if (is_thp) { + if (is_thp && !nosplit) { if (!try_split_thp(page, &page2, from)) { nr_thp_split++; goto retry;