From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 DCDF123EABA for ; Tue, 24 Mar 2026 08:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774339539; cv=none; b=iMjMzVuN74SiljjULmN2uePRXy8xrkC0aJR+nfqnz8LYTCU10s4fXQTCUNrK1rx5Or9igVOm3LA/CuXTGaOLGNhKQ+GkAoOY4gidgI+VlhK1e24srLVwyn/1frYAS7nIWLwM3SPfT3K5ADGt+jsCEEPm8aXKoU+ijnWlTbb9Dp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774339539; c=relaxed/simple; bh=vxrqKNe+dY9u1X+1hwEXCCHe+3R3+u66zxEkR1lB378=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R7VXUNXW0CsoWxZdNYwqRoDhnr1PFu4/yu5RdKKkC03yzwdghna0Y1rSdZBgBo5FAlebhCkqe5i/+onzMtvw43DQ9Tph61PMOgZCUXvtLkN/bK9voTZU/+8pT4gmCAGh3jjCiwCoNMEGiTdlFBN0XKzBAi4kZckHTo8oLxV2amk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=CXl7uSK3; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="CXl7uSK3" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-486fb439299so40549215e9.0 for ; Tue, 24 Mar 2026 01:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774339532; x=1774944332; 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=Q0NpOffqjMqcV8jV0/vhM5nPOC+eRNL/BePS9aFCdNM=; b=CXl7uSK3F2SaZCR9S357tglZz5jGyinrvYrLKQJP55QhgjrmrOnjEbMractlqL7Fxj /Ge5/VjMzULar1JRwOpmQUkJe1F0UveqRT5x3nab86inrYV+Vb0zxORgGnz6nBJ3Eqw2 eFyQlQQ1XFEiCgMnTSuQMdJg5Ft9v0UTJxkY0AKs2p64Zc6qJqAs293b2P+X9mTn302l riE9ouPYD6fSbtBHEHwuSBMeUpeMWQk5qCYJI67F9gGu7+5oIjb9U5hwBHcsAj0kN1yb jkjLXgEIY0pEPOsdQGV8up6tAjQyCLgwmd0Ams0OLNNptCFuYog+8HTsOYqVxTeELwWF TbTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774339532; x=1774944332; 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=Q0NpOffqjMqcV8jV0/vhM5nPOC+eRNL/BePS9aFCdNM=; b=ktXZVdPaTBUsysjfzpGLkBVQdRr0b6lYY+Z2fJ/6mfvLPzYAk4NzNRlaylVyfQX/Ji gcY1wrcGLpt2ocYL7Ge7NP3S0m7+UjvK6ounVdsGMRFHubiHPuHNemhHM/4FtT5LMH1b nLKB1dxzZR3SKh3PfS+HCQ2jsAiMf/AzVaEyN+dwrRG/zEp/Yp4S+OHgZ2Za/DyNGyU+ WTHa1hFBVClsdlQKEUvk1LTmc5l+L94GgLBgKCIuj/gCcuN6kxtGoe0qZ2oc6EZed8Av ptkqwEJRzZZjhayEM4vDdaUytFsQv7KnDU/XI2hVocjGaOPpAdB8VDj7eTbZlpfxdzfn 37Wg== X-Forwarded-Encrypted: i=1; AJvYcCWry1GKgHdUfFC7sQCIIhj+t0Se2qm3N4BEhzkFuHWoZXAfWuLgW8Qoyvsp4NKPTv+S+M9dsMzoUxFxNVE=@vger.kernel.org X-Gm-Message-State: AOJu0Ywo9OBZtGiuTotBLAECNWwaomR2E59vvKNutnS9KFJDNsuDaLwo T4pejRRNeAeYomm5Z+PLTGalIsQmVU7acsw9OD3ndzmCZM8TIoiSvaqf47c1KddUIQs= X-Gm-Gg: ATEYQzxVzNyn+EeSLyL/eKcXsn1XheUTuw/t+HecI6HCcpxV0p7c28tpSas5Kl6m98x NE74a6ezDwcpPgbHBiqHb4/1/NqwOAe3M6YTLH3j5hd3oArQ/iDyjKn0XJb2ICqICcuGLamxbMy YLEcEqY/i9QSXufuwO7AAZ9scDwN0vSX8RBR1M82TMgKYrEulCzKgRkeH8nKXcF62QgiwBdjpwX b0PR0Zcwiqu0gWTuV+Xy618xCMYQBOYP2YfcnAMhomkcy/swK2yTAdlkOo5ScUnhsSbZYGwPmBS RtgdmynbETC8KTdo/LUj7gufWltw33Yd1bXzupQTSS+RHoPm5eYXSibT/EmCoDgZhFpWha+vRnL xhxvCeqRnbiwv3XwTLfamvgAdajhrNWkQV8QZWPlQJJkqKgLukubsHvqR08TY5KsIUdcka36tiJ geXmcpZs7VVP82iQXlRhqc0RCo7w== X-Received: by 2002:a05:600c:3549:b0:485:3fe6:21f5 with SMTP id 5b1f17b1804b1-486fedb5928mr203551635e9.10.1774339531769; Tue, 24 Mar 2026 01:05:31 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4871105d17csm14847475e9.14.2026.03.24.01.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 01:05:31 -0700 (PDT) Date: Tue, 24 Mar 2026 09:05:29 +0100 From: Petr Mladek To: David Rientjes Cc: Michal Hocko , Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Steven Rostedt , John Ogness , Sergey Senozhatsky Subject: Re: [RFC] mm, page_alloc: reintroduce page allocation stall warning Message-ID: References: <30945cc3-9c4d-94bb-e7e7-dde71483800c@google.com> <9c21e9e9-7347-18cc-9dd5-76fad75719dc@google.com> 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: <9c21e9e9-7347-18cc-9dd5-76fad75719dc@google.com> On Mon 2026-03-23 18:13:21, David Rientjes wrote: > On Mon, 23 Mar 2026, Michal Hocko wrote: > > > On Sat 21-03-26 20:03:16, 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. > > > > > > Page allocation stalls in excess of 10 seconds are always useful to debug > > > because they can result in severe userspace unresponsiveness. Adding > > > this artifact can be used to correlate with userspace going out to lunch > > > and to understand the state of memory at the time. > > > > > > There should be a reasonable expectation that this warning will never > > > trigger given it is very passive, it starts with a 10 second floor to > > > begin with. If it does trigger, this reveals an issue that should be > > > fixed: a single page allocation should never loop for more than 10 > > > seconds without oom killing to make memory available. > > > > > > Unlike the original implementation, this implementation only reports > > > stalls that are at least a second longer than the longest stall reported > > > thus far. > > > > Am all for reintroducing the warning in some shape. The biggest problem > > back then was printk being too eager to stomp all the work at a single > > executing context. Not sure this is still the case. Let's add printk > > maintainers. printk() is still a constraint. There is an API which allows to offload printk() into a kthread but only few console drivers have been converted so far. Most console drivers, including the most common uart 8250, are still using the legacy loop in printk()/console_unlock(). In addition, the new API introduced an emergency context which forces synchronous flush of printk messages even for the converted console drivers. The emergency context is currently used, for example, by WARN() or RCU stall report. So, there always will be a risk that too many pending messages might cause a stall. > > Also it makes some sense to differentiate stalled callers and show_mem > > which is more verbose. The former tells us who is affected and the > > second will give us more context and we want to get some information > > about all of them. The latter can be printed much less often as it will > > describe situation for a batch of concurrent ones. > > > > Based on Vlastimil's suggestion I think this is trending in the direction > of 10-second reporting windows system wide unless that doesn't work for > some reason. This is a wise idea. > I do worry about reporting many stalls even without > show_mem(), however. In situations where the allocations are > unconstained, all userspace goes out to lunch for 10 seconds and that can > result in thousands of threads all reporting stalls and spamming the > kernel log. Yeah, this looks scary even when all console drivers handled messages in kthreads. I believe that printing details about all the stalled tasks is not worth it. It might be enough to add an atomic counter and print the number of stalled tasks within last 10 seconds. > Idea is a 10 second threshold for reporting stalls and then only one stall > report across a 10 second sliding window globally. I wonder if this even could be added to the existing watchdog, aka report the number of stalled allocations in watchdog_timer_fn(). Best Regards, Petr