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=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 67B19C2D0A3 for ; Thu, 29 Oct 2020 07:51:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CCC0A2076B for ; Thu, 29 Oct 2020 07:51:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="R5OvWMfh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCC0A2076B 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 091A66B0068; Thu, 29 Oct 2020 03:51:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0176B6B006C; Thu, 29 Oct 2020 03:51:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E21A46B006E; Thu, 29 Oct 2020 03:51:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id AEA206B0068 for ; Thu, 29 Oct 2020 03:51:17 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4DD04180AD817 for ; Thu, 29 Oct 2020 07:51:17 +0000 (UTC) X-FDA: 77424192594.29.drink79_1c0dec02728b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id E0FA3180868D3 for ; Thu, 29 Oct 2020 07:51:16 +0000 (UTC) X-HE-Tag: drink79_1c0dec02728b X-Filterd-Recvd-Size: 3052 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Thu, 29 Oct 2020 07:51:16 +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=1603957875; 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=BgtRc1tJzjcBk9DP7mLA/DnbL1eDZa5Y6LB/m/lUTuM=; b=R5OvWMfhoqRFhkFNUGx6yE44xwRsHuZDHMlTe6vER++0EGasTAr0YqUe5YQzCGo9R5R25y hvPp7gNUeHG6ow/n4Q9uBAo3tli+g1uaHLPCOoHNj158xwnG5WAN/7xB2OwQU3znt8LVYC r6C75PgN75sh4/fMhmKmbqcTD/sfoIU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 36466B012; Thu, 29 Oct 2020 07:51:15 +0000 (UTC) Date: Thu, 29 Oct 2020 08:51:14 +0100 From: Michal Hocko To: Andrew Morton Cc: Hui Su , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm/oom_kill: remove comment and rename is_dump_unreclaim_slabs() Message-ID: <20201029075114.GA17500@dhcp22.suse.cz> References: <20201027144529.GA3558@rlk> <20201027145814.GY20500@dhcp22.suse.cz> <20201027151156.GA4336@rlk> <20201027192322.GA20500@dhcp22.suse.cz> <20201028153141.GB77196@rlk> <20201028145330.1cf7a32bb109ccb50d2b0dbb@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028145330.1cf7a32bb109ccb50d2b0dbb@linux-foundation.org> 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 Wed 28-10-20 14:53:30, Andrew Morton wrote: > On Wed, 28 Oct 2020 23:31:41 +0800 Hui Su wrote: > > > 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. > > > > I think your recent attempt to improve the comment: > > /* > * Check whether unreclaimable slabs amount is greater than all user > * memory(LRU pages). > */ > > was actually somewhat useful, and worth retaining. > > It would be better if it explained *why* we're doing this, rather than > simply "what we are doing"? > > > > It's actually quite unobvious why we're doing this! It's quite arbitrary criterion to print slab information in the oom report. The current logic is to dump if there is more slabs than LRU pages which should be pretty obvious from the code. Why this rather than e.g. slab * k > lru? Well, no strong reason, AFAIK. We just want to catch too much slab memory cases. -- Michal Hocko SUSE Labs