From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2196FC4741F 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 68EE8206CB 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 68EE8206CB 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) Received: by kanga.kvack.org (Postfix, from userid 40) id 6225D6B0062; Fri, 30 Oct 2020 14:27:18 -0400 (EDT) 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-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-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-Type: text/plain; charset=us-ascii 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 --- 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) -- 2.29.0