From patchwork Thu Dec 5 08:52:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895568 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A808DE7716C for ; Thu, 5 Dec 2024 15:27:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA2556B00DC; Thu, 5 Dec 2024 10:19:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B1EE6B0137; Thu, 5 Dec 2024 10:19:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E58186B00C0; Thu, 5 Dec 2024 10:19:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 953606B0082 for ; Thu, 5 Dec 2024 03:52:32 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3FB7814143A for ; Thu, 5 Dec 2024 08:52:32 +0000 (UTC) X-FDA: 82860288630.03.2026221 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id BC09B4000E for ; Thu, 5 Dec 2024 08:52:14 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=jGS+Cv5j; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733388743; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lZSFDwJlAKXFJSXVwhmhlyEP18MO+pVAWVa/JNjtNys=; b=6YEil//g70qlogAeoDzIE25IuvJF7zennaGuwhLAuHAHI4r6I/9C1x7kRDyzwl5s4wFaew 7Gj/RD2oEdUd8HE5Es0Vw87A1+S4QA9xmsxfwrvfstmbTGcSsHn6lIpytddWKt4+VHpXAR XJf1lFpZC6PnbFr2OW1HtvouoHaY/jw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733388743; a=rsa-sha256; cv=none; b=HESpj1flRI1WTXC6BnGKYnEYwBsm9u/7cWjPcsNSnVdr2qn/LVqYxWsX3ue06cOI5bvBTT 9VrJRBjX+/mvztCSFE55XpBE6vRKmHSakuLUIEhkmNxmvU4kc9ZzBUsMT1p00RB3lf7F// hAVlbW6LBpkUBaVpQ5YdlQfPbVEb9Gw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=jGS+Cv5j; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733388750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lZSFDwJlAKXFJSXVwhmhlyEP18MO+pVAWVa/JNjtNys=; b=jGS+Cv5jOTtQqIlqfCQrEHi1OQrpdK1cRCyFlcOEzYzIm19nnnXgeq6ZB4O2RJELYRD0vT wwA8fZAqcorrDRkRr4mbxfJBHRlU/RhiOKf2GWepD5Tbl7VpxdhJ7gTtohCSEPyceFrsGR lq7q3Y9zYPDNmFt1qbbNUIJz0o7MuaQ= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-_HdlSJJMNgqYTxIvmncL3A-1; Thu, 05 Dec 2024 03:52:26 -0500 X-MC-Unique: _HdlSJJMNgqYTxIvmncL3A-1 X-Mimecast-MFC-AGG-ID: _HdlSJJMNgqYTxIvmncL3A Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AD67819560A2; Thu, 5 Dec 2024 08:52:25 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.64.94]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E6A101956052; Thu, 5 Dec 2024 08:52:22 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Vlastimil Babka , Oscar Salvador , Zi Yan Subject: [PATCH v1 1/2] mm/page_alloc: don't use __GFP_HARDWALL when migrating pages via alloc_contig*() Date: Thu, 5 Dec 2024 09:52:16 +0100 Message-ID: <20241205085217.2086353-2-david@redhat.com> In-Reply-To: <20241205085217.2086353-1-david@redhat.com> References: <20241205085217.2086353-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BC09B4000E X-Stat-Signature: wyn7341tykod87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j1ONTOI4RuqdZaIsPnMNQopXBVTw1U6PLHT0gKJLOf+hLjzheM+lsuwAuj7CiglBWAAJJYnJM2u1ZeUtHZJ/wElbsQS8XujXitbOh9ozVHQKFUDxNiXjVYtU/wRqsstoZoAsp7YinXkr3HNCGKexWUMg3YRsU8jLlVLUhgA7yTVbvlxPzq3OoGsnlf6qnR9X5bU+OnfdIw40xGb5RjKVo2VKXsGjj6tXyyutUufAWKM3a/xi7RUFiLj5UZULdn5nMzlf1AyYHVphEKsIZyaxLkkOYksVbgPCJk+x+/gEqQeQSysG2L7/9XToDHmSFo8K7YNYS++gdcCr1G3Ig4TEuVHA+lky0zfhI3nrdPy52JDdA== 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: List-Subscribe: List-Unsubscribe: We'll migrate pages allocated by other contexts; respecting the cpuset of the alloc_contig*() caller when allocating a migration target does not make sense. Drop the __GFP_HARDWALL. Note that in an ideal world, migration code could figure out the cpuset of the original context and take that into consideration. Suggested-by: Vlastimil Babka Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 48a291c485df..acadfcf654fd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6410,11 +6410,11 @@ static int __alloc_contig_verify_gfp_mask(gfp_t gfp_mask, gfp_t *gfp_cc_mask) * page range. Migratable pages are movable, __GFP_MOVABLE is implied * for them. * - * Traditionally we always had __GFP_HARDWALL|__GFP_RETRY_MAYFAIL set, - * keep doing that to not degrade callers. + * Traditionally we always had __GFP_RETRY_MAYFAIL set, keep doing that + * to not degrade callers. */ *gfp_cc_mask = (gfp_mask & (reclaim_mask | cc_action_mask)) | - __GFP_HARDWALL | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL; + __GFP_MOVABLE | __GFP_RETRY_MAYFAIL; return 0; } From patchwork Thu Dec 5 08:52:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13895562 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEFBFE7716C for ; Thu, 5 Dec 2024 15:26:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 95B266B009D; Thu, 5 Dec 2024 10:19:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C2D96B00E2; Thu, 5 Dec 2024 10:19:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CAAF86B011B; Thu, 5 Dec 2024 10:19:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1CB966B0082 for ; Thu, 5 Dec 2024 03:52:36 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C14731A148C for ; Thu, 5 Dec 2024 08:52:35 +0000 (UTC) X-FDA: 82860289176.11.B99C7B1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf08.hostedemail.com (Postfix) with ESMTP id C9F8B16000F for ; Thu, 5 Dec 2024 08:52:23 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LfIiTthv; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733388746; a=rsa-sha256; cv=none; b=fjrQGhUmACtnJcg7fPjMu6ySOUwa8U2EtpsVy3prcpB/GLeKQlgHA17RzWLsalSndBB1Hr BKSZoTO4K5i2Gs5ZKYmJMmPC9GeBWejOW55/isyo/VHiY68Mp0dlSDiYkHRDK/azQrKfcp ZyngYPTtNlFGMu8ddmTOfEZJs2nNGeU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LfIiTthv; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733388746; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5/0LS59BHWZxT7JElUljbxSyn36zBZn8FjqEt24DcDM=; b=Clxs1S1Ndw9czFupFXa8MjrrI/b/Ff9fIDS3AadF6Slxvcqx+A5kGT1We6xkkAlpyEi7DW XZtaRVF3/jIJmGUMi5ob41h5ozf+5kPE2COXCabLAT64qcFz06XUFjqZMfflXsLAphn0vF 0aIF2kn1qrrzAZJzSipX7JOJucs530g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733388753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5/0LS59BHWZxT7JElUljbxSyn36zBZn8FjqEt24DcDM=; b=LfIiTthv2ZSgsI1F4RLNlvvC2aYAyMmrmKlwu1D2oPi0SVsQzEi05gWSYaykca9VSSWnWu YlJjvwLyiAiz3b5cIcptsgUXi9pn5TG7XzMVvEKQZTp9eKC3rP9G3PPtxKbW30ArZ1JvjH ZQZ5ZCjiOqRXtJ9/5oB+VjU6tbioRMI= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-FzyjMJjlOHicLiRvrIQLYQ-1; Thu, 05 Dec 2024 03:52:30 -0500 X-MC-Unique: FzyjMJjlOHicLiRvrIQLYQ-1 X-Mimecast-MFC-AGG-ID: FzyjMJjlOHicLiRvrIQLYQ Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D7201195608C; Thu, 5 Dec 2024 08:52:28 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.22.64.94]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 47B051956052; Thu, 5 Dec 2024 08:52:25 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Vlastimil Babka , Oscar Salvador , Zi Yan Subject: [PATCH v1 2/2] mm/memory_hotplug: don't use __GFP_HARDWALL when migrating pages via memory offlining Date: Thu, 5 Dec 2024 09:52:17 +0100 Message-ID: <20241205085217.2086353-3-david@redhat.com> In-Reply-To: <20241205085217.2086353-1-david@redhat.com> References: <20241205085217.2086353-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C9F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sPcKbKclObaUvJk05z9PPlminlexWZBntBbZqpf1S5grN89vbQBXbfQjC9FlalrtGZq89ck64ebaZKaIdHjkF+yiGqNvcfztpBpKgQR+yxKcH1kC/jEJN/R2l1RSrEegq7qbUXY5+opTm7y21UF7Fqkil0A3fAM/xccj60sHknLCndU5j/Pu/RnhQun75RuukKLCOv0+a0aL2vdhjAoIrdB5VouQDhnMRqGHB+2eJlJ1OoSlZDQB1++3kOWv8mOWZC23Vl/FojfwjsF26Er27Mjl13MmFXPqVI00KxhnhrR0j6W8eU7WWc/5XHQkX7IaFdyclXte+Oui82GOesFfeV9RJJzsh1cm0QZ1keSgmcUuaMCYniHdaX/zEOE0DLT+LU9fueIib1A== 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: List-Subscribe: List-Unsubscribe: We'll migrate pages allocated by other context; respecting the cpuset of the memory offlining context when allocating a migration target does not make sense. Drop the __GFP_HARDWALL by using GFP_KERNEL. Note that in an ideal world, migration code could figure out the cpuset of the original context and take that into consideration. Suggested-by: Vlastimil Babka Signed-off-by: David Hildenbrand Acked-by: Oscar Salvador --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 5f497ccf473d..3b6f93962481 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1838,7 +1838,7 @@ static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) nodemask_t nmask = node_states[N_MEMORY]; struct migration_target_control mtc = { .nmask = &nmask, - .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, + .gfp_mask = GFP_KERNEL | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, .reason = MR_MEMORY_HOTPLUG, }; int ret;