From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 2D2D5185E4A for ; Mon, 5 Jan 2026 02:32:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767580373; cv=none; b=LQRKCbbGqKZigrRIx/AZeyOirPNMQFa997qoIhEgA07LIdWErGLWHmnH6i/4sLSkN6oQCghUu+Z2RDLeshFaLZiKyjTwmwpvYoMaLm8X/7BZpZRVPVV7wU/MsvpvzIfI8Q+ifGvNioMcAjUYrGr1DiLUXfL258bS2SPO5JTKoEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767580373; c=relaxed/simple; bh=CcsBX9P9QHeYuIV05QumPqPw4iSGycbL/Me3T7VPrAQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kFckADDdsaT9/Rh5b0CpbEWTIhxQ5kSOK/TV26iEsqvzUZpIOyNEk2RloFlhhtAkGaJgX1K7Xhlb8RAST64Fq2YFRakoNHz5mF+mhyEdrsFePvhHb5epmiM92FIMd0JndWUc73ak1mhsEopWquSNRdgEn+xCk48Eh0HX+Fa/6K8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=BMc5I14R; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BMc5I14R" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lCeFINuEpZTgO83TvN70WfqLpvLxXbwhEJYmsPx6DPA=; b=BMc5I14RUoMck9ZAvxtXoxbUu9 eL1ReVBSaA4jKnqyxn+Y3X8dgEeOAeyuqC/pdzKEKVFD3GqpHwGHwa8nEQIolaCy0l2vFAbAgBBy+ 56ldn6XtNISYMSbsQ706P/B5VWDKQXIr2g1zR14EthGkKgjHQZCR4UZzwiuW2x2JxcqYDVrtwn09z vgf4rvEvwNcS51by1OXxLMPCLaTVLrMi8UukdF64QbBw6CR2rQE/Fngm8Xm012pWKKO7WDYrc2R4U 7wv2nm8hjedMkqa7laLIOvEUK8RYX5Xfa56fMen6KrCIaY8/jDgXWP+Ks2I+i3df4gOKVTczvh3W5 IN+5bYgw==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1vcaOc-00000009l6D-2VNa; Mon, 05 Jan 2026 02:32:38 +0000 Date: Mon, 5 Jan 2026 02:32:38 +0000 From: Matthew Wilcox To: Andrew Morton Cc: wujing , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qiliang Yuan Subject: Re: [PATCH 1/1] mm/page_alloc: auto-tune min_free_kbytes on atomic allocation failure Message-ID: References: <20260104101443.f10264bc9730de884b52c5a2@linux-foundation.org> 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: <20260104101443.f10264bc9730de884b52c5a2@linux-foundation.org> On Sun, Jan 04, 2026 at 10:14:43AM -0800, Andrew Morton wrote: > On Sun, 4 Jan 2026 20:26:52 +0800 wujing wrote: > > > Introduce a mechanism to dynamically increase vm.min_free_kbytes when > > critical atomic allocations (GFP_ATOMIC, order-0) fail. This prevents > > recurring network packet drops or other atomic failures by proactively > > reserving more memory. > > Seems like a good idea, however it's very likely that the networking > people have looked into this rather a lot. Can I suggest that you > engage with them? netdev@vger.kernel.org. Agreed, the networking people should definitely be brought into this. I'm broadly in favour of something like this patch. We should do more auto-tuning and less reliant on sysadmin intervention. I have two questions: 1. Is doubling too aggressive? Would an increase of, say, 10% or 20% be more appropriate? 2. Do we have to wait for failure before increasing? Could we schedule the increase for when we get to within, say, 10% of the current limit? > > The adjustment doubles min_free_kbytes upon upon failure (exponential backoff), > > capped at 1% of total RAM. > > But no attempt to reduce it again after the load spike has gone away. Hm, how would we do that? Automatically decay by 5%, 300 seconds after increasing; then schedule another decay for 300 seconds after that until we get down to something appropriately smaller? > > + /* Auto-tuning: trigger boost if atomic allocation fails */ > > + if ((gfp_mask & GFP_ATOMIC) && order == 0) > > + schedule_work(&boost_min_free_kbytes_work); > > + > > Probably this should be selectable and tunable via a kernel boot > parameter or a procfs tunable. But I suggest you not do that work > until having discussed the approach with the networking developers. Ugh, please, no new tunables. Let's just implement an algorithm that works.