Re: [PATCH] mm: do not stall register_shrinker()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 02, 2019 at 01:09:05PM -0700, Robert Kolchmeyer wrote:
> From: Minchan Kim <minchan@xxxxxxxxxx>
> 
> commit e496612c5130567fc9d5f1969ca4b86665aa3cbb upstream.
> 
> Shakeel Butt reported he has observed in production systems that the job
> loader gets stuck for 10s of seconds while doing a mount operation.  It
> turns out that it was stuck in register_shrinker() because some
> unrelated job was under memory pressure and was spending time in
> shrink_slab().  Machines have a lot of shrinkers registered and jobs
> under memory pressure have to traverse all of those memcg-aware
> shrinkers and affect unrelated jobs which want to register their own
> shrinkers.
> 
> To solve the issue, this patch simply bails out slab shrinking if it is
> found that someone wants to register a shrinker in parallel.  A downside
> is it could cause unfair shrinking between shrinkers.  However, it
> should be rare and we can add compilcated logic if we find it's not
> enough.
> 
> [akpm@xxxxxxxxxxxxxxxxxxxx: tweak code comment]
> Link: http://lkml.kernel.org/r/20171115005602.GB23810@bbox
> Link: http://lkml.kernel.org/r/1511481899-20335-1-git-send-email-minchan@xxxxxxxxxx
> Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx>
> Signed-off-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
> Reported-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
> Tested-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>
> Cc: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
> Cc: Anshuman Khandual <khandual@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> [rkolchmeyer: Backported to 4.14: adjusted context]
> Signed-off-by: Robert Kolchmeyer <rkolchmeyer@xxxxxxxxxx>
> ---
> Backport of commit e496612c5130567fc9d5f1969ca4b86665aa3cbb upstream.
> We would like to apply this to linux-4.14.y.
> I needed to change the patch context for the patch to apply to linux-4.14.y.
> The actual fix remains unchanged.

Now queued up, thanks.

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux