Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Jacob Wen
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

Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Chris Down
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

Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Jacob Wen
On 12/18/20 10:27 PM, Michal Hocko wrote: On Fri 18-12-20 21:51:48, Jacob Wen wrote: On 12/18/20 6:51 PM, Michal Hocko wrote: On Fri 18-12-20 18:22:17, Jacob Wen wrote: This patch reduces repetition of set_task_reclaim_state() around do_try_to_free_pages(). The changelog really should be

Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Michal Hocko
On Fri 18-12-20 21:51:48, Jacob Wen wrote: > > On 12/18/20 6:51 PM, Michal Hocko wrote: > > On Fri 18-12-20 18:22:17, Jacob Wen wrote: > > > This patch reduces repetition of set_task_reclaim_state() around > > > do_try_to_free_pages(). > > The changelog really should be talking about why this is

Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Jacob Wen
On 12/18/20 8:17 PM, Matthew Wilcox wrote: On Fri, Dec 18, 2020 at 06:22:17PM +0800, Jacob Wen wrote: This patch reduces repetition of set_task_reclaim_state() around do_try_to_free_pages(). what is a DRY cleanup? DRY is short for "Don't repeat yourself"[1]. [1]

Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Jacob Wen
On 12/18/20 6:51 PM, Michal Hocko wrote: On Fri 18-12-20 18:22:17, Jacob Wen wrote: This patch reduces repetition of set_task_reclaim_state() around do_try_to_free_pages(). The changelog really should be talking about why this is needed/useful. From the above it is not really clear whether

Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Matthew Wilcox
On Fri, Dec 18, 2020 at 06:22:17PM +0800, Jacob Wen wrote: > This patch reduces repetition of set_task_reclaim_state() around > do_try_to_free_pages(). what is a DRY cleanup?

Re: [PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Michal Hocko
On Fri 18-12-20 18:22:17, Jacob Wen wrote: > This patch reduces repetition of set_task_reclaim_state() around > do_try_to_free_pages(). The changelog really should be talking about why this is needed/useful. >From the above it is not really clear whether you aimed at doing a clean up or this is a

[PATCH] mm/vmscan: DRY cleanup for do_try_to_free_pages()

2020-12-18 Thread Jacob Wen
This patch reduces repetition of set_task_reclaim_state() around do_try_to_free_pages(). Signed-off-by: Jacob Wen --- mm/vmscan.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 257cba79a96d..4bc244b23686 100644