Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2365028yba; Thu, 25 Apr 2019 15:21:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaYhzVRPVdMGVkhB2Svd6RNI8D+ZxwRZUpG9Bh5PyI7EehwJhyk6gn3msLJh3ocYx2KWLh X-Received: by 2002:aa7:914d:: with SMTP id 13mr43145390pfi.149.1556230886662; Thu, 25 Apr 2019 15:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556230886; cv=none; d=google.com; s=arc-20160816; b=QkmugQ6wIuzM/NY/JgdMuSdVJCzLsXoP8/sCHck/jMhz42gjmWnikpgrxScUDnz0Mw 6fEgXlobR1aQmZ9PGNTTAVePGZm1Fd8g20tPSzkhTFjqJYCpqb5yWKzRtO/Yv/mgq92r hAD1+kULXzTxzf3g6piBLJdGgjqyJQaeSHyR9aqNCLVjOILZ2VJRfVoBcGq8JHa77gCL VfaEeHnAiUNJhtBzYqZf6VwJfIyjGVoXloBI4Pw9HBfp7jfjb7IeT/vxGzDp/4rSrzmX HGUvT31OY6Zgc2yrE3/aX5+nzi/XR0T+vSUvBc5uKNXkFU4WuzrLdWB04E0fpbjEMtJ4 nb3w== 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; bh=LqrKt9XarmhZx//DDl4l8K9H3IidIm4sdVCIKUE5tfc=; b=ZlnFI7nJ75i1WZNH2kDwUtm6HcVCGndsuU9PtZkFOSWL4KtXrlVeN0gj3CoWIRNTPe hHyeaRojT/9nEFFDPGFPBQer1rNmKZ9asoxcEmW2dACOE6em7ywnmggcP4rn3MEZyu5H kVh+18djJf4vNOBiaSjXAg67j3XU/dW4YMh21T9KRWjR4MNCMhtsoktMaOTpdaawhlsr Wrs+95pDYdHtZJQg/xLjfO/ju71bh77NuS/PYx/z9KFzVu4ZfvIzL2q69c37hMc3j6gD cNlzfIECxRBzcXa1oBh7yvlnYzMljbcooqye54TYS9tvlu31QcVt5YBFztJ+TMDkFt+D xicQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 192si11002372pgc.200.2019.04.25.15.21.09; Thu, 25 Apr 2019 15:21:26 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728528AbfDYU7t (ORCPT + 99 others); Thu, 25 Apr 2019 16:59:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56478 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbfDYU7t (ORCPT ); Thu, 25 Apr 2019 16:59:49 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D720631649AE for ; Thu, 25 Apr 2019 20:59:48 +0000 (UTC) Received: from x230.aquini.net (ovpn-126-47.rdu2.redhat.com [10.10.126.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D403171C5; Thu, 25 Apr 2019 20:59:48 +0000 (UTC) Date: Thu, 25 Apr 2019 16:59:45 -0400 From: Rafael Aquini To: Joel Savitz Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/oom_killer: Add task UID to info message on an oom kill Message-ID: <20190425205945.GA4546@x230.aquini.net> References: <1556130013-19021-1-git-send-email-jsavitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1556130013-19021-1-git-send-email-jsavitz@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 25 Apr 2019 20:59:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 24, 2019 at 02:20:13PM -0400, Joel Savitz wrote: > In the event of an oom kill, useful information about the killed > process is printed to dmesg. Users, especially system administrators, > will find it useful to immediately see the UID of the process. > > In the following example, abuse_the_ram is the name of a program > that attempts to iteratively allocate all available memory until it is > stopped by force. > > Current message: > > Out of memory: Killed process 35389 (abuse_the_ram) > total-vm:133718232kB, anon-rss:129624980kB, file-rss:0kB, > shmem-rss:0kB > > Patched message: > > Out of memory: Killed process 2739 (abuse_the_ram), UID 0, > total-vm:133880028kB, anon-rss:129754836kB, file-rss:0kB, > shmem-rss:0kB > > Signed-off-by: Joel Savitz > --- > mm/oom_kill.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 3a2484884cfd..22972648b758 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -874,9 +874,9 @@ static void __oom_kill_process(struct task_struct *victim, const char *message) > */ > do_send_sig_info(SIGKILL, SEND_SIG_PRIV, victim, PIDTYPE_TGID); > mark_oom_victim(victim); > - pr_err("%s: Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", > + pr_err("%s: Killed process %d (%s), UID %d, total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", > message, task_pid_nr(victim), victim->comm, > - K(victim->mm->total_vm), > + task_uid(victim).val, K(victim->mm->total_vm), > K(get_mm_counter(victim->mm, MM_ANONPAGES)), > K(get_mm_counter(victim->mm, MM_FILEPAGES)), > K(get_mm_counter(victim->mm, MM_SHMEMPAGES))); > -- > 2.18.1 > Acked-by: Rafael Aquini