Message ID | 20230713114915.74671-1-linmiaohe@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1778780vqm; Thu, 13 Jul 2023 05:14:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEFl2XbYxDa55vqyeb1T9FNs67erVqpq+Xcp4Dnk9WLAILHjKmXy0mC9Sal3uuKnRfxVJci X-Received: by 2002:a17:90a:ba11:b0:263:e39d:a7e2 with SMTP id s17-20020a17090aba1100b00263e39da7e2mr651066pjr.4.1689250451108; Thu, 13 Jul 2023 05:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689250451; cv=none; d=google.com; s=arc-20160816; b=qwN0c/ZUhgKRgm0JpwkcBKsgC+IdrfKLRMsH+jBl21JqF2qRjGwcLtaOhqc8WWwKTW frREsJHuTqIKEzq7HXik4LUCBHhz6OqTpQd1N5ShdFt9J2sB9zuGqHuCWMML9T/KVZty /hKPgKkATFOHUoe23Ey2KxVMsIATZoYJ/UOb4nqRFUNpnv83j9AQ+EQO7xGucMM78hAy irNZOeNLJUEnaehqTn+nfDGRYdYC1GBzhiXYRSf6k0ld3hpBeq8GPqloZ+Uajo9mXATW ljyM9AlWzu/b7oYmKVSM3Rcwjl1zv2jDFfPyDnJRD5u7bGn3rIuL7kqKtecGfQGLuTCS VU8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9Ne52rYN1F61tk2BZ2erfnItaH/LcTgVMimtcBwdB8M=; fh=Mo/Lcs6WtjcRq1QaiJBjtYwS/87p5PpqCapK5ULE+Ko=; b=0j7mI0xMoGBvfm790VBjsoIuyNgRTwtANuBBFbr5JMQ+nCKXAtQZ5B8FHxStVVLRfc obTQk4qe3Q8aOR6HpKvANwsiTTm+lXNO76Pw2bU7SNuG7WXlBnp26vnIa+oNfHXmG1f6 KuMJ4pZqNmb+e5nDNPoZ5pd0+HQrDHqqvNhzOJRAVmg2jby0uui//RgIUB5DMgk02bx+ O1q2ESX8K0W/eZnbKSCbZl5nGhYLcujtrhw9qs6dhD44PDWBVZLCsX/bkN1PyW5sLcxu VwfBd6dWUrb1YSqzVJ0wMSxWvdusVZCY/K+lBp4Pa59pgZIlL/IYIw+ADQ2d/MvzW0Le E9XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p16-20020a17090a931000b00263c7cadb73si1068750pjo.152.2023.07.13.05.13.58; Thu, 13 Jul 2023 05:14:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234242AbjGMLtH (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Thu, 13 Jul 2023 07:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234126AbjGMLtG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Jul 2023 07:49:06 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A825FB4 for <linux-kernel@vger.kernel.org>; Thu, 13 Jul 2023 04:49:05 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R1t8p1rwKzNm7s; Thu, 13 Jul 2023 19:45:46 +0800 (CST) Received: from huawei.com (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 13 Jul 2023 19:49:03 +0800 From: Miaohe Lin <linmiaohe@huawei.com> To: <akpm@linux-foundation.org> CC: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <linmiaohe@huawei.com> Subject: [PATCH] mm: remove some useless comments of node_stat_item Date: Thu, 13 Jul 2023 19:49:15 +0800 Message-ID: <20230713114915.74671-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771307480952819223 X-GMAIL-MSGID: 1771307480952819223 |
Series |
mm: remove some useless comments of node_stat_item
|
|
Commit Message
Miaohe Lin
July 13, 2023, 11:49 a.m. UTC
Some comments of node_stat_item are not that helpful and even confusing,
so remove them. No functional change intended.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
include/linux/mmzone.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Thu, Jul 13, 2023 at 07:49:15PM +0800, Miaohe Lin wrote: > Some comments of node_stat_item are not that helpful and even confusing, > so remove them. No functional change intended. No, that's very useful and important. Why does it confuse you? > enum node_stat_item { > NR_LRU_BASE, > NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */ > - NR_ACTIVE_ANON, /* " " " " " */ > - NR_INACTIVE_FILE, /* " " " " " */ > - NR_ACTIVE_FILE, /* " " " " " */ > - NR_UNEVICTABLE, /* " " " " " */ > + NR_ACTIVE_ANON, > + NR_INACTIVE_FILE, > + NR_ACTIVE_FILE, > + NR_UNEVICTABLE, > NR_SLAB_RECLAIMABLE_B, > NR_SLAB_UNRECLAIMABLE_B, > NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ > -- > 2.33.0 > >
On 2023/7/13 20:10, Matthew Wilcox wrote: > On Thu, Jul 13, 2023 at 07:49:15PM +0800, Miaohe Lin wrote: >> Some comments of node_stat_item are not that helpful and even confusing, >> so remove them. No functional change intended. > > No, that's very useful and important. Why does it confuse you? Thanks for your quick respond. I just can't figure out what these comments want to tell. Could you help explain these? Thanks.
On Thu, Jul 13, 2023 at 08:18:29PM +0800, Miaohe Lin wrote: > On 2023/7/13 20:10, Matthew Wilcox wrote: > > On Thu, Jul 13, 2023 at 07:49:15PM +0800, Miaohe Lin wrote: > >> Some comments of node_stat_item are not that helpful and even confusing, > >> so remove them. No functional change intended. > > > > No, that's very useful and important. Why does it confuse you? > > Thanks for your quick respond. > > I just can't figure out what these comments want to tell. Could you help explain these? Don't snip the thing you want explained to you! NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */ - NR_ACTIVE_ANON, /* " " " " " */ - NR_INACTIVE_FILE, /* " " " " " */ - NR_ACTIVE_FILE, /* " " " " " */ - NR_UNEVICTABLE, /* " " " " " */ + NR_ACTIVE_ANON, + NR_INACTIVE_FILE, + NR_ACTIVE_FILE, + NR_UNEVICTABLE, What this is communicating to me is that these five items (NR_INACTIVE_ANON to NR_UNEVICTABLE) must stay in the same order with LRU_INACTIVE and LRU_ACTIVE. By removing the ditto-marks from the subsequent four lines, you've made the comment say that this one line must stay in the same order as LRU_INACTIVE and LRU_ACTIVE ... which makes no sense at all.
On 2023/7/13 20:31, Matthew Wilcox wrote: > On Thu, Jul 13, 2023 at 08:18:29PM +0800, Miaohe Lin wrote: >> On 2023/7/13 20:10, Matthew Wilcox wrote: >>> On Thu, Jul 13, 2023 at 07:49:15PM +0800, Miaohe Lin wrote: >>>> Some comments of node_stat_item are not that helpful and even confusing, >>>> so remove them. No functional change intended. >>> >>> No, that's very useful and important. Why does it confuse you? >> >> Thanks for your quick respond. >> >> I just can't figure out what these comments want to tell. Could you help explain these? > > Don't snip the thing you want explained to you! > > NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */ > - NR_ACTIVE_ANON, /* " " " " " */ > - NR_INACTIVE_FILE, /* " " " " " */ > - NR_ACTIVE_FILE, /* " " " " " */ > - NR_UNEVICTABLE, /* " " " " " */ > + NR_ACTIVE_ANON, > + NR_INACTIVE_FILE, > + NR_ACTIVE_FILE, > + NR_UNEVICTABLE, > > What this is communicating to me is that these five items > (NR_INACTIVE_ANON to NR_UNEVICTABLE) must stay in the same order with > LRU_INACTIVE and LRU_ACTIVE. By removing the ditto-marks from the > subsequent four lines, you've made the comment say that this one line > must stay in the same order as LRU_INACTIVE and LRU_ACTIVE ... which > makes no sense at all. I see. Many thanks for your kind explanation. :)
On 7/13/23 18:01, Matthew Wilcox wrote: > On Thu, Jul 13, 2023 at 08:18:29PM +0800, Miaohe Lin wrote: >> On 2023/7/13 20:10, Matthew Wilcox wrote: >>> On Thu, Jul 13, 2023 at 07:49:15PM +0800, Miaohe Lin wrote: >>>> Some comments of node_stat_item are not that helpful and even confusing, >>>> so remove them. No functional change intended. >>> >>> No, that's very useful and important. Why does it confuse you? >> >> Thanks for your quick respond. >> >> I just can't figure out what these comments want to tell. Could you help explain these? > > Don't snip the thing you want explained to you! > > NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */ > - NR_ACTIVE_ANON, /* " " " " " */ > - NR_INACTIVE_FILE, /* " " " " " */ > - NR_ACTIVE_FILE, /* " " " " " */ > - NR_UNEVICTABLE, /* " " " " " */ > + NR_ACTIVE_ANON, > + NR_INACTIVE_FILE, > + NR_ACTIVE_FILE, > + NR_UNEVICTABLE, > > What this is communicating to me is that these five items > (NR_INACTIVE_ANON to NR_UNEVICTABLE) must stay in the same order with > LRU_INACTIVE and LRU_ACTIVE. By removing the ditto-marks from the > subsequent four lines, you've made the comment say that this one line > must stay in the same order as LRU_INACTIVE and LRU_ACTIVE ... which > makes no sense at all. Just wondering - would it be better to repeat these comments in words for each line than use "ditto-marks" ?
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 4106fbc5b4b3..844ed29cc260 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -154,10 +154,10 @@ enum zone_stat_item { enum node_stat_item { NR_LRU_BASE, NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */ - NR_ACTIVE_ANON, /* " " " " " */ - NR_INACTIVE_FILE, /* " " " " " */ - NR_ACTIVE_FILE, /* " " " " " */ - NR_UNEVICTABLE, /* " " " " " */ + NR_ACTIVE_ANON, + NR_INACTIVE_FILE, + NR_ACTIVE_FILE, + NR_UNEVICTABLE, NR_SLAB_RECLAIMABLE_B, NR_SLAB_UNRECLAIMABLE_B, NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */