* [PATCH] mm: remove some useless comments of node_stat_item
@ 2023-07-13 11:49 Miaohe Lin
2023-07-13 12:10 ` Matthew Wilcox
0 siblings, 1 reply; 6+ messages in thread
From: Miaohe Lin @ 2023-07-13 11:49 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe
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(-)
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 */
--
2.33.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: remove some useless comments of node_stat_item
2023-07-13 11:49 [PATCH] mm: remove some useless comments of node_stat_item Miaohe Lin
@ 2023-07-13 12:10 ` Matthew Wilcox
2023-07-13 12:18 ` Miaohe Lin
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Wilcox @ 2023-07-13 12:10 UTC (permalink / raw)
To: Miaohe Lin; +Cc: akpm, linux-mm, linux-kernel
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
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: remove some useless comments of node_stat_item
2023-07-13 12:10 ` Matthew Wilcox
@ 2023-07-13 12:18 ` Miaohe Lin
2023-07-13 12:31 ` Matthew Wilcox
0 siblings, 1 reply; 6+ messages in thread
From: Miaohe Lin @ 2023-07-13 12:18 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: akpm, linux-mm, linux-kernel
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: remove some useless comments of node_stat_item
2023-07-13 12:18 ` Miaohe Lin
@ 2023-07-13 12:31 ` Matthew Wilcox
2023-07-14 1:36 ` Miaohe Lin
2023-07-14 2:37 ` Anshuman Khandual
0 siblings, 2 replies; 6+ messages in thread
From: Matthew Wilcox @ 2023-07-13 12:31 UTC (permalink / raw)
To: Miaohe Lin; +Cc: akpm, linux-mm, linux-kernel
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: remove some useless comments of node_stat_item
2023-07-13 12:31 ` Matthew Wilcox
@ 2023-07-14 1:36 ` Miaohe Lin
2023-07-14 2:37 ` Anshuman Khandual
1 sibling, 0 replies; 6+ messages in thread
From: Miaohe Lin @ 2023-07-14 1:36 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: akpm, linux-mm, linux-kernel
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. :)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: remove some useless comments of node_stat_item
2023-07-13 12:31 ` Matthew Wilcox
2023-07-14 1:36 ` Miaohe Lin
@ 2023-07-14 2:37 ` Anshuman Khandual
1 sibling, 0 replies; 6+ messages in thread
From: Anshuman Khandual @ 2023-07-14 2:37 UTC (permalink / raw)
To: Matthew Wilcox, Miaohe Lin; +Cc: akpm, linux-mm, linux-kernel
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" ?
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-14 2:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13 11:49 [PATCH] mm: remove some useless comments of node_stat_item Miaohe Lin
2023-07-13 12:10 ` Matthew Wilcox
2023-07-13 12:18 ` Miaohe Lin
2023-07-13 12:31 ` Matthew Wilcox
2023-07-14 1:36 ` Miaohe Lin
2023-07-14 2:37 ` Anshuman Khandual
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox