From patchwork Wed Dec 11 20:28:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 11286249 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8A7B112B for ; Wed, 11 Dec 2019 20:28:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A5EA32077B for ; Wed, 11 Dec 2019 20:28:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FqUDzVMv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5EA32077B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D4DA26B33CD; Wed, 11 Dec 2019 15:28:52 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CFEE46B33CE; Wed, 11 Dec 2019 15:28:52 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BED246B33CF; Wed, 11 Dec 2019 15:28:52 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id A9CF26B33CD for ; Wed, 11 Dec 2019 15:28:52 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 66FF52C89 for ; Wed, 11 Dec 2019 20:28:52 +0000 (UTC) X-FDA: 76253999304.08.wax95_1335ec5a2b122 X-Spam-Summary: 2,0,0,9bfaef7071eb5409,d41d8cd98f00b204,idryomov@gmail.com,::linux-kernel@vger.kernel.org:echron@arista.com:mhocko@suse.com:rientjes@google.com:akpm@linux-foundation.org:torvalds@linux-foundation.org,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2689:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:4321:4605:5007:6119:6261:6653:7514:7903:9036:9121:9413:10004:11026:11658:11914:12043:12296:12297:12517:12519:12555:12679:12895:12986:13069:13095:13311:13357:13870:13894:14096:14181:14384:14394:14687:14721:21080:21212:21433:21444:21451:21627:21666:21990:30029:30034:30054,0,RBL:209.85.221.68:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: wax95_1335ec5a2b122 X-Filterd-Recvd-Size: 4498 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Dec 2019 20:28:51 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id w15so116841wru.4 for ; Wed, 11 Dec 2019 12:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=naWMx9N0uWainyxJFoMeYjPsvH+QX5wLBu2xsPR3Oj8=; b=FqUDzVMvTHUsGNZOVZVnsyxn/WOFcpMcj3M5pwBSH4+aQ7ABk2HwNI3ogvU6INPNnL CvSTOm6b6IHdsxalKesh9e1aelv8cXLhecfAg7g5Riwh6xs6WSSv1o6iAWXseMHDwOHK Yjy+jrKWGo/zbo7FqHC3+qOAfgHT4/xZAo+BoX2IbqEd6E/2sh61SBlK0cXL5MBsZnRu pTSnur4SRuKdIayya15rUXKmtNzHE50TGK6mUdFytdBqxkoS+xe0N6Uj3RE+Skwa+q51 PCuidQGsLH9otreTg2UmheLX2k20vUx1PGp5dJxfzQUU/01kU1+L/z+YUsIjsiJRn8sM 0rGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=naWMx9N0uWainyxJFoMeYjPsvH+QX5wLBu2xsPR3Oj8=; b=hbERsZvMHg+/jYtTOnloJdckzdY4eyZ5wSt0BmPMdVfxZaCcG3xEMZ+8JifsdEFIBr IIyM2/TwtY6CRQ6NeyP0uXZlpJbFxmx4ZN4n9BoWCw+WtsNpQCf8t4xe6uf4nlNYq6w4 BTmQkFth5YHK8HLLS5kGnFfEwEydBWNhjVFy2XKJIpBOxY4GfrIRDpQdw0KsyWQ8U/2W mkxA7XsLALenNiuEC4+sEtaMVWhXXdLqm1iYlQH/7HFh4ZnumBV4Mo0tMkhRAFODYbeh N87+d7kYUHx36tGRkEQzH73jLU+xDx1OJmPHoXuO1Z5xtK0PJrit4a90pTWWuSjYY4iW D0bA== X-Gm-Message-State: APjAAAWmajLhSlwTY3mfvJK3Qmvr3vX7gL02L3UlC9Cq/CWG8mpS9dl9 KLUSL0Iy4yNbq6Q2+Gp45zcK6q3nyok= X-Google-Smtp-Source: APXvYqwvLAJ3BVDmU9pXGr4hJ10Q800cW203xBsv+TNZ4pRMpMwlZajjkG7AFDb5rkcicWdjyDnGLg== X-Received: by 2002:adf:d0c1:: with SMTP id z1mr1832688wrh.371.1576096130389; Wed, 11 Dec 2019 12:28:50 -0800 (PST) Received: from kwango.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id x1sm3441768wru.50.2019.12.11.12.28.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 12:28:49 -0800 (PST) From: Ilya Dryomov To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Edward Chron , Michal Hocko , David Rientjes , Andrew Morton , Linus Torvalds Subject: [PATCH] mm/oom: fix pgtables units mismatch in Killed process message Date: Wed, 11 Dec 2019 21:28:30 +0100 Message-Id: <20191211202830.1600-1-idryomov@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Acked-by: David Rientjes Acked-by: Michal Hocko --- 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); /*