Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp652364ybl; Thu, 12 Dec 2019 02:43:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzNnXA8Z53z+ei5QrFx/Z3zWgqpX4tLaXfl+M+uf3CixkxRebgqSNl0EfwxKUgXUk/qlDZP X-Received: by 2002:a9d:7999:: with SMTP id h25mr7343989otm.347.1576147383028; Thu, 12 Dec 2019 02:43:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576147383; cv=none; d=google.com; s=arc-20160816; b=w9DISUSrg22OPvsg8XNLqFzkWAHXNYSXSXNe/kX2WJDJ48lI+DA9Aj70g8HFIS66YD OGHTsujwc2qMbdv4jqLS5xYFFdO9VItYtzTDhUL9RwuiSFyFrPso2PbiHpVDofOfSkxk 8lhKvP08TkK7eV66x89dYUO4aafzJpvFqylUcry2zJYkw3UubOrGb9GQx5dNdM8J+xNJ QkVcz1B+TKGtNZXpgtlmn+6b1FISsHD2GjM0xRJQSUkHXsBmQ+bsCBqrFeHIYtlGK93V hCsttfXHreq0EVQzBY+YWs1OTh7OvgMwUX1v6su25rtbOOg4g8Bou5m3i09SS/5naBvu tTlg== 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=S1F+4TtH6sI5cY7070NYFBNoEudVsb5hE0A8Xjrz5eo=; b=fECmuyrqk1bgkYtkZrWGaHytI3918fYe7T7IgE6+GuqpsMAw88pvyKqXzCVD/sXazX N2sZASGL01e7mfy9ptZohCu4SjSzGp/jT3uflcdgF0+PIRvdbsq7ig5T+1QCyprM/Pon WEguU4fPLKYaqfo+gCwoUAynJ+9afsoPA3OOiSUkPzKJBSW93HtkoRuWyVfW5Pdz89T5 r4Ttdk1Twp80BNRIOb2Skx0GgjiF5oqKUcYLTSu4pDJD8tl4qg8WEhXB4/ea0mxurJRt TV2P1/ZVoSfOGEGvS0E/MkpHSWlNdBe64+pdLpYFUxS295NYyYIeKpcIoN4ST3DYZG2W z3cg== 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 q9si2631599oij.125.2019.12.12.02.42.51; Thu, 12 Dec 2019 02:43:03 -0800 (PST) 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 S1728691AbfLLKlK (ORCPT + 99 others); Thu, 12 Dec 2019 05:41:10 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44964 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728410AbfLLKlK (ORCPT ); Thu, 12 Dec 2019 05:41:10 -0500 Received: by mail-wr1-f67.google.com with SMTP id q10so2136303wrm.11 for ; Thu, 12 Dec 2019 02:41:08 -0800 (PST) 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=S1F+4TtH6sI5cY7070NYFBNoEudVsb5hE0A8Xjrz5eo=; b=IoFTsowcKg00Iz0WKrEvjoKZLOSi2ZqpF99/sCBHGd5DKtMjKOw1Tp9WmMpWY4Uyc1 pjpjQALGqvEyTdP0ShRSigI1zjN3alf3G63cxsFJEcwiSyfAm4u1/1E4njifOoCWMrGo wBlElywR6HBU9TEbPJ/dRt4zpBx93FgyGMcJFrjW7wl8vHA4RBhVyOpFwBacbmTJKFMJ ZNTo2HDaNhTw4Cy3bn41+QpAfoa6bt8X7vDT60PdzeFSODSt1fcxjMYbDFBdyf9JB38t hgudH22TocRCL2sFW4BT4j7GynyeIqkEKivOJTnz+weeYqkeZ5h8kD8/iGTnvnadcGfc E/Jw== X-Gm-Message-State: APjAAAX+mdqrAeRNZpDXCyNzRk4JQ9X2fxNHoUB4lTkJmTIslZMz42zB /YGUqfNRp8W/+bsqkrdl4Ms= X-Received: by 2002:a5d:67c7:: with SMTP id n7mr5367757wrw.319.1576147267915; Thu, 12 Dec 2019 02:41:07 -0800 (PST) Received: from localhost (ip-37-188-179-200.eurotel.cz. [37.188.179.200]) by smtp.gmail.com with ESMTPSA id w20sm5587444wmk.34.2019.12.12.02.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 02:41:06 -0800 (PST) Date: Thu, 12 Dec 2019 11:41:05 +0100 From: Michal Hocko To: Ilya Dryomov Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Edward Chron , David Rientjes , Andrew Morton , Linus Torvalds Subject: Re: [PATCH] mm/oom: fix pgtables units mismatch in Killed process message Message-ID: <20191212104105.GB12165@dhcp22.suse.cz> References: <20191211202830.1600-1-idryomov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191211202830.1600-1-idryomov@gmail.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 11-12-19 21:28:30, Ilya Dryomov wrote: > pr_err() expects kB, but mm_pgtables_bytes() returns the number of > bytes. As everything else is printed in kB, I chose to fix the value > rather than the string. > > Before: > > [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name > ... > [ 1878] 1000 1878 217253 151144 1269760 0 0 python > ... > Out of memory: Killed process 1878 (python) total-vm:869012kB, anon-rss:604572kB, file-rss:4kB, shmem-rss:0kB, UID:1000 pgtables:1269760kB oom_score_adj:0 > > After: > > [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name > ... > [ 1436] 1000 1436 217253 151890 1294336 0 0 python > ... > Out of memory: Killed process 1436 (python) total-vm:869012kB, anon-rss:607516kB, file-rss:44kB, shmem-rss:0kB, UID:1000 pgtables:1264kB oom_score_adj:0 > > Fixes: 70cb6d267790 ("mm/oom: add oom_score_adj and pgtables to Killed process message") > Signed-off-by: Ilya Dryomov Ups, I have missed that when reviewing 70cb6d267790. Acked-by: Michal Hocko Thanks! > --- > mm/oom_kill.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 71e3acea7817..d58c481b3df8 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -890,7 +890,7 @@ static void __oom_kill_process(struct task_struct *victim, const char *message) > K(get_mm_counter(mm, MM_FILEPAGES)), > K(get_mm_counter(mm, MM_SHMEMPAGES)), > from_kuid(&init_user_ns, task_uid(victim)), > - mm_pgtables_bytes(mm), victim->signal->oom_score_adj); > + mm_pgtables_bytes(mm) >> 10, victim->signal->oom_score_adj); > task_unlock(victim); > > /* > -- > 2.19.2 > -- Michal Hocko SUSE Labs