From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753357AbeEVWyF (ORCPT ); Tue, 22 May 2018 18:54:05 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33915 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753036AbeEVWyD (ORCPT ); Tue, 22 May 2018 18:54:03 -0400 X-Google-Smtp-Source: AB8JxZoFxhmCvMUCqEAb2GaHzO9l5gDopnXTI4yUcZbiv5NoeEjo5VJgZ4mFMnWB1BileTNwa8AcQQ== Date: Tue, 22 May 2018 15:54:01 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: =?UTF-8?B?56a56Iif6ZSu?= , akpm@linux-foundation.org, 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 Subject: Re: [PATCH] Add the memcg print oom info for system oom In-Reply-To: <20180522063742.GE20020@dhcp22.suse.cz> Message-ID: References: <1526540428-12178-1-git-send-email-ufo19890607@gmail.com> <20180517071140.GQ12670@dhcp22.suse.cz> <20180517102330.GS12670@dhcp22.suse.cz> <20180522063742.GE20020@dhcp22.suse.cz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 May 2018, Michal Hocko wrote: > > I've had success with defining a single line output the includes the > > CONSTRAINT_* of the oom kill, the origin and kill memcgs, the thread name, > > pid, and uid. On system oom kills, origin and kill memcgs are left empty. > > > > oom-kill constraint=CONSTRAINT_* origin_memcg= kill_memcg= task= pid= uid= > > > > Perhaps we should introduce a single line output that will be backwards > > compatible that includes this information? > > I do not have a strong preference here. We already print cpuset on its > own line and we can do the same for the memcg. > Yes, for both the memcg that has reached its limit (origin_memcg) and the memcg the killed process is attached to (kill_memcg). It's beneficial to have a single-line output to avoid any printk interleaving or ratelimiting that includes the constraint, comm, and at least pid. (We include uid simply to find oom kills of root processes.) We already have all this information, including cpuset, cpuset nodemask, and allocation nodemask for mempolicy ooms. The only exception appears to be the kill_memcg for CONSTRAINT_NONE and for it to be emitted in a way that can't be interleaved or suppressed. Perhaps we can have this? oom-kill constraint=CONSTRAINT_* nodemask= origin_memcg= kill_memcg= task= pid= uid= For CONSTRAINT_NONE, nodemask and origin_memcg are empty. For CONSTRAINT_CPUSET and CONSTRAINT_MEMORY_POLICY, origin_memcg is empty.