From patchwork Wed Aug 14 21:50:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Rasmussen X-Patchwork-Id: 13764175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7402BC3DA4A for ; Wed, 14 Aug 2024 21:50:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFD7D6B00A2; Wed, 14 Aug 2024 17:50:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E848E6B00A7; Wed, 14 Aug 2024 17:50:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFE8A6B00A8; Wed, 14 Aug 2024 17:50:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AC2916B00A2 for ; Wed, 14 Aug 2024 17:50:47 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 565CCC11C6 for ; Wed, 14 Aug 2024 21:50:47 +0000 (UTC) X-FDA: 82452196134.03.A8D9B60 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf02.hostedemail.com (Postfix) with ESMTP id 92BB880026 for ; Wed, 14 Aug 2024 21:50:45 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JjuVfe0+; spf=pass (imf02.hostedemail.com: domain of 3tCa9Zg0KCDMPmTagPhbjhhTcVddVaT.RdbaXcjm-bbZkPRZ.dgV@flex--axelrasmussen.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3tCa9Zg0KCDMPmTagPhbjhhTcVddVaT.RdbaXcjm-bbZkPRZ.dgV@flex--axelrasmussen.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723672209; a=rsa-sha256; cv=none; b=XON6qC1U+qiDSiZwTBPW6NjEL7HnPQOBPhyA2kXqPhY7iTJxDLZQSo+tMfbBongOBgdacW vx4t6S5pdq8O4RAW1hyxH46v7oBhIFdnPijDIlXhmcrJYUyybv5DK453A7jTGi1jpjiyV6 TsmvLgmQflSIMukfaPsQWMCvsaKHGLU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JjuVfe0+; spf=pass (imf02.hostedemail.com: domain of 3tCa9Zg0KCDMPmTagPhbjhhTcVddVaT.RdbaXcjm-bbZkPRZ.dgV@flex--axelrasmussen.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3tCa9Zg0KCDMPmTagPhbjhhTcVddVaT.RdbaXcjm-bbZkPRZ.dgV@flex--axelrasmussen.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723672209; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=k5OX94grY8hyL7diumJH+t2unjjn6ITYGDaDXBZM2Bc=; b=JIds6woEdQ5EDWCVT+fxhMzcusV/NqE8db+auJ2lVdq/Kxv9x4trDJUbBUYWxMgxtZav9O ydeOQUeUuza7UEpegd44QPe3CwN04wPgsYz/Pr+HftP28cnHh5RiU3unCGYghMa2kUsjCb Q/704PaSJmoYtpaVHTzX9crDdkpYIME= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6ad9ffa0d77so7825837b3.2 for ; Wed, 14 Aug 2024 14:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723672244; x=1724277044; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=k5OX94grY8hyL7diumJH+t2unjjn6ITYGDaDXBZM2Bc=; b=JjuVfe0+HzxS8Bv6xuaDfdTeLWu6wE2dYGAMXSOp7M6AneRx/LEZTD+/oSLkK/RlQY TXobv3hIxXAVGEKugUuH1SGvEdNyR4ZzDRLRJViR4TGQCLI8OIvCqu9ecKebvGjv2iub 7mLmADiI5HfR9hUag4EdILtM0WdV0lmVuB7tXlDhQRMRKXYzT0KTzu5glWF0uzD9UiOh WvHRORfUPgrZ2/gcutNNyUjGdELBYY3MBwSCMvSpM7CWfsl4pbfnTjX2sVtOuSFhfCEZ EM7BjMRZgu6BB8ZpJlGJLTA7FkV2Z23Yo8yRfmJ0B34qq60dqUpXLsLGCJVqnhoxtXNY skGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723672244; x=1724277044; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=k5OX94grY8hyL7diumJH+t2unjjn6ITYGDaDXBZM2Bc=; b=qB6O66giJAt0jE6D5XE8xEiX7iVC0j53chrUsI/JXKDaGPyMr2+TNhKAPvtApazGY2 fgrsNB08Tjdtlp8yUt2Y72sGr9tkR2l2OpyNpkuqlUVIyXFsCrIOJ/xNqWhLvfBi9hey xhsto9sBCg7Cv8MJ8YubWwx+brDGJjFeKTHD6JnY0NiCGkyMRY3dCu1lp5lKf54d1QWb twrzgotbYEt+xAKPYMrHRVFIEJX/WnEw7bLfFktIBUTu/l+pV+8/utbdQfLhQqC/X5lX IWgH5zdufL5mZqGbyY3AkwQ3Oe0JO+ihYe3b6FMmPo2neeS8OaY+yqcL2lfVRyizMaA+ Mm3Q== X-Forwarded-Encrypted: i=1; AJvYcCUN+HJcYxcAtuzTqdA8ZbTcmsa0da0U+oHhx7Pram4OJ6RkAFGY6f6eF9ND2H0d+xmlqbDIJpEl9Q0MRqpgs9v9duM= X-Gm-Message-State: AOJu0YxIEc2UfTLBtoXYXqA6qmLKKJtnFudmrqMNM0v1+YbRjwgqevwX 97gl+03kYJfjANFspx+tEhYUfwthvJN4t6t9M0xatfdPXnhjWViuUyb1SzfplirUAfXpLHCX/F6 RXCS8/ju71CM6YH4Tq1mEGKxjaLCOuw== X-Google-Smtp-Source: AGHT+IFPiDdFGR1aWZK85BEwSg325PLhNL0DGuA2zOO5ph8zaDBTexAvMLjut8J5+Akgj8EA9C7pKmbXjhCEWEp3KNhg X-Received: from axel.svl.corp.google.com ([2620:15c:2a3:200:b717:ce18:c4e5:73ba]) (user=axelrasmussen job=sendgmr) by 2002:a0d:c9c3:0:b0:673:b39a:92ce with SMTP id 00721157ae682-6ac9621a45amr1249407b3.3.1723672244595; Wed, 14 Aug 2024 14:50:44 -0700 (PDT) Date: Wed, 14 Aug 2024 14:50:37 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog Message-ID: <20240814215037.1870645-1-axelrasmussen@google.com> Subject: [PATCH v2] mm, slub: print CPU id (and its node) on slab OOM From: Axel Rasmussen To: Andrew Morton , Christoph Lameter , David Rientjes , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Joonsoo Kim , Pekka Enberg , Roman Gushchin , Vlastimil Babka Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Axel Rasmussen X-Stat-Signature: eamta7kydwd6cuqjzw1u3u4wyfmudro5 X-Rspamd-Queue-Id: 92BB880026 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1723672245-581932 X-HE-Meta: U2FsdGVkX19GI1qD3aN3GHtovQ/V2PTOKChcQ5qIrBbv/v+aFei+Vhw/bPohXis52sYtei3bkSR/Xe0xaNMdzJ9gi46eWaGr7vjA1MlTPtw1l9HctuAwiHww9Z0IXHfvzH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PqwwWL0+LRCmUNrIZf5XR4Zj9mJ5IBbSR0wOz8LQ4vQKjBG16+o8qu0StWTz97hcTvrBn6x+/obrLq3vMr2AD3GbNuKI/aHn3UO9aF64TWRfPrGGuBB00eXQ7CJh1XNYdKFPA1VgTCBNmcYtrTZzrIo2eMGK889djC+3+5gHjPuao9REZpIFOUhYIBucgiZD1ngnG9eNQRegGceeKCtVK5bi6cZM0j7m48mbPFgAyI8p35uThKgtusPwxe6Qkpn9dMReZbRzHlU79lVFlI0dImvTfhTHeh9863QkqjguMxCukIJILTQSk1IL3Dr727IIbX5xcKhpUsYbIn72GDdummFsuqiaSmlQT5efRgAYpGOPlV4BDYTHd+2nBQMVTIm69/0xjWdkkRmO++WIuhLlMTFtn+7h+riN5vShGPZm551H9/4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Depending on how remote_node_defrag_ratio is configured, allocations can end up in this path as a result of the local node being OOM, despite the allocation overall being unconstrained (node == -1). When we print a warning, printing the current CPU makes that situation more clear (i.e., you can immediately see which node's OOM status matters for the allocation at hand). Acked-by: David Rientjes Signed-off-by: Axel Rasmussen --- mm/slub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index c9d8a2497fd6..3088260bf75d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3416,14 +3416,15 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid) { static DEFINE_RATELIMIT_STATE(slub_oom_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); + int cpu = raw_smp_processor_id(); int node; struct kmem_cache_node *n; if ((gfpflags & __GFP_NOWARN) || !__ratelimit(&slub_oom_rs)) return; - pr_warn("SLUB: Unable to allocate memory on node %d, gfp=%#x(%pGg)\n", - nid, gfpflags, &gfpflags); + pr_warn("SLUB: Unable to allocate memory on CPU %u (of node %d) on node %d, gfp=%#x(%pGg)\n", + cpu, cpu_to_node(cpu), nid, gfpflags, &gfpflags); pr_warn(" cache: %s, object size: %u, buffer size: %u, default order: %u, min order: %u\n", s->name, s->object_size, s->size, oo_order(s->oo), oo_order(s->min));