Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1200121imm; Mon, 21 May 2018 23:38:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrdhef7v3HapzOHIoLJJLiO/41MF5DkhmjBp+flYWf5vLu0mVsu5H7dnzNuX5ihS/W6Hz95 X-Received: by 2002:a62:14c3:: with SMTP id 186-v6mr22934914pfu.92.1526971090674; Mon, 21 May 2018 23:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526971090; cv=none; d=google.com; s=arc-20160816; b=V8hf/NJ+eRyK/DqMlXJbmbj/YnVDj/6TyLHW73K4z5GDavr69UfM4kHLdt76tFTDqw 5jJCHO2OuK8PBX1W78qH8atrtYyqkZJnxwvs73JDgbIT8kR0Cebx3G1bOqxgcJEclFCC gPKJCkUSSdL7I4ncSmhrlxQHl2rjAZqUxzYN1sUoQ01vOQQyCFPEJzP7Aj1Rz+d4OB0V KxzgW/jIdjzOKQEzLdMsfrUf9dEsMzeD2tGQzcRGTsLMVaM3Ocx7zyCj39IFQMndEshG dvb+sC/y0WWHdwoD31X/3xAG0ghRiXB6t6gkY+Emr8j5+zoLt5rq/QasJjsY2gveIPqR ULMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=rSWRW2qeKDn4inBpVdntoO8extQnTPNit8de9fis4dI=; b=DW0F2CTmET/1NDKy82F6IQQuqsi4kFdYjMRpA9wyDesED3pZ1v1F6Wo0ZqSXHaOFaK WC16PiMEfK4D102wEcPp0Ida89bhtaBPC1LdA740GN/bX9eGf2ScnWty+2uGiVyKhTRo uLPpCoA22uKiGOC/zfHmn34LvRHMzOxidFHHQBVMY2mTRrm0duFpHrgTWktqFKJqRxLg cPhHn6vUr0rV4XmBmcQkSG5pm9VEzUcxk6neewYDqR5RzZcWnaKqw/ItXRnbfWYrrh1T DidXbSw0vYpIiThkk0JC25YCsrGq1EaTUKEPyZ2DWXO/LvaUrgQ0Ayvrk8oKpy1FJbRl 7TWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18-v6si15881556plp.159.2018.05.21.23.37.55; Mon, 21 May 2018 23:38:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751059AbeEVGhq (ORCPT + 99 others); Tue, 22 May 2018 02:37:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:53164 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbeEVGhp (ORCPT ); Tue, 22 May 2018 02:37:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E118DAEB3; Tue, 22 May 2018 06:37:43 +0000 (UTC) Date: Tue, 22 May 2018 08:37:42 +0200 From: Michal Hocko To: David Rientjes 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 Message-ID: <20180522063742.GE20020@dhcp22.suse.cz> References: <1526540428-12178-1-git-send-email-ufo19890607@gmail.com> <20180517071140.GQ12670@dhcp22.suse.cz> <20180517102330.GS12670@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 21-05-18 14:11:21, David Rientjes wrote: > On Thu, 17 May 2018, Michal Hocko wrote: > > > this is not 5 lines at all. We dump memcg stats for the whole oom memcg > > subtree. For your patch it would be the whole subtree of the memcg of > > the oom victim. With cgroup v1 this can be quite deep as tasks can > > belong to inter-nodes as well. Would be > > > > pr_info("Task in "); > > pr_cont_cgroup_path(task_cgroup(p, memory_cgrp_id)); > > pr_cont(" killed as a result of limit of "); > > > > part of that output sufficient for your usecase? > > There's no memcg to print as the limit in the above, but it does seem like > the single line output is all that is needed in this case. Yeah, that is exactly what I was proposing. I just copy&pasted the whole part to make it clear which part of mem_cgroup_print_oom_info I meant. Referring to "killed as a reslt of limit of" was misleading. Sorry about that. > It might be useful to discuss a single line output that specifies relevant > information about the context of the oom kill, the killed thread, and the > memcg of that thread, in a way that will be backwards compatible. The > messages in the oom killer have been restructured over time, I don't > believe there is a backwards compatible way to search for an oom event in > the kernel log. Agreed > 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. -- Michal Hocko SUSE Labs