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.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 7371BC55178 for ; Tue, 27 Oct 2020 14:58:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C384D20780 for ; Tue, 27 Oct 2020 14:58:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="YmmqkqV0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C384D20780 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 212536B0068; Tue, 27 Oct 2020 10:58:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C22A6B006C; Tue, 27 Oct 2020 10:58:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08A0A6B0072; Tue, 27 Oct 2020 10:58:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id CDF646B0068 for ; Tue, 27 Oct 2020 10:58:19 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6B8A63489 for ; Tue, 27 Oct 2020 14:58:19 +0000 (UTC) X-FDA: 77418011118.03.trade24_21052812727d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 7904E28A241 for ; Tue, 27 Oct 2020 14:58:17 +0000 (UTC) X-HE-Tag: trade24_21052812727d X-Filterd-Recvd-Size: 3509 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2020 14:58:17 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1603810695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QHfC50u4+qYFKShn9vmVFysfcHnRXhgSobOLpg9p0W8=; b=YmmqkqV0zXjnwZ/n/we8egpCPIWoJQ40xIiaz72oAbg1N9ZYj1HNm3osroivK/OGnF/b5Z uClP6ikE0YuEZg/hQbgUXTPOFyDo/qVedZdPyp+gs59yeRufDMFViY3kby3riztNmgorP9 IOhcFQ9z5x8D27pj9l+4X7eFpdFAGnE= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C1CFFAE7B; Tue, 27 Oct 2020 14:58:15 +0000 (UTC) Date: Tue, 27 Oct 2020 15:58:14 +0100 From: Michal Hocko To: Hui Su Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/oom_kill.c: remove the unmatched comments Message-ID: <20201027145814.GY20500@dhcp22.suse.cz> References: <20201027144529.GA3558@rlk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201027144529.GA3558@rlk> 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: On Tue 27-10-20 22:45:29, Hui Su wrote: > is_dump_unreclaim_slabs() just check whether nr_unreclaimable > slabs amount is greater than user memory, not match witch comment. As I've tried to explain, the comment is not explaining what the function does but how it should be used. It is not a kerneldoc afterall. So it is a good match. I can see how that might confuse somebody so I am not against changing this but the changelog shouldn't really be confusing on its own. What do you think about the following instead. " Comment for is_dump_unreclaim_slabs is not really clear whether it is meant to instruct how to use the function or whether it is an outdated information of the past implementation of the function. it doesn't realy help that is_dump_unreclaim_slabs is hard to grasp on its own. Rename the helper to should_dump_unreclaim_slabs which should make it clear what it is meant to do and drop the comment as the purpose should be pretty evident now. " > So delete the comment, and rename it to should_dump_unreclaim_slabs(). > > Signed-off-by: Hui Su > --- > mm/oom_kill.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 8b84661a6410..d181e24d7193 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -170,11 +170,7 @@ 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) > +static bool should_dump_unreclaim_slabs(void) > { > unsigned long nr_lru; > > @@ -463,7 +459,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_slabs()) > dump_unreclaimable_slab(); > } > if (sysctl_oom_dump_tasks) > -- > 2.25.1 > -- Michal Hocko SUSE Labs