From patchwork Wed Apr 26 13:39:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13224617 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 C66B2C77B60 for ; Wed, 26 Apr 2023 13:39:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30B156B00D2; Wed, 26 Apr 2023 09:39:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BB6D6B00D4; Wed, 26 Apr 2023 09:39:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15BE36B00D5; Wed, 26 Apr 2023 09:39:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 01C5D6B00D2 for ; Wed, 26 Apr 2023 09:39:25 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C7E82A026C for ; Wed, 26 Apr 2023 13:39:25 +0000 (UTC) X-FDA: 80723649090.18.8F08D84 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf15.hostedemail.com (Postfix) with ESMTP id F32C1A0029 for ; Wed, 26 Apr 2023 13:39:23 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=VaxtGu19; spf=pass (imf15.hostedemail.com: domain of 3iilJZAoKCCsfVZYfHOTLKNVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--yosryahmed.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3iilJZAoKCCsfVZYfHOTLKNVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--yosryahmed.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=1682516364; 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=FB4DXeiyaGWRGpg1RZJs4YrYQeUFxP8q5oC/iiUzgWk=; b=1XQCVfAGWKOSWMLl1oD/XhZMh3f5GHrimq6oVDbs7ZtLNDmZreq749M2Uutl7oZNTnfHVD 5wE4j99oNpZwZwKQmDcGKKLwvjUUZoPTohkg1CYhwMTGU4JsD1GQ4S3BVxx8k/zGIXGYHF sdaNyWw5A1czpBKkIrLQOFp9WqZJBvM= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=VaxtGu19; spf=pass (imf15.hostedemail.com: domain of 3iilJZAoKCCsfVZYfHOTLKNVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--yosryahmed.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3iilJZAoKCCsfVZYfHOTLKNVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682516364; a=rsa-sha256; cv=none; b=athPflJ9Pg/rUQEozCvOMlKLLh7YAKT331OzZrpFdGeiG2WwlrASF6UKF3I9Sbr8QtMkzW 7HDHxz6i1QlwdOwMqHzWGjibPUkCnmMbOxrvAWzli5M+db0z+FgKLqO8C33W6hrCNiSXuW 0QpHgoe1/BYkxuEowaQWJ5g455dJXzY= Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-247441a8a40so4206267a91.2 for ; Wed, 26 Apr 2023 06:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682516363; x=1685108363; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=FB4DXeiyaGWRGpg1RZJs4YrYQeUFxP8q5oC/iiUzgWk=; b=VaxtGu19k3kuVkk+ogsDYgrkqMxwvzdtJ4vk+j/Lp6I4i9mu9lvKdiiKWkuyupOTDn ozjbnKgCxH2E/Ls7Yjvfztc3SrRIc8KeY5zLtjdEjn6hLMJlxR9GxSsa7uUsd5v21PhS 6zJskkks1Q60lPucu0Q3H2kJ6EoxbNvFq6bXoHcQt2qnq9ZY923IdB92he5m6GDRrNdD E5uxTQxPAZQ0o3kqCUD0cJMuFnZuNlEnXRyKGzvq7XSthDbkp2icJ0BYcacm4npiAudl TBBiR0TFcCN0mzQG5nBvB+XVl1ol5jI/+aX3gXt3LJs+prYfCnE9/NWETElIqvoaht1x wyvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682516363; x=1685108363; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FB4DXeiyaGWRGpg1RZJs4YrYQeUFxP8q5oC/iiUzgWk=; b=RjVdRknq+CE1VqxTaDB+Knyh1iPnpSuDIasWhV+nrPQAYryLuGrQ8bv5fPLfkOM86Z 7mBH0nZv6EO6Gsz6DYZnNVRoO3Afu0hdLtgqPNpu/zirFOaFaNoWzgmoDgzWs56Crg+S Nl45p/dVy3FhPsHDqymMgRIEWJx1KJyTh0NO4+okKAQprLk+nb9Kf/7zwEukOmb1UB3n EbXb1eSyGX60TxyokUZQCuu0hzF5Yl+/1g6H4UY3nDdCkDeNVEs/UIKcEbJ14NXaveHV tdhVvXDauQ6G8v0PpvwI5qWho25t9w4HRNd7RZ8ZIlUtVD22JpEIbdI9z8keXnBJNetN +E7g== X-Gm-Message-State: AAQBX9eLN7vTkdyxB/o6S7nIiYrcqB1Hu6MAK6oTsqDTR4dvlyO1wgDq uDVG2Xir9hgMfcj5HbSTv43ZWpNZ4J3EUYIq X-Google-Smtp-Source: AKy350ZjfZ+BIfyJNqEXcvm2T/R2eUKq4ijsukzf0jNghkcUNvTJFaoDf4KZq6ppxB2RiGelh8+DxoA0H1jlZhsC X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a17:90a:748e:b0:247:101f:954e with SMTP id p14-20020a17090a748e00b00247101f954emr4760228pjk.9.1682516362678; Wed, 26 Apr 2023 06:39:22 -0700 (PDT) Date: Wed, 26 Apr 2023 13:39:17 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230426133919.1342942-1-yosryahmed@google.com> Subject: [PATCH 0/2] memcg: OOM log improvements From: Yosry Ahmed To: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Andrew Morton Cc: Muchun Song , Sergey Senozhatsky , Steven Rostedt , Petr Mladek , Chris Li , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: F32C1A0029 X-Stat-Signature: b536buk4xexo43aoxa3s8knc8goo6b18 X-Rspam-User: X-HE-Tag: 1682516363-790817 X-HE-Meta: U2FsdGVkX1/i3WJHYY+mkTsv57Wm3LtqUsF6/RvnNoZ9n3BCWWYJS6onvlHv0MJm4Dc2lK50EFD6oA8IdUmMJtC9joWJcxs07BOwe6CmRnQnVstJayVZOCHrvT+1MW2qCML4cIlTUrKmQf4jxbiPe98vpH/yG48uKJJAbraHVeIu5qJwElnHQLmyZm/Bd8dvLAZtL8JQewzKg+ROjULgTmA0vHyyPKGZsirKVWm2LrKiCGbQgZ2je/EtElqbXVpoD8zwsVkk5tLHtXoSXVg4aSsRFJ7I/V8kYhvlRIjbqtDOO3+oEQOCpa2fkwsKqFJyqOVqvB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+01L4WReL+Jp4Jwmdwk+bsXgEcnhJHnl7Haq7fkWaSic8u1zNl1C9LLt+gsmrbvYdk4doDQ74tTNKACrrUdAE7zT/XMJ5J2/uemfCCPOqdFmxf/qDalsf2NeiZU91NyM4LPo5lrhJEpgH2U1k7gG25UTwj8yBWfG5HS0LBTSUMp2PjBh8w05aND9jPSWAdGPrpiZf6nIByqGjPP6tBoRwdn0YgpPZArkq56GWNgl8cMewoLyZ6l7+sYPTDq3D66gp6pSIeYvTo0Z0T5Y7ZksrUR2M19za4AIPk0vJ2K5eLbb2UZ+kqiFv5fn7qblvpG3rFfkhRXUqi8g= 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: This short patch series brings back some cgroup v1 stats in OOM logs, and it makes memcg OOM logging less reliant on printk() internals. The series uses seq_buf_do_printk() which was only recently introduced [1]. It did not land in Linus's tree yet, but ideally it will land this merge window. I thought I would share the patches meanwhile for feedback. [1]https://lore.kernel.org/lkml/20230415100110.1419872-1-senozhatsky@chromium.org/ Yosry Ahmed (2): memcg: use seq_buf_do_printk() with mem_cgroup_print_oom_meminfo() memcg: dump memory.stat during cgroup OOM for v1 mm/memcontrol.c | 85 ++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 37 deletions(-)