From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22AE822E3F0 for ; Tue, 23 Jun 2026 13:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782221966; cv=none; b=IO4hqzf2RnxpjIgGZ0ZAQUwezBP3lHFPluFz3H0GTBEbm4efsnYAJlScFHigZCX/OdYndJeZxdpSP73qopQ0jflUX/yQulI4nBSPeHuu3RcGf6m7gX4AtkgFsQAwltEr5Q+vuWiSmJF6bCBF5/YhkoC73lJAlJ39v8nHAqyi7co= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782221966; c=relaxed/simple; bh=xHHB6NQzXcenF9hiXmjYg9a641PLrAi19+A2H3FqOLQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XJtYe/0jPTXGZ3dI3iJYP3+Nyi042hUCLKGwTvja2uxlM6fHB+GbYTClJpamNaDoUP2mZCRln8ENpB3Ilo5x8kOSJ0YhK20tE5mvAbRfMfZ1nxcMy+sKo5uUgCCgd57EnJPaFMl1WK/seuph3cgH90eK+CiSLUozt1SxKpD05kM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=Oe9K+DoY; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="Oe9K+DoY" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-8de7bfa31d5so64364556d6.1 for ; Tue, 23 Jun 2026 06:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1782221963; x=1782826763; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=2J98377WQS3y16xqvGNUJknuO+TiKvKHCI0DFFHE/W4=; b=Oe9K+DoYU0YYuNRl4moqOP/TESNvc9j/qeMGbnXGtXbfBdWwKZm12ojXa+eSM0gwNz LN7X/s0GXU+DNSLOFks2YGv8pvKrp8tyYFvYs5lEW1Ux/V4t0Iur88vOI6lLu+/8VO+c cGCPFyciS8+5WRGrGZBF4J3C7rsy9mg8gBll3wn1bLFwCyRg5/kpsjTJbaBaW88d6BjO qVzsq7yyNVTw+cDex9eDbPB/TonSmkmvXSLvD3dkXJAJJQ/zhJGVmDwiOstfErBG0s75 Qqhel/pVfUAsZZdRL9XDlMuDq4DNuni1MiDD+PLfYyx8KvNgWtU+hH/mag2ejW+f6K3s DMyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782221963; x=1782826763; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2J98377WQS3y16xqvGNUJknuO+TiKvKHCI0DFFHE/W4=; b=jWc5meGT8NTroTZYHU3VHosGrHiINTktqFng0VrCKWHk9at8XsVjrF6TIKryXVQaLm PD8MZVLtLYyBsssE4YKthqw0hTrylA1kxdr17dPIMrEXMi3rdSj/H4gemChc3ejyB/ev eWk5PVtmlWMNhmP0MzThY69GoPbAFlmrB21y07j9iSgkYiC4/WJlNlYSlijkd5g8ELU2 8P+hBs6cJ2Km4jPcaUhxTe7aSTWH9L5tTc/1dZz3/w0uPuem3VRV6IclNmcUf5cS3Qlk qCursZOechZ62Nx+gMjnEpvI7UUGsxckp+GZNB8SCWBPohl62GVs1lhvltHzw5uQHZ1c XcXg== X-Forwarded-Encrypted: i=1; AHgh+RoKXiwsN5oWRhaEqyCnWKhuIT0vVjnheGuouk/7H2wO/2UHaEGxU8xJ0elQaV3rwIcGEBVj40i7F3pvsAY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx31Dy105vJaQKL083TtDKlHMpU/LW502CDxNd6P8A5Hy9/yI0b eTawlO/AOBa2vBYh/1/YrrQoY6MDAQsN9hGhTEZh2HF4hq5uypgsJ9WQJJHF6FxnEKA= X-Gm-Gg: AfdE7cl2aGfCq1ewdJuaRQM3/4Qc9+J6vja8PPEH2jXY5jOGqKpD48AhIf+9phUrtB/ C5N5XNo6t8UsFDcuSsoxZStpwT9KlqxlB2Q2ZEX3qs/+N1mxmsorBsy2tlU4l50MtL5LSN0elZc NGdPtYARgallSYiuArpeiLhWyJkWsjTeHzyYCAD+Uipcs07KhCU10/Rw6h51N4FxDaJXVM2W2ZF GW+okxzvUgUu+T2MXoGQR4r6tozBKuW/0kxyC28ZgK2qYD5fVlknfzx9zvuq+d05VIoSl4iTdVw Se+BjqXULzXYCrW+tIhZ5GGeZJ9yWve5wC/Ctk66a9vK8NkLzMS0vOngqOkjuiAheJwJO3Wtl5x vuecMU3vJnoWbW3i994ccCwr+kaXoAw5ghbpYpmFoE6b1sKNpSv6DOawmf8nquoL1IlCrsBeX+R LDN52Q1RY2cLc= X-Received: by 2002:a05:6214:da5:b0:8ce:ba04:7bc2 with SMTP id 6a1803df08f44-8e436bae74cmr38533566d6.38.1782221962860; Tue, 23 Jun 2026 06:39:22 -0700 (PDT) Received: from localhost ([2603:7001:f100:500:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8df82b67affsm126378406d6.45.2026.06.23.06.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2026 06:39:22 -0700 (PDT) Date: Tue, 23 Jun 2026 09:39:21 -0400 From: Johannes Weiner To: JP Kobryn Cc: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, jackmanb@google.com, ziy@nvidia.com, fvdl@google.com, linux-mm@kvack.org, shakeel.butt@linux.dev, usama.arif@linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm/page_alloc: use existing highatomic reserves on the buddy fastpath Message-ID: References: <20260623004600.113347-1-jp.kobryn@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260623004600.113347-1-jp.kobryn@linux.dev> On Mon, Jun 22, 2026 at 05:46:00PM -0700, JP Kobryn wrote: > ALLOC_HIGHATOMIC currently provides both access to MIGRATE_HIGHATOMIC free > pages and permission to create new highatomic pageblock reserves. This > makes it unsuitable for the fastpath. > > However, the fastpath can reach rmqueue_buddy() while MIGRATE_HIGHATOMIC > reserves have free pages available. In this situation, the allocation can > fall back to other migratetypes without trying those reserves first. > > Allow high-priority non-blocking allocations to use existing > MIGRATE_HIGHATOMIC reserves on the buddy fastpath without growing them. > First tighten the criteria for reserving pageblocks so that growth may only > occur in the slowpath. Then allow fastpath usage by enabling > ALLOC_HIGHATOMIC when the GFP mask describes a non-blocking high-priority > allocation. This logic has been factored out from gfp_to_alloc_flags() to a > new function gfp_to_alloc_flags_nonblocking(). > > A UDP receive workload was run with free MIGRATE_HIGHATOMIC pageblocks > available in the target zone. Before this patch, the workload did not > consume these blocks. With this patch, eligible order-1 allocations > reaching the buddy path consumed existing MIGRATE_HIGHATOMIC pageblocks, > with no highatomic misses observed. The workload did not grow highatomic > reserves and NAPI page-frag allocations remained healthy with no failures > or order-0 fallbacks. > > Signed-off-by: JP Kobryn Awesome. Acked-by: Johannes Weiner