From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 371CA3E867F for ; Mon, 30 Mar 2026 22:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774910063; cv=none; b=ejl/QD/f62msOiJEcM2wpdqW7hF96oD/IWtMQuRcDV+S/JBtKGVZOzuRNwXcVSAb3hy3oc6Iv97KHo6AYCt4Qe7/KnTI6hUaJiqUe4c2yjqRJxyDRnxkAerviMEEV/YoSUPHzGAkAkZ2hkPDtJpkcyfB20+OnCrFHY2RL9hiPJg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774910063; c=relaxed/simple; bh=byPrfTul5sBVDBcm+634m21z3kBCborKtbix9oU2js4=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=j7I33klQfDW9hSLUru0IieE7bM+NOVXgXVDZxoF+EFDwe0+ig3tIv4EIrV1RFeiMHJ/n+CTqpho3WwsSwnf4TM3lbX16qWnVcT+L/WtG5FFnmULl2BgPkNLTJfaYp0NgW2mZPRDxNMEzsFyOGhHaAiVDXnCdYP5TlaUBbIFN3Q8= 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=hz/fseeG; arc=none smtp.client-ip=209.85.214.175 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="hz/fseeG" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2b2591757fbso38235ad.0 for ; Mon, 30 Mar 2026 15:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774910056; x=1775514856; 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=/PvBM2KlWberUTOaHUwtkA3AEbHqB7/4ny8U9ORc3t4=; b=hz/fseeG2Vlo0x7Zt0am74ZIH/5DlkZ8SR9/NiZHTGaBKYS7AAt3XhdUnnr01cz4p7 tzE2mctLlr+3qnpUUCKxfhXUtDPa/3VC7p8LE5yhlURagaPZBhxdgdosJg7P9nbcphO/ bBxp3Oxa+BQlZXm8Nr46Wbyq2S+fA4rn5f56sQXfhggAbCFheFVmUSshigIfaQQQLZ8V IvrmkRzJGXwnuWzgA3+9Vc0bSOduNInabral9FaA0bhByKusiymqecUoA6ZX442CIZTz 8DD58i7fkMe6oppQAXLn/EequvZ57/Lm4pD1pQfugo6Z1BM7EK0nOwvhzXQqk5COVlnU zvkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774910056; x=1775514856; 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=/PvBM2KlWberUTOaHUwtkA3AEbHqB7/4ny8U9ORc3t4=; b=KuuC2cTJOsoSwHILuBgTs1pJDJqLtC7k2jdJuK1n72c+iuWKFUrzSRMYWmZbXv6jK4 rDz++BRcGeDy5jf6qBA80TtX47vQefg4/MH8GaukGWvhIRjOBdQPF5QWhI5K8MQLNxZl RcNDrYfWzgGPudAFyCEHEpyqxf4zCNutSzAseWlSA0oX7v70flS7NimuqoqCmUBMZCHW 2UGhkzhCV8hiCdo6e2tv5tlvD+w77IdbfLRn4wNJvPlhUF32+Nd3Mgj++OTMleB6wCZR z6+laGHMMHxwgS95pdwVI1WYM1Ml2Xa4kBlcfhUJeF0J9zdUlTeZr/mirzodTfAjvz0j a+5Q== X-Forwarded-Encrypted: i=1; AJvYcCVfZxZmX31xAC2npG3R7mrDRDxRCMXxErPjkqh/Pook37pNHsTJTEsH0f5xlDQb+c+owSLC6TcLS02e5XE=@vger.kernel.org X-Gm-Message-State: AOJu0YyViar7/puUUxJ4FTjMLEGP2VQ+wg7Bg1FCltGIDaArPwLvWW+2 d9BNktGXNgiBT8brc4I0sQ7z/rCp3Sv1/GydEUu1y3IaKtZ1XKuMb0zpMm/wDlDZJIGza8NccXK aF/JfwZJ1 X-Gm-Gg: ATEYQzxDzERRqUr9KR6f6RRaJyCCyZ28aQaCPXY/FcIawg+w1dljmUahTl17oXcXLUu joaKM+r0vfSWi2rAmTHNz+VnV39TsGb1WsBg6bbtICvN5hRV4r8Hvv0V6tS642fW6kfGR80NQUS ZV302CP7NosDHIg9iHHaVsUfJ5ByqwR0Z94CLZOBNyZf9hn9em+ES+19zAKZ4cIRhlR7tnfAHvH mFdPxgt86XUW6SdTyalLWsksTyKgQLEPUvXaTNjlFFaM86sbB6HzlaQWcy5o7FAcSC3pHIJgzv6 zHnhHclRYlvJG1G8ysvG5dPRFiNqd3DQJ3BsCbmM5jGR53T56aJnk0CjMPDxn/LbyxjMfR049jL Zynofo4nnfknmsfM4LKesY+uvYeNxcjtBRJA/D4L4lMVtWAS/IxnrH37JflXZyUKRNzenMlXLMQ Xm7zey7RCMX2wSEwUfYJkLtRQxzd8ick0XXm/pm/cAdZm70a3X51UmoMSAj3y9J3oUYIjWD5qFJ 556N/gyswxecOc8KJP71jST9V88lux7h/d8JVj9yx/t8O2XjtkgsQ== X-Received: by 2002:a17:903:2ca:b0:2b0:5b4c:a439 with SMTP id d9443c01a7336-2b25f6cc9b7mr1424425ad.2.1774910055410; Mon, 30 Mar 2026 15:34:15 -0700 (PDT) Received: from [2a00:79e0:2eb0:8:bec3:8e5e:fca2:7852] ([2a00:79e0:2eb0:8:bec3:8e5e:fca2:7852]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c76917bacc2sm7279445a12.26.2026.03.30.15.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 15:34:14 -0700 (PDT) Date: Mon, 30 Mar 2026 15:34:14 -0700 (PDT) From: David Rientjes To: "Vlastimil Babka (SUSE)" cc: Michal Hocko , Andrew Morton , Suren Baghdasaryan , Brendan Jackman , Johannes Weiner , Zi Yan , Petr Mladek , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [patch] mm, page_alloc: reintroduce page allocation stall warning In-Reply-To: Message-ID: References: <30945cc3-9c4d-94bb-e7e7-dde71483800c@google.com> <231154f8-a3c3-229a-31a7-f91ab8ec1773@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, 30 Mar 2026, Vlastimil Babka (SUSE) 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. > > " > > Will do! > >> @@ -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. > Right, the big idea here is that at least one of the allocations that is looping will run into the check_alloc_stall_warn(). We might miss a borderline case but the 10 seconds is already arbitrary and this is the placement where commit 63f53dea0c98 ("mm: warn about allocations which stall for too long") ended up before it was reverted.