From patchwork Fri Oct 30 18:27:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Su X-Patchwork-Id: 11870527 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 2F37A92C for ; Fri, 30 Oct 2020 18:27:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6BCE820702 for ; Fri, 30 Oct 2020 18:27:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="lFTsSwHo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BCE820702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 671866B005C; Fri, 30 Oct 2020 14:27:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6225D6B0062; Fri, 30 Oct 2020 14:27:18 -0400 (EDT) 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 4C48A6B006C; Fri, 30 Oct 2020 14:27:18 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 2062B6B005C for ; Fri, 30 Oct 2020 14:27:18 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B43E0180AD804 for ; Fri, 30 Oct 2020 18:27:17 +0000 (UTC) X-FDA: 77429424114.20.drum52_44163e827298 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id B3AA5180C0609 for ; Fri, 30 Oct 2020 18:27:15 +0000 (UTC) X-Spam-Summary: 1,0,0,7d140083fcfe5d1f,d41d8cd98f00b204,sh_def@163.com,,RULES_HIT:41:355:379:582:800:960:973:988:989:1152:1260:1277:1312:1313:1314:1345:1359:1381:1437:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:6261:6653:7903:10004:10400:10450:10455:11026:11334:11473:11658:11914:12043:12114:12296:12297:12438:12555:12895:12986:13069:13311:13357:13439:13869:13895:14096:14097:14181:14394:14721:19904:19999:21080:21627:21795:21886:21990:30005:30051:30054:30070:30075,0,RBL:220.181.12.13:@163.com:.lbl8.mailshell.net-62.50.2.100 66.100.201.100;04y8e5uhb6gacfxaod49rchdejrd1ocqc59tyrdwdbse55q9okgypeys3811b6d.r148gdof9otd9cznetun91t57beoha6i66en3g8bzrytjwxyew3i6n9us71wpgz.q-lbl8.mailshell.net-223.238.255.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:112,LUA_SUMMARY:none X-HE-Tag: drum52_44163e827298 X-Filterd-Recvd-Size: 3138 Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 18:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=r3Pis AmoB8zoaScdLcnMR1LEUmjIXEEB4sONesOEdjQ=; b=lFTsSwHoYDkpwaUQk1ulL /3hlEgXX0Ezg4R206hr3tq5O0LrGy1qWGYVL9M4rTR4k7tBpxNx+tahaL2zVNh73 /fKnMB7mZsqqztImnptKN2yl3IMrdEmGy3sH35juY8DswSiwm67zko1F37yKhmPb pzZSMQQAjFYz8pGs47u6DM= Received: from localhost (unknown [101.86.209.82]) by smtp9 (Coremail) with SMTP id DcCowACnCGj4Wpxfg5sdOA--.7945S2; Sat, 31 Oct 2020 02:27:05 +0800 (CST) Date: Sat, 31 Oct 2020 02:27:04 +0800 From: Hui Su To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v4] mm/oom_kill: change comment and rename is_dump_unreclaim_slabs() Message-ID: <20201030182704.GA53949@rlk> References: <20201027144529.GA3558@rlk> <20201027145814.GY20500@dhcp22.suse.cz> <20201027151156.GA4336@rlk> <20201027192322.GA20500@dhcp22.suse.cz> <20201028153141.GB77196@rlk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201028153141.GB77196@rlk> X-CM-TRANSID: DcCowACnCGj4Wpxfg5sdOA--.7945S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Ary7AF4fAFykZr15Zry7Jrb_yoW8GFW3p3 Z3ta4Utw4rtFZIqFZ3CF4q9F1Fv3y8KF9xGry3Kw1UCw15Jw1Duay8CryjkrnxXFyxGFsx XrWakr1kZF1UZ3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jPnYwUUUUU= X-Originating-IP: [101.86.209.82] X-CM-SenderInfo: xvkbvvri6rljoofrz/1tbifxnNX1r6mZj43AAAsx X-Bogosity: Ham, tests=bogofilter, spamicity=0.073208, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Change the comment of is_dump_unreclaim_slabs(), it just check whether nr_unreclaimable slabs amount is greater than user memory, and explain why we dump unreclaim slabs. Rename it to should_dump_unreclaim_slab() maybe better. Signed-off-by: Hui Su Acked-by: Michal Hocko --- mm/oom_kill.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 8b84661a6410..04b19b7b5435 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -170,11 +170,13 @@ static bool oom_unkillable_task(struct task_struct *p) return false; } -/* - * Print out unreclaimble slabs info when unreclaimable slabs amount is greater - * than all user memory (LRU pages) - */ -static bool is_dump_unreclaim_slabs(void) +/** + * Check whether unreclaimable slab amount is greater than + * all user memory(LRU pages). + * dump_unreclaimable_slab() could help in the case that + * oom due to too much unreclaimable slab used by kernel. +*/ +static bool should_dump_unreclaim_slab(void) { unsigned long nr_lru; @@ -463,7 +465,7 @@ static void dump_header(struct oom_control *oc, struct task_struct *p) mem_cgroup_print_oom_meminfo(oc->memcg); else { show_mem(SHOW_MEM_FILTER_NODES, oc->nodemask); - if (is_dump_unreclaim_slabs()) + if (should_dump_unreclaim_slab()) dump_unreclaimable_slab(); } if (sysctl_oom_dump_tasks)