linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Wen <jian.w.wen@oracle.com>
To: Chris Down <chris@chrisdown.name>
Cc: Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()
Date: Sat, 19 Dec 2020 11:18:43 +0800	[thread overview]
Message-ID: <fc257fe6-f2e4-bc53-1943-533661378fc5@oracle.com> (raw)
In-Reply-To: <X91Vg1Mg1nPk/Bsx@chrisdown.name>


On 12/19/20 9:21 AM, Chris Down wrote:
> Jacob Wen writes:
>> set_task_reclaim_state() is a function with 3 lines of code of which 
>> 2 lines contain WARN_ON_ONCE.
>>
>> I am not comfortable with the current repetition.
>
> Ok, but could you please go into _why_ others should feel that way 
> too? There are equally also reasons to err on the side of leaving code 
> as-is -- since we know it already works, and this code generally has 
> pretty high inertia -- and avoid mutation of code without concrete 
> description of the benefits.

I don't get your point. The patch doesn't change code of 
set_task_reclaim_state(), so I am fine with the repeated WARN_ON_ONCE.

I mean I prefer removing duplicate code to avoid going down the rabbit 
hole of set_task_reclaim_state().

It's a fundamental principle to me to move the code into its own 
function. I'd like to hear the others' opinions.





  reply	other threads:[~2020-12-19  3:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 10:22 Jacob Wen
2020-12-18 10:51 ` Michal Hocko
2020-12-18 13:51   ` Jacob Wen
2020-12-18 14:27     ` Michal Hocko
2020-12-18 17:41       ` Jacob Wen
2020-12-19  1:21         ` Chris Down
2020-12-19  3:18           ` Jacob Wen [this message]
2020-12-18 12:17 ` Matthew Wilcox
2020-12-18 13:54   ` Jacob Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc257fe6-f2e4-bc53-1943-533661378fc5@oracle.com \
    --to=jian.w.wen@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chrisdown.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox