RE: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

2020-10-16 Thread Tianxianting
Thanks for the explain. I got it. -Original Message- From: Michal Hocko [mailto:mho...@suse.com] Sent: Friday, October 16, 2020 9:45 PM To: tianxianting (RD) Cc: a...@linux-foundation.org; linux...@kvack.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: vmscan: avoid a

Re: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

2020-10-16 Thread Michal Hocko
On Fri 16-10-20 13:20:41, Tianxianting wrote: > Thanks > I understood what you said :) > But whether it is proper to check reschedule in every loop when lock is > taken? I do not see any actual problem TBH. cond_resched is mostly to increase interactivity for non preemptible kernel. It can reduc

RE: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

2020-10-16 Thread Tianxianting
Hocko [mailto:mho...@suse.com] Sent: Friday, October 16, 2020 9:02 PM To: tianxianting (RD) Cc: a...@linux-foundation.org; linux...@kvack.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab() On Fri 16-10-20 12:48:23, Tianxianting wrote

Re: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

2020-10-16 Thread Michal Hocko
Hocko [mailto:mho...@suse.com] > Sent: Friday, October 16, 2020 8:08 PM > To: tianxianting (RD) > Cc: a...@linux-foundation.org; linux...@kvack.org; > linux-kernel@vger.kernel.org > Subject: Re: [PATCH] mm: vmscan: avoid a unnecessary reschedule in > shrink_slab() > > On

RE: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

2020-10-16 Thread Tianxianting
linux...@kvack.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab() On Fri 16-10-20 11:39:52, Xianting Tian wrote: > In shrink_slab(), it directly goes to 'out' label only when it can't > get the lock of shrink

Re: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

2020-10-16 Thread Michal Hocko
On Fri 16-10-20 11:39:52, Xianting Tian wrote: > In shrink_slab(), it directly goes to 'out' label only when it > can't get the lock of shrinker_rwsew. In this case, it doesn't > do the real work of shrinking slab, so we don't need trigger a > reschedule by cond_resched(). Your changelog doesn't e

[PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

2020-10-15 Thread Xianting Tian
In shrink_slab(), it directly goes to 'out' label only when it can't get the lock of shrinker_rwsew. In this case, it doesn't do the real work of shrinking slab, so we don't need trigger a reschedule by cond_resched(). Signed-off-by: Xianting Tian --- mm/vmscan.c | 3 ++- 1 file changed, 2 inser