From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 9DC2A24DD15 for ; Tue, 24 Mar 2026 01:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774314804; cv=none; b=JgBP7DsURAljeJOHb2li1Adg+O4xiFgsiyL7sf1UoxuJ/x2j/ItbS5cZsTzvKx7bOKS+q//SjYfvMGyCxM/u8PKzhAGq8X45HkTNp4EHBFG7A6RQnezU3qIHE9/CH76zwGBvM23Ouh9jJ7bFXBqGaNoMcmfvL4ALHhyHUzqHxeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774314804; c=relaxed/simple; bh=k3hW1GH8vsiUg8ciWErkSiVxM4G9Mz7alADAL6zdcHY=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=rc4xBovEZLekoTpvCI/Lcgm5qu8mKGWSUuGYNd8NMukRBejWPeFgRt+8skh/OVBj2kwc66KnYFV87DHf+hs9M5do1b/VgkNpfPtbpNOaodccuc3HiSRrgQb6nCESVssAE7nEolBEiOEhhHaoOCot6whIYeRyBAVicxP27i/Jyzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ff915rU7; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ff915rU7" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2aeab6ff148so27335ad.1 for ; Mon, 23 Mar 2026 18:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774314803; x=1774919603; darn=vger.kernel.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=WDu91jmxCGX0vwdOqIXVmf+V+JaxTP+PZU0Tie2nYn4=; b=ff915rU7igewoW3fsQzuUMwCaiA+ZjDpImtl82skkb6hbgUsWTJVJNf8gMq3z5Uqt+ jw9Qrs4yuhPUU2SWzZrsSlZa6wFDlQBn79OE1afQDA5O2vc9qAXXk1CAONsYshDyP5kK v5s1A5FPlSYS7Qooc2ijAsDwKi1JDIap6OShIhelujOhiHUe1BaNOpbgH3DdmMQ1e92A uj9/ct9QfOyGGz0deCNdcXXsvzT+mtSj/6D9udqetw4TPcedzRYPwFX/EvWDrF/pk2YK tYjPWnRHalNC1VwMl0tj66jQXC5Vqh+NFk41TRxornk+cnuZ3hmwf4XSZ8pd/y6HUp3L CQKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774314803; x=1774919603; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WDu91jmxCGX0vwdOqIXVmf+V+JaxTP+PZU0Tie2nYn4=; b=HutbabBYA1yaDFuE6v10WO16++6YeeyQGgxA1mgcrEcPkJrrB3BmVH58Wa5ofYQ0YS oJfp9AfAXAN7E0Gk1qnrwjIZO2VfuQn9vj0pEugGosVVFgs6L1djFYAcdQK24Zbh/7YD Si0xJTCVtS7S0jntoNOHxQ3nwAXLoefwt7uknigqBEjYzMDnL9EFXuXZD6sWSK+VnU/0 4g28wP7u6PGHFBHcBEtZieuAwUoqlq35yc8I7bHWeEu931ZuJ5DHoR3bNUz1b402SMNO B1Wgq7QhXOU1tHSllTX4KVNgW9ppMaJ45YFRBYONoloYWz1mK1D3y263IAuKP4lvGhE8 cAOQ== X-Forwarded-Encrypted: i=1; AJvYcCUqGcSdIFa3ZFE2JbrFHBuzQV/TboL7BVMvzrhckXM/eEdNKUMrgVfE19cZc6GzL/+851X7476y0SbI1kM=@vger.kernel.org X-Gm-Message-State: AOJu0YwSERnpJNEz0PxvSgYxTGm5cYSLUuU3iIbFK8MBdIa+/6BMLX31 1RswPjZ8w9VHb5q/m7d/okdRelXVqKFLe+qG/ikm0O1muAo5qlnChgbPXTMvgiUrZQ== X-Gm-Gg: ATEYQzzd/BEwXQr/oxC6yZ5KAXbWB4N/FKZ3jyGOLtPPiqDdnDlvubKcQJrYparY11Q fvfTpyaa9+WxHWaI+s3JbkQYtMGq9oftPeRZBO4BS1vaPXGNDl/LlUwWXLC4Y2XlmUfALJVN+aD ERYDftmi1WbKLvFBUpGrE7CxjQB3y2v1NLTbl6Ia6F/LESuvu2njNY+aNZOJITJZfOjLCSGJpfJ 9LiOlvyDedZu8CZ1cPJuXbRwRy5OmrC7ekfj+5+OPCgiek3v+QCiTRS3r4U5aYYkrVvYLQCIhLQ KTF2XvQevUW+FPVffh+JRtpGEnToHw5w00u1VIep+q6y4YkDC22Da3BRRAV3rAPqGizF3zu7um/ puAuC6Zby16R+xVUt9FSuQZweHhqOsItZzm6GDMBHelCUJUpvHrJOX1uxuyKW75Ki1fIGcaq2G1 xr4ERsK6VAsUe/EIT1EfF7UYDHytJ04inLWzQ03hMJF64LWMuxc/8oaEYMuSlEi71uhNKtQsKMk qrJhrxHq3AoS5X0/yKp1rjFlbZRtmbG8qFzjE1ewJ66uZ8lBr3Osw== X-Received: by 2002:a17:902:cf42:b0:2b0:7a9b:82f3 with SMTP id d9443c01a7336-2b0a53e6fc7mr1554665ad.8.1774314802283; Mon, 23 Mar 2026 18:13:22 -0700 (PDT) Received: from [2a00:79e0:2eb0:8:36e5:9ffd:34bc:bb90] ([2a00:79e0:2eb0:8:36e5:9ffd:34bc:bb90]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b0836b8b95sm125621305ad.83.2026.03.23.18.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 18:13:21 -0700 (PDT) Date: Mon, 23 Mar 2026 18:13:21 -0700 (PDT) From: David Rientjes To: Michal Hocko cc: Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky Subject: Re: [RFC] mm, page_alloc: reintroduce page allocation stall warning In-Reply-To: Message-ID: <9c21e9e9-7347-18cc-9dd5-76fad75719dc@google.com> References: <30945cc3-9c4d-94bb-e7e7-dde71483800c@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 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. Thanks. > 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. 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. Idea is a 10 second threshold for reporting stalls and then only one stall report across a 10 second sliding window globally.