From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 09E0D4DA9D2 for ; Fri, 9 Oct 2026 12:50:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791550215; cv=none; b=qlOwm7mRN/gM/ZZgrwbRS067UiG2NYD6flLkquIgixvHxWuzEcuWyGmya4CFGZry3rK4eHKQ6bce8hu+Jcz4y1T0kPSoYV71fR7AeCtFPhJ9Ye5Xyplud+rB5agSEKPk9OxVPytZLD/du70o3UCmlWeaUD9tsvVazLWj9tS3sYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791550215; c=relaxed/simple; bh=Vm/Hck2b9bM9igyRdhUPr6w4WmDAa6R5TgT2R8RCzOk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sUHH2fAF3cQFS8Sr18G4RgaTTb9fggWHasND7M2epuBGAYX3onqn7BizxX+gPCqUIpwU4hvkAT4SRRYAu3//JtE5CxodGVh1JikxjfpGtp6hLkOaP2YqyKI+lkHEfxZmssV0UlSeUHWFeHsl6hP0EYYwbj2UsAOb7QYR88PCgA8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=AwftwgVG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=D+30l+Gc; arc=none smtp.client-ip=103.168.172.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="AwftwgVG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="D+30l+Gc" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 04CFD1400123 for ; Fri, 9 Oct 2026 08:50:08 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Fri, 09 Oct 2026 08:50:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1791550207; x= 1791636607; bh=kwuLlWvseYD+74dMnCLktedh4fOzXytMC82OiOvL5ak=; b=A wftwgVGELghKG4AwtQpy25D1oTqdyYSv1F0iE+dqzNYbQyl8drsVqpsja9Im+iVr AlAGCfNLzubPKjjjirM+khSbXmAMkgYIMb/dzJHKWucl31BPU/nsDn5KPYA4sm3G 5bBPb7qiEjKEgtAnEW0UjGL4EVmBxkXsc/xu8gBAVfSorI7FXGr/ZwDNQWCroUnF ZIAdcRy0utvee4Wr6ScPnWqd+/+KoIxCMwePu/J7/inVadWDuK7WZWXHn5q5Kuh0 hZS3lmaVONsdtkoyZx0nu10kqz0gziTTlw/IBpGipzvfcN8BjiigjeKPf9Hf2igB yp+cxfYzic08UK2uVQDqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1791550207; x=1791636607; bh=kwuLlWvseYD+74dMnCLktedh4fOzXytMC82 OiOvL5ak=; b=D+30l+Gce/d3Zh4f+q8ngVvAcVDQhSfZgGub0mYOK7g3qJZXjpu V9MFsEObI4hcjX13BGYAQzUBVNtBrOTiq1vt5QhrC21YV1Z4tFxqxYURJ7QJphBA MRPCJLPoGvR4KXM+dNr/YyiEbWNWx7vjMxMiiDPU9cMpPQcaW/XM91AH9aime9RZ PJzUZwTM9Azf0JAJXiPQsJPuZ6qV+KZGops9PKV0FNnVefAoXl1VJgr2YG8PJhDC vLrFLohrezJ3+1GoSF1ExImvwoSjwVf/XsRyodsNZ+TXW3//uj4uKMlL8u5ZrJ6P YPCH9HbHf5XZ7vEv5UgUvPumZFUr+i7Y4vQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=sign d=shutemov.name a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1791550207; d=shutemov.name; mf=PGtpcmlsbEBzaHV0ZW1vdi5uYW1lPg==; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:qw4zieB8evT1ctrtzdgwoPJriiiSLh5khFZacOoeXy/PqVx w9PYNoh9Pp9SB6lRL/aTw0+jjW+KpIqv/SX/YIU1hjrcIfoLK49gdfIwAiSjtLpv PF7XbH4oxzCxmrkkMTj79KGcJ63k7Ob/OslzMhzX2xFTiCXH9XayoifOj9zqtMYN SIctY9Vq5MGIuKWlQljLIAK1Zd+pYQkyV8k2cpvnKc5GLih8iKQNQmXzTnzhdOPM GrjkRq6uLF3qJqw+tNMP5i4xO3oR8sxSz/GFP6n3+8EngLZKzfJ3CuYJWBnyxRw+ HmlKMnTmgol8NC1GesC+xi7Sl8Q2pnNWyrwnPag==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:dPwl2ptZ8KQ3KssmzCbccTofY//b/3Xh8ddybmaiLhI=:Vm/Hck2b9bM9igyRdhUPr6w4WmDAa6R5TgT2R8RCzOk=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTERXjv5sRhphf2UpmNikN5/RjMZ9jdv2AoBQ3JcwuQkL+3XVeY6isvJ/I/LHHxVfn MKwVsK/+JLYhLu9ZrsWE8W0rCySsp2zlzECQxKGDnlMSG71Ip3pNKIKK2mocz6/wEaNrkF 7TA6zmnT5XM08JHDewuy71GqykKz0AmDsneejn77fVdgbVpFO2viBVmYbl6T020Qj7ZyTs jtSROHjwQMvePCMcSRku+ZeCkxc2CraVCmn0F5I/pbfzaxI2d1NPkMZFfe4v45ILMJqBcK THyiEYkQbzTWWuGKgnbx2D9+yDexwl4Y8t54Nm+i0K06Hrd2I9AYEUu+LtwsAn8iy8tYQu /RER2RoYALbg+AEeDMuIcA7xo9Bw9oVDNBUt8GBTNQKHhiYyvGnE99BcPF4Z6H9Sqjl9TU SzfVqySmJTqUp+dvjCbTwthQ6ZdKtalOx/l8QeTNp5xFTmaFF1DVfNcvM3pyDPpb21Www6 3R3slpGbiMqAzaIIRUsYMPRPNxuTaQWRtECOrTDRwaaq/Vk38K3WtX2Pghy4rw5doBSXNq E9pkEHFEX0nrwHiLAo6fFaNSULmknGZhmsHc3t4jTpHIwDKewXL9fimqBZTV9HK5kVaQnZ agMSisNVLgaNkf5hzfNCMymSL//IYqaAJA7B+GsF5DUsPdmLKl9qp6ZaY0Qg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 9 Oct 2026 08:50:06 -0400 (EDT) Date: Fri, 9 Oct 2026 13:50:05 +0100 From: Kiryl Shutsemau To: Usama Arif Cc: Andrew Morton , Vlastimil Babka , Johannes Weiner , David Hildenbrand , Harry Yoo , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Zi Yan , Shakeel Butt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH v2] mm: page_alloc: make defrag_mode retries follow the promoted order Message-ID: References: <20261006091815.897133-1-kirill@shutemov.name> <20261007155316.2010164-1-usama.arif@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: <20261007155316.2010164-1-usama.arif@linux.dev> On Wed, Oct 07, 2026 at 08:53:14AM -0700, Usama Arif wrote: > > @@ -5007,14 +5034,20 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, > > * of free memory (see __compaction_suitable) > > */ > > if (did_some_progress > 0 && can_compact && > > - should_compact_retry(gfp_mask, ac, order, alloc_flags, > > - compact_result, &compact_priority, > > + should_compact_retry(gfp_mask, ac, order, reclaim_order, > > + alloc_flags, compact_result, &compact_priority, > > &compaction_retries)) > > goto retry; > > > > - /* Reclaim/compaction failed to prevent the fallback */ > > + /* > > + * Reclaim/compaction failed to prevent the fallback. The retry > > + * budget was spent on making blocks, not on the request itself; > > + * give the fallback a fresh one before considering OOM. > > + */ > > if (defrag_mode && (alloc_flags & ALLOC_NOFRAGMENT)) { > > alloc_flags &= ~ALLOC_NOFRAGMENT; > > + no_progress_loops = 0; > > + compaction_retries = 0; > > Should these counters be reset only when the work order was actually > promoted? > > For movable requests, and requests already at or above pageblock > order, `reclaim_order == order`. Their retry budget was therefore > spent on the request itself rather than on promoted pageblock > production. Resetting the counters here can give those requests > another 17 no-progress reclaim attempts, plus additional > compaction-success retries, before OOM or allocation failure. > > How about: > if (reclaim_order != order) { > no_progress_loops = 0; > compaction_retries = 0; > } > > instead? Fair enough. A movable request only gets here after 16 rounds without progress at its own order, so the reset would just delay the OOM kill. Will restrict it to reclaim_order != order in v3. -- Kiryl Shutsemau / Kirill A. Shutemov