Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp775418imm; Mon, 21 May 2018 14:12:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpMf5Wayb0Z0kpMmQmPXkjtf6rlSAifSirRa41nCtFft7Sl4UJ0ZWsPAh9XH403E011DezC X-Received: by 2002:a62:59d1:: with SMTP id k78-v6mr21469073pfj.54.1526937150595; Mon, 21 May 2018 14:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526937150; cv=none; d=google.com; s=arc-20160816; b=hkGM1aPElswNqC4LhuKnV4kVw5cblJTM4zM9NZ9E3bD25ygGZk7nOnHOCxWcYLGCdI giv+Vu/iPhZ5Wehz15+odmVrjXgdvNI9p/I6mSREf5TTjQyLU8Dz59AFdNeWgudif3/Y pd/dBwXgmELXr0uOxkkbNq98CXSzp3i/zr4LhYBhD6Em7+9KKxw0byHm31OUnHEF9sAc nm18CsWO2GdCIpH2uPtfk2mr08kT4giN+qc1m+9KBGgvKmCRW60oqcTqgN7BZk1aO0Jg 9X6VM1xSp5TuzoMyHk3//bMnFOWxp7kVwQjjJy8UyoqrM/bbkTyW0fRuqpjD08+yGoBb 3smQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=023/a/RmkxuCgeRGs4Bv873P9j1Dbj6K6kgyY24MOxU=; b=u/doBbvHNpNNunikKX5OaU+ADt1VKAFg903WphOMnaovFoPly/xR68/1E2Wnk5/Gdg LUJlvC0Cyhpe9VNG7WW0KK5X2pSDtHsu/63CHLSiextUitCeuMQJ6pedObatVWGtY5wS TlJ+tE/MA8XiWp1LLaWd4jzy3pYi5Ca9DJBrstP9EqohRW2E+BHt6ek9xVtBKXxpjtux tkQGwHCyVzMdpN+jIbdl3eo6RJ8HUgfXFEJDRIKtfdfBR90/lRpPSnhpFKfFgaz4SjsK LC8dXsnCl/vSQa+AWPEQ8Dafua6IHc8JVhAi7mwHKvoJj6lVNV2n1RL4/d5JILtf4ecS 8NwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bGh/sFXA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si15148987pls.334.2018.05.21.14.12.16; Mon, 21 May 2018 14:12:30 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=bGh/sFXA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751177AbeEUVLY (ORCPT + 99 others); Mon, 21 May 2018 17:11:24 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34352 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbeEUVLX (ORCPT ); Mon, 21 May 2018 17:11:23 -0400 Received: by mail-pg0-f67.google.com with SMTP id k2-v6so6893907pgc.1 for ; Mon, 21 May 2018 14:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=023/a/RmkxuCgeRGs4Bv873P9j1Dbj6K6kgyY24MOxU=; b=bGh/sFXAywiCMesmaACCxqFnHDzJqIUKS8crPhNz/F+h45Wg5Y1GE94XXGbM5aHLdX fA8s7AzDl58n7eiM3yQp5mUYcRqtkRQJcf/PvA7XmpjDqjpy3YfoKHOJ3TIbvdpcegKL ccy/m7tPU89KYFwWwb3QEhKE9DNIFCKc3k9tGGYfRaDISyvjIY9WxoIA0wcC3aVt/hZ2 LSRhJqB1qJsFLzn5tWIPBO0u8tmgkdjwIQjJan26VOIwzih2Pc262Aqtfnbhe3CgCUU3 Gv+TvtGF25FPcXDR5qj34QyEdgwFynDagqvWYWqGBhIfnesex2gvP53YY8yQqZpHpB/y fmpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=023/a/RmkxuCgeRGs4Bv873P9j1Dbj6K6kgyY24MOxU=; b=IO8ZeUgEttyZWrmP4wA3LO7yxrD1DbZNZbgfw335xFcSgwJlSBV0eylp7OSeZrHzaH lZQWC9ss20OlL9NnGdrT00f/ddOdmBiLP2F1LurZ6QfTArlwMcE4U6X4fVtdVRJB7YIG xElO4PbqIDc8VOeQ8UcKS6Gk5K3dr8tiN3PMU10z2F7fFFwRY92I+N3Dv5aYOeRB/Dq7 GSv8s7J7A2a1Pr/RagPB4FD7i9S93IQDTc2YQjDiElkcdIv90f25U2KbTAtJYkY/8lEu bai8ami3MqSGwpP2SxTVT0VpMMZQ2AoTf4SHszGTHgEy2T1cc0dar0ZKCccdFw5Q43aj JqAg== X-Gm-Message-State: ALKqPwfteVGwB0XEdNILolrbNCGuPkLWuzPFvxRyfI3gr0Y+37buciCF vFdvxrJm+QPdZf8D+0WrkTO1rA== X-Received: by 2002:a62:105:: with SMTP id 5-v6mr21405370pfb.1.1526937082501; Mon, 21 May 2018 14:11:22 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id z127-v6sm20122632pgb.31.2018.05.21.14.11.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 May 2018 14:11:21 -0700 (PDT) Date: Mon, 21 May 2018 14:11:21 -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: <20180517102330.GS12670@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> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. 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?