From patchwork Tue May 18 20:07:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12265591 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 6DE10C433B4 for ; Tue, 18 May 2021 20:08:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 166B061074 for ; Tue, 18 May 2021 20:08:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 166B061074 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 A709A8E004B; Tue, 18 May 2021 16:08:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A46D38E002F; Tue, 18 May 2021 16:08:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89C608E004B; Tue, 18 May 2021 16:08:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 556AB8E002F for ; Tue, 18 May 2021 16:08:30 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id EE01C8249980 for ; Tue, 18 May 2021 20:08:29 +0000 (UTC) X-FDA: 78155439138.11.0FEFBDE Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf09.hostedemail.com (Postfix) with ESMTP id 1A94C60006E7 for ; Tue, 18 May 2021 20:08:26 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id t11so6140814pjm.0 for ; Tue, 18 May 2021 13:08:29 -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=xsOsjkhPCcPV0zv6oCcbmotnPtBUzCdIBSrvKgiDikA=; b=SwtmZy7QhVhjTdJlzMLxTCWs9t9a8LPJVRDTfGexGYehagSrQXPy+sobHKasW8WhMi vyV+EDOWiHNG0QHiCEaYBWXlmDvgeZnSCrI4kVdoDW1fnMCb5fLVB4oqPzCldtWSd+Aq gnIYMHgbuzjF1EoItH0nV+nzV6vuIjtVYMQ0NhpjLnAt37nvq8soPHEWH/eA6ajm/r13 IB2pUlLLDtEFKgoRUKuJp9XPRlvKj8c8YlJtdggxxjE6Kx+uMm6CBKme163wi42wIKX2 azfWKcO/Ws8VlDvHQOVcmOUNGTp7+WJM1G1SkP4IQhPMyODP/qleLPrnGGRja+3FeoXW Nifw== 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=xsOsjkhPCcPV0zv6oCcbmotnPtBUzCdIBSrvKgiDikA=; b=phltRc9YipV2qJeacRS0v1hVR0h0dtT8Z4cmR3ZaHJXWmXwDoQ8eDcvGv+CU8Vm8w+ Nsf9iNhBfBslF4cMpeUbO3ETtRWLjJtOqXdquYPJ1GMRF1E4s18s97+S9qE+gNeobjLb VDDHCFBwxIXZIWxDMznlqZfjtw/sQJ2zueO+2DK91FROcotWWC+1a/Iz6ARuGxwHOhWf xrLKC+rF5YcRCyYW3wkPKdX4K4hfPePGBJHjuvwYo2ngDub6+eppMMdtrzC+gMyBVyFs vGPckq7lcdd8F5IIqO8H9a0Lafv5Ca2wZzbe9KPYUUvbbXjbcXK5N8BU+0QI7prv1Hdo W7ow== X-Gm-Message-State: AOAM533wnkdK8SvL+6F02kahmufc8PXqZTduojhboBW5EPmeN09fWIxr U+Q/eloNU0AvGFuzodrbSsw= X-Google-Smtp-Source: ABdhPJytDWDaq+aC4veI99lmSFliP67cUhY8lIZXHRGfmTdfTnvkUJxAwyUWmh809yNfMsIcSzth1w== X-Received: by 2002:a17:90a:6402:: with SMTP id g2mr7237187pjj.82.1621368508608; Tue, 18 May 2021 13:08:28 -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 r11sm13456600pgl.34.2021.05.18.13.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 13:08:27 -0700 (PDT) From: Yang Shi To: mgorman@suse.de, kirill.shutemov@linux.intel.com, ziy@nvidia.com, ying.huang@intel.com, mhocko@suse.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: [v3 PATCH 5/7] mm: migrate: don't split THP for misplaced NUMA page Date: Tue, 18 May 2021 13:07:59 -0700 Message-Id: <20210518200801.7413-6-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210518200801.7413-1-shy828301@gmail.com> References: <20210518200801.7413-1-shy828301@gmail.com> MIME-Version: 1.0 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SwtmZy7Q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Stat-Signature: 66d8mgtnecioh96ny6asmyuoe1btmhd9 X-Rspamd-Queue-Id: 1A94C60006E7 X-Rspamd-Server: rspam02 X-HE-Tag: 1621368506-579910 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. Acked-by: Mel Gorman Signed-off-by: Yang Shi --- mm/migrate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 26f79f516100..035daaec1ca0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1420,6 +1420,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); @@ -1491,8 +1492,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;