From nobody Tue Apr 7 23:43:02 2026 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E05E3C0607; Wed, 11 Mar 2026 11:03:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773227044; cv=none; b=Wso8MDqFWa8REIs/f6G/UE4oaOCvIEbe/TLftqhilmOncM9rof2iaJ7BlPs5uRpoI8rdFRdvU6lNdJd8s2UF/S35WEfp9ureoUnNVzzXLBeAobMyegX4a/7e7GJK0S70P4gsXNXT5EaVQ84fTWAnb4xooaErO3UGX87qOtb96MI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773227044; c=relaxed/simple; bh=DiS/za7Xcx9BgyGTN/XlBOt/05ajBcBSWxbepSobKo8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t8rDeszfTyhXnqVtGtzVAD397hgQQxn0QPhbbdcegDFbUeIlOOgQt0ZdakmadhkqHbtKwE1Jd9Q9+WywUycGPxgJN9jth3ewUrdgxbw3qdKEdl3Oz0SA92ZtKIlEK2lqBRWfG8fW+J6fS9mkkR4SXQAk8M03fnHLvc1HhK9+ohM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr; spf=pass smtp.mailfrom=ghiti.fr; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id B34EA4333F; Wed, 11 Mar 2026 11:03:53 +0000 (UTC) From: Alexandre Ghiti To: akpm@linux-foundation.org Cc: alexghiti@kernel.org, kernel-team@meta.com, akinobu.mita@gmail.com, david@kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, hannes@cmpxchg.org, zhengqi.arch@bytedance.com, shakeel.butt@linux.dev, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, gourry@gourry.net, apopple@nvidia.com, byungchul@sk.com, joshua.hahnjy@gmail.com, matthew.brost@intel.com, rakie.kim@sk.com, ying.huang@linux.alibaba.com, ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexandre Ghiti , Bing Jiao , stable@vger.kernel.org Subject: [PATCH 3/4] mm: Fix demotion gfp by clearing GFP_RECLAIM after setting GFP_TRANSHUGE Date: Wed, 11 Mar 2026 12:02:42 +0100 Message-ID: <20260311110314.237315-4-alex@ghiti.fr> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260311110314.237315-1-alex@ghiti.fr> References: <20260311110314.237315-1-alex@ghiti.fr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: alex@ghiti.fr X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvkeefjeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigrnhgurhgvucfihhhithhiuceorghlvgigsehghhhithhirdhfrheqnecuggftrfgrthhtvghrnhepledufffftefhjeefhfefueekveffheejtdeilefgkeejtdeugeefudfhieefgfdunecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepvdeivddtmedutdgumegttdelvdemgedttdemmeehmeefrgeivgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedviedvtdemuddtugemtgdtledvmeegtddtmeemheemfegriegvpdhhvghloheprghlvgigghhhihhtihdqfhgvughorhgrqdfrhfegofekiedvrfdrthhhvghfrggtvggsohhokhdrtghomhdpmhgrihhlfhhrohhmpegrlhgvgiesghhhihhtihdrfhhrpdhqihgupeeufeeggfetgeeffeefhfdpmhhouggvpehsmhhtphhouhhtpdhnsggprhgtphhtthhopeeftddprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheprghlvgigghhhihhtiheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepk hgvrhhnvghlqdhtvggrmhesmhgvthgrrdgtohhmpdhrtghpthhtoheprghkihhnohgsuhhmihhtrgesghhmrghilhdrtghomhdprhgtphhtthhopegurghvihgusehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlohhrvghniihordhsthhorghkvghssehorhgrtghlvgdrtghomh X-GND-State: clean Content-Type: text/plain; charset="utf-8" GFP_TRANSHUGE sets __GFP_DIRECT_RECLAIM so we must clear GFP_RECLAIM after, not before. Reported-by: Bing Jiao Closes: https://lore.kernel.org/linux-mm/aXlKOxGGI9zne8sl@google.com/ Fixes: 9933a0c8a539 ("mm/migrate: clear __GFP_RECLAIM to make the migration= callback consistent with regular THP allocations") Cc: stable@vger.kernel.org Signed-off-by: Alexandre Ghiti --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 2c3d489ecf51..ee533a4d38db 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2190,12 +2190,12 @@ struct folio *alloc_migration_target(struct folio *= src, unsigned long private) } =20 if (folio_test_large(src)) { + gfp_mask |=3D GFP_TRANSHUGE; /* * clear __GFP_RECLAIM to make the migration callback * consistent with regular THP allocations. */ gfp_mask &=3D ~__GFP_RECLAIM; - gfp_mask |=3D GFP_TRANSHUGE; order =3D folio_order(src); } zidx =3D folio_zonenum(src); --=20 2.53.0