From patchwork Tue Jul 3 10:57:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?56a56Iif6ZSu?= X-Patchwork-Id: 10503807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 32480602BC for ; Tue, 3 Jul 2018 10:57:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FF0928871 for ; Tue, 3 Jul 2018 10:57:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 939EE2887E; Tue, 3 Jul 2018 10:57:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, FROM_EXCESS_BASE64, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C211428871 for ; Tue, 3 Jul 2018 10:57:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB3256B0003; Tue, 3 Jul 2018 06:57:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A626B6B0005; Tue, 3 Jul 2018 06:57:29 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9520D6B0006; Tue, 3 Jul 2018 06:57:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by kanga.kvack.org (Postfix) with ESMTP id 212EB6B0003 for ; Tue, 3 Jul 2018 06:57:29 -0400 (EDT) Received: by mail-lf0-f71.google.com with SMTP id u23-v6so439883lfc.5 for ; Tue, 03 Jul 2018 03:57:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:mime-version:references :in-reply-to:from:date:message-id:subject:to:cc; bh=KSCaFAHLehS/ms3KFvzsmh+Y+qPusddtC4+qob4UH2s=; b=Ad5NCmTRSTyTaaNYy2MEG9cDCRfHiWZejQ99toAtatIpNS810T3hgmDcFEFABbIPOM /1Wg4/nSZhCCCjLS36c/lL3Gb0muGQ65N9H/Ai502+nJPsEsOJkegoQO59wDl33SEnPG fB3d7NzNckLN0UzCqWEXDoYuh/5g71qufomjrmuZA2EWADxLe86H9TFtH5xtDOGsMjlp LG/a+kv450Pi2KcKenGm79lcExuBPvCpJ7ZNfXUN37/w88aFYNvNaoS2svu4qX8qtcav 2rwPy3lluELbri7q7sLKtidb3q1XSl1BQimwr0a7bk+r/QUCNNIn0eNKDm6uBwaCtv1/ p8rQ== X-Gm-Message-State: APt69E2BkiCr4e/j0tIhjXVJ+OqJoGswcy9rxwDdCCL+f0wJvg0m18du 7D6KU4lAb3kZhKExRVsydBGoAWk8+2zeQOPKktnODhvH5JLGqf5Kxx8NtZE0c4FehreUI3nqWcb NQWVzkRPYHZm6QPaCHxnDV4aBfesAXfyYrUJyjIdp+YMavY+LaY0NBrgcZRWtqkksR8cnpVQgxo g6zZ5jl4DLM39muQ7SMP2NcJHifutXdUNMJoThOcQ3oegzCtnbHtbpKhT0j9SNyy5XmJF2/R4Tv F25jJsvjmmkDerSeIZohPzA3jgfOL3HOZqmtkDkpatwEuyHeRq+rCqybQ79xUfSzKSIaLz8m2of MsMZd1eW0WsbqxLkWooYMxVqKvAj8WZD9OKL6doWceYiVMQo7CAdpGc9yM2oJ2FmX71vT75+yVk x X-Received: by 2002:a2e:10ca:: with SMTP id 71-v6mr18688035ljq.59.1530615447265; Tue, 03 Jul 2018 03:57:27 -0700 (PDT) X-Received: by 2002:a2e:10ca:: with SMTP id 71-v6mr18688003ljq.59.1530615446387; Tue, 03 Jul 2018 03:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530615446; cv=none; d=google.com; s=arc-20160816; b=jMAvXmwjWV/rFzOM0uXmKn1jJbp4wHUGQpaNb9i1uWo6dKEvrdQm2XE01ytrnZcGhj oczo/M3cqWOQdAZ0MppTV/afj+8sfytrr1w2DfGg12CirOPCYBaJNloH4KkfK7QjdWli yR8Ifn+PL7XaKNtQSgicjaSyhwOpNgm1ERmPgimxpV7jzTO+CwFU7X7nbBwNZCmgDf/L IGtTnCz1sBgQdD7+ya8gKhLf8IlAl51WFs4ZNvjNCHWl5Kym+GGwDxlyefSn8mYMpaWQ pgY8FjYlhoQ9BP62U1PXYgym3acrRTbFO43qJwyqavk6ZCkmGeyeCbsdzvXtLL3xatPd UOeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature:arc-authentication-results; bh=KSCaFAHLehS/ms3KFvzsmh+Y+qPusddtC4+qob4UH2s=; b=HRZWUWP5wB6nWxP1kTTiugbryTfINHwKeYyptSvJJrvAz0NKmxv3jNTgIVHuXWbx0N aYKTZ76fk1v3QVr+o0YdKmn2V0D9YmojZEP+MXAo7kkSmx1eljFeK95LecysiQaGkaHx jXqv9nSSF+1hdSrq22Lyi66EMJjMBo0cy739kkzPN2gTVZjRxDVzvKD4YCO+qNXd7pNY V+n3D3D3qzaP/5uQPXBHPFdZB7y8dQlTYUisabI4NGvei7oGoIfdilW9uXORny+6b4lZ 8HaMD4C+eeS5IcTNbBkOINeb5frK1GkhxQizXeEWn/KuBRyYYZDszP34GCLelsZMZRiJ Y48w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iXzYQenE; spf=pass (google.com: domain of ufo19890607@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=ufo19890607@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m29-v6sor232364lfj.79.2018.07.03.03.57.26 for (Google Transport Security); Tue, 03 Jul 2018 03:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of ufo19890607@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iXzYQenE; spf=pass (google.com: domain of ufo19890607@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=ufo19890607@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KSCaFAHLehS/ms3KFvzsmh+Y+qPusddtC4+qob4UH2s=; b=iXzYQenEVE3y1OnbafOENT+3FqqyNqijUiO/VlG3jViRziJG4Gct1p8DZtusWuErBu 8WZNJ7j4NXDRyjinkbavuvGt1/BNpzdLt3HsJY94Ecv9dXP8MCXwZVz/nEMDaSZ8amYY Wbm9joyfm3LuumLN5qWqQEqXRD2XBultn7PmQ9wZ8Y19P9018PN5yfp1EYEWzClAqBCU MJzSmZf9eoT/mv/Up5Y+qHTAjYq6fuN3mD6UWhRg3pK5uyZe2PjbcK+JZ7Kr7FYkNaFa QJXTIRWKhoFCCRvvshcDQb7tNA0RjvQ6mZClQ19GesgT8PTMDucHIkqAaGNaR8CmnuV0 +7uA== X-Google-Smtp-Source: AAOMgpeEr+J00PBMxH0Cx2DQ9frB/61iXLGIoQABfKPPPpJs3VoJLbjToc5MmSOyH4+gtcpVYD7c+MRxMo1UOtWzJLs= X-Received: by 2002:a19:fc3:: with SMTP id 64-v6mr20314237lfp.46.1530615445955; Tue, 03 Jul 2018 03:57:25 -0700 (PDT) MIME-Version: 1.0 References: <1530376739-20459-1-git-send-email-ufo19890607@gmail.com> <20180702101732.GD19043@dhcp22.suse.cz> In-Reply-To: <20180702101732.GD19043@dhcp22.suse.cz> From: =?UTF-8?B?56a56Iif6ZSu?= Date: Tue, 3 Jul 2018 18:57:14 +0800 Message-ID: Subject: Re: [PATCH v11 1/2] Refactor part of the oom report in dump_header To: mhocko@kernel.org Cc: akpm@linux-foundation.org, rientjes@google.com, kirill.shutemov@linux.intel.com, aarcange@redhat.com, penguin-kernel@i-love.sakura.ne.jp, guro@fb.com, yang.s@alibaba-inc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wind Yu 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: X-Virus-Scanned: ClamAV using ClamSMTP Hi Michal cpuset_print_current_mems_allowed is also invoked by warn_alloc(page_alloc.c). So, can I remove the current->comm output in the pr_info ? > > From: yuzhoujian > > > > The current system wide oom report prints information about the victim > > and the allocation context and restrictions. It, however, doesn't > > provide any information about memory cgroup the victim belongs to. This > > information can be interesting for container users because they can find > > the victim's container much more easily. > > > > I follow the advices of David Rientjes and Michal Hocko, and refactor > > part of the oom report. After this patch, users can get the memcg's > > path from the oom report and check the certain container more quickly. > > > > The oom print info after this patch: > > oom-kill:constraint=,nodemask=,oom_memcg=,task_memcg=,task=,pid=,uid= > > This changelog doesn't correspond to the patch. Also while we were > discussing this off-list, I have suggested to pull the cpuset info into > the single line output. > > What about the following? > " > OOM report contains several sections. The first one is the allocation > context that has triggered the OOM. Then we have cpuset context > followed by the stack trace of the OOM path. Followed by the oom > eligible tasks and the information about the chosen oom victim. > > One thing that makes parsing more awkward than necessary is that we do > not have a single and easily parsable line about the oom context. This > patch is reorganizing the oom report to > 1) who invoked oom and what was the allocation request > [ 126.168182] panic invoked oom-killer: gfp_mask=0x6280ca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), order=0, oom_score_adj=0 > > 2) OOM stack trace > [ 126.169806] CPU: 23 PID: 8668 Comm: panic Not tainted 4.18.0-rc2+ #36 > [ 126.170494] Hardware name: Inspur SA5212M4/YZMB-00370-107, BIOS 4.1.10 11/14/2016 > [ 126.171197] Call Trace: > [ 126.171901] dump_stack+0x5a/0x73 > [ 126.172593] dump_header+0x58/0x2dc > [ 126.173294] oom_kill_process+0x228/0x420 > [ 126.173999] ? oom_badness+0x2a/0x130 > [ 126.174705] out_of_memory+0x11a/0x4a0 > [ 126.175415] __alloc_pages_slowpath+0x7cc/0xa1e > [ 126.176128] ? __alloc_pages_slowpath+0x194/0xa1e > [ 126.176853] ? page_counter_try_charge+0x54/0xc0 > [ 126.177580] __alloc_pages_nodemask+0x277/0x290 > [ 126.178319] alloc_pages_vma+0x73/0x180 > [ 126.179058] do_anonymous_page+0xed/0x5a0 > [ 126.179825] __handle_mm_fault+0xbb3/0xe70 > [ 126.180566] handle_mm_fault+0xfa/0x210 > [ 126.181313] __do_page_fault+0x233/0x4c0 > [ 126.182063] do_page_fault+0x32/0x140 > [ 126.182812] ? page_fault+0x8/0x30 > [ 126.183560] page_fault+0x1e/0x30 > > 3) oom context (contrains and the chosen victim) > [ 126.190619] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0-1,task=panic,pid= 8673,uid= 0 > > An admin can easily get the full oom context at a single line which > makes parsing much easier. > " > -- > Michal Hocko > SUSE Labs diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index d8b12e0d39cd..09b8ef6186c6 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -2666,9 +2666,9 @@ void cpuset_print_current_mems_allowed(void) rcu_read_lock(); cgrp = task_cs(current)->css.cgroup; - pr_info("%s cpuset=", current->comm); + pr_info(",cpuset="); pr_cont_cgroup_name(cgrp); - pr_cont(" mems_allowed=%*pbl\n", + pr_cont(",mems_allowed=%*pbl", nodemask_pr_args(¤t->mems_allowed)); > > On Sun 01-07-18 00:38:58, ufo19890607@gmail.com wrote: