Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1098799ybl; Wed, 11 Dec 2019 12:29:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzfBkhASuD2Fizf/xV2QoVs5C4hVuQtH31WwvOaXG8UvdQg8X1SwJ5jpBJcj3Va/cr7j29J X-Received: by 2002:a9d:4c08:: with SMTP id l8mr3794334otf.360.1576096197913; Wed, 11 Dec 2019 12:29:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576096197; cv=none; d=google.com; s=arc-20160816; b=steBXgqMFyzvtnFZxakRVTZY66ln/b+DOEOnQi5BhB8xQX6NEtnETKfu5pcspyGzNs GYSkCAjU1a90RoZTfZ3S76f8tUfyz0ZbXyzuPp/oiqlCnSFUSv4MwpQZvAabfXiPUbQW 8380yUGQpk2XFYiZ/kzEVJ3nnXZ2AsAJhxpYt6JKnoGX+QWuf+ZVZR8G+EkdrR64ya6/ unHC0J77ghY3wbmU38DVq9b4lP8W4PnuKY4rOVy5n0R6exqCP2Pc4HU9dWyUxk2qTzso rk24WC0J+4ftxO5NnzLfmni5KaJrgJL6NQs9wMre5+FEDjaOiBm3nWD+vvtObbrBjQYr AC4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=naWMx9N0uWainyxJFoMeYjPsvH+QX5wLBu2xsPR3Oj8=; b=o0IkIqaGCiSE3yJUEgltms9JQgQ6kjHwYytPUKEV8i9xc0Lkan09WcCQlBDOYZ94xM HrBNYssQuJ4fj32LpzFMQePMr+kkU9WjPKrpBk2FeV4xkG5MH03zsChA0hpzCgQcOuqS lYxCrA/b3IV2JpZUGwhJjQe5ksPbFaVtCMPzLnk2bByDNnG+zX1N76QJcnvGE186VSQH WN4DtdgDpd1CfptB1qUg+KD+PJ1YSaI5rAMY1BtLU9wfa5pcqA9Lr18KdOJ7hDcp4df3 vGD28TUBfoUirvw0GDmyk60i5B6/V7L63B664Cm1bJF3Yu8EfJzlSKAJSRT/tdQYLuh3 oUDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FqUDzVMv; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si1917912otq.21.2019.12.11.12.29.43; Wed, 11 Dec 2019 12:29:57 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FqUDzVMv; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbfLKU2w (ORCPT + 99 others); Wed, 11 Dec 2019 15:28:52 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36105 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfLKU2w (ORCPT ); Wed, 11 Dec 2019 15:28:52 -0500 Received: by mail-wr1-f67.google.com with SMTP id z3so123467wru.3 for ; Wed, 11 Dec 2019 12:28:50 -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=JLrfgNGXoM11barPju0AGPwU51VB7HJcn2luLW2xMn07rpqsIqcExnzKdE/mpeqK30 XrHdvAUCrf3lrhSKBFZCUzu8TlFG13eTnkYiC2koj8SdvQZi1LR/jlzUwHnjHMza+aM8 DpV8taQ0Rd0KhiW4Mqmu+WIDx8aeVlleNUSadi7rRaORZjrlBVzvYg9U/SjOeAmb/9bH pYRdcwRMl+gt18dzNjNwaeUKEySpvViBAZJDoE2Zul52ChO6EDdp5wAguRmVYyX69dOJ RKdM6F5SgPQGFEMz626bd5FRVG+INhcX55n8B+LIym+HidvA7MT4kEuw8UikDZ3ckex8 XTHA== X-Gm-Message-State: APjAAAUBMT4AFIo3vhV4J7knHoqSIsgtvwF3YCn0175VNJkRR43Qu0I4 +64BCagepj5t076TC6CVksE= 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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