From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0339333BBD2 for ; Mon, 30 Mar 2026 15:13:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774883613; cv=none; b=fD+Oo1gAMv23lKCL7HPphZXsD3LiIJkBgeopKuX14LnLvkYd6wLrCS86+UO73BKDC3ImQ/S2QGLVzJhlhnIr12D+wlDn9qIJKjg71c/i1KZB1KsRitJFH+qTFzQlIt2OZnUAu/xXn1CdrD4Amr6irtWFbjPmD00VRfg1EPzZHfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774883613; c=relaxed/simple; bh=mqYD+Aqa8t3eBRM1m/uNj7grHUFQp6kl4HtvJswkcMc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=q2TlbjkDa5rN6F5ZUnPOiFVq7f+YSbQsTasvcD8sFfx92eXJLUpWQn21ppGB8hLcls3TI/4+gAG6yOlCUwVCpMJXSlgZQsT7h+DgAqgXjsoUSbqbUncIrNkH3C5qmjCmDDxSxWC5tRuQRHDh4dvgMHb+CESdIX02YiGYTPdE2pk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JuqZdkyH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JuqZdkyH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A0C8C4CEF7; Mon, 30 Mar 2026 15:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774883612; bh=mqYD+Aqa8t3eBRM1m/uNj7grHUFQp6kl4HtvJswkcMc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JuqZdkyHSo4IKRBvZHfbdfpQbQYWP2lxpq5AtmkwsyO9RCwpvVVx/HBO/bRltl7qW CT+dTrmR+0jUNRA/jXMxD+uzHSt+Uy5CC5ShUlkqTVhzCl/GQOCNmy/5E02ETuPCrX qnqa+an/8yoEJv7s8XrjIV+AHKmhPR2bVV0L5mzrjIUvx8hnNbV8o6NRHPLSKEqs+u cXWFPSO1iDHWbk6cKdsFExaH2ldI92IQAV3hjTvKQifxjCLLAucPevOSKHeKsXCkZx +rUXXxVNzSnm72KrfzvsoFBmvt6MF9pXjF+zaeJeuub76PJzwrDRsUaQiq73NdjMU/ ZoaAfI6Q01w0Q== Message-ID: Date: Mon, 30 Mar 2026 17:13:28 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [patch] mm, page_alloc: reintroduce page allocation stall warning Content-Language: en-US To: Michal Hocko , David Rientjes Cc: Andrew Morton , Suren Baghdasaryan , Brendan Jackman , Johannes Weiner , Zi Yan , Petr Mladek , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <30945cc3-9c4d-94bb-e7e7-dde71483800c@google.com> <231154f8-a3c3-229a-31a7-f91ab8ec1773@google.com> From: "Vlastimil Babka (SUSE)" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/30/26 15:54, Michal Hocko wrote: > On Sun 29-03-26 18:08:52, David Rientjes wrote: >> Previously, we had warnings when a single page allocation took longer >> than reasonably expected. This was introduced in commit 63f53dea0c98 >> ("mm: warn about allocations which stall for too long"). >> >> The warning was subsequently reverted in commit 400e22499dd9 ("mm: don't >> warn about allocations which stall for too long") but for reasons >> unrelated to the warning itself. > > I think it makes sense to summarize reasons for the revert. I would > propose to change the above to somehting like > " > The warning was subsequently reverted in commit 400e22499dd9 ("mm: don't > warn about allocations which stall for too long") because it was > possible to generate memory pressure that would effectivelly stall > further progress through printk execution. > " > >> @@ -4841,6 +4884,9 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, >> if (current->flags & PF_MEMALLOC) >> goto nopage; >> >> + /* If allocation has taken excessively long, warn about it */ >> + check_alloc_stall_warn(gfp_mask, ac->nodemask, order, alloc_start_time); >> + >> /* Try direct reclaim and then allocating */ >> if (!compact_first) { >> page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, > > Is there any specific reason for this placement? Compaction can take > quite some time as well. It seems fine to me - as longs as the slowpath is retrying for 10 seconds and still can't obtain a page, there's a warning. We don't catch cases when either the get_page_from_freelist() attempt, direct compaction or direct reclaim attempt is what gets us over 10 seconds, and at the same time it results in success. If that's a concern, we should add another check_alloc_stall_warn() call under got_pg label (as the RFC had) - I'm not sure it's all achievable with a single place with the call.