From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (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 1F656331EAB for ; Fri, 12 Jun 2026 14:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781276020; cv=none; b=OgJJWiPfqZeb9koNpkvJ6ebBkplWwMAnJdzHQViTnuHJjNeFAwQXtY+qwFFij3L59m7pnaV5YSfMpAnNXXJevvkSj1z6UyLSn9sz5JwdWDLsgW7KUrwCVD2tUmS0Y02pRM6Ia7rhaaCYur2d8qnC8MKevlSeOakDVayl04grRoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781276020; c=relaxed/simple; bh=yhPJ3dHR/YB+EP0a1hIrHf8vQCm0LjYTimzuBnVCPjU=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=b7QYAJMpYY7y9cjsrtvzMZxZ1Es/SPSQJzJOMZW/yV0dv3awn3Ldo+clU+5AprZj+JhEmNOZWoaTt1xbw1opo5KrTZhKyJuBP47DpLf1BXFB8KMGsOG5TSGEIHfg5G0ummCrDflEKLQp1muERvyJvWH+5ExQNElXA6DXSwO3Gk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=VNLb1aNa; arc=none smtp.client-ip=95.215.58.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VNLb1aNa" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781276017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GNJC2lLL+Mfh/+Eic+aZuLdpYzJPqneDQv8WwZq+SCI=; b=VNLb1aNa9Hj3sTq0ZxGXe1rCXnudw19/YcDq9Go1CTfcnSmedKhKgU1WXzGWX2S/O3VBaV PaaE8+mjNgr1fgbssyHTDIzJk8bTmggtZJ8ZTz5KVmJ42JPGDquZxlFzXZ1FWS5/ntV2pd Ar5z07KkrZ8vxM6qkbwJd84Q3FRuRMs= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 12 Jun 2026 14:53:28 +0000 Message-Id: Cc: "Harry Yoo (Oracle)" , "Gregory Price" , , Subject: Re: [PATCH] mm/page_alloc: drop flag-conversion "optimisation" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Brendan Jackman" To: "Brendan Jackman" , "Andrew Morton" , "Vlastimil Babka" , "Suren Baghdasaryan" , "Michal Hocko" , "Johannes Weiner" , "Zi Yan" References: <20260612-gfp-pessimisation-v1-1-936eb04202e7@google.com> In-Reply-To: <20260612-gfp-pessimisation-v1-1-936eb04202e7@google.com> X-Migadu-Flow: FLOW_OUT On Fri Jun 12, 2026 at 2:15 PM UTC, Brendan Jackman wrote: > - /* > - * __GFP_HIGH is assumed to be the same as ALLOC_MIN_RESERVE > - * and __GFP_KSWAPD_RECLAIM is assumed to be the same as ALLOC_KSWAPD > - * to save two branches. > - */ > - BUILD_BUG_ON(__GFP_HIGH !=3D (__force gfp_t) ALLOC_MIN_RESERVE); > - BUILD_BUG_ON(__GFP_KSWAPD_RECLAIM !=3D (__force gfp_t) ALLOC_KSWAPD); Agh, alloc_flags_nofragment() needs to be updated too: diff --git c/mm/page_alloc.c i/mm/page_alloc.c index 9e1949ea13a6d..0111cdbdb5321 100644 --- c/mm/page_alloc.c +++ i/mm/page_alloc.c @@ -3739,13 +3739,10 @@ static bool zone_allows_reclaim(struct zone *local_= zone, struct zone *zone) static inline unsigned int alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask) { - unsigned int alloc_flags; + unsigned int alloc_flags =3D 0; - /* - * __GFP_KSWAPD_RECLAIM is assumed to be the same as ALLOC_KSWAPD - * to save a branch. - */ - alloc_flags =3D (__force int) (gfp_mask & __GFP_KSWAPD_RECLAIM); + if (gfp_mask & __GFP_KSWAPD_RECLAIM) + alloc_flags |=3D ALLOC_KSWAPD; if (defrag_mode) { alloc_flags |=3D ALLOC_NOFRAGMENT; I guess I will just send a v2 once I've tested since this is pretty easy to review anyway, any objections?