Re: [PATCH] mm: Expose lazy vfree pages to control via sysctl
From: Matthew Wilcox
Date: Fri Jan 04 2019 - 13:03:36 EST
On Fri, Jan 04, 2019 at 09:05:41PM +0530, Ashish Mhetre wrote:
> From: Hiroshi Doyu <hdoyu@xxxxxxxxxx>
> The purpose of lazy_max_pages is to gather virtual address space till it
> reaches the lazy_max_pages limit and then purge with a TLB flush and hence
> reduce the number of global TLB flushes.
> The default value of lazy_max_pages with one CPU is 32MB and with 4 CPUs it
> is 96MB i.e. for 4 cores, 96MB of vmalloc space will be gathered before it
> is purged with a TLB flush.
> This feature has shown random latency issues. For example, we have seen
> that the kernel thread for some camera application spent 30ms in
> __purge_vmap_area_lazy() with 4 CPUs.
You're not the first to report something like this. Looking through the
kernel logs, I see:
Author: Joel Fernandes <joelaf@xxxxxxxxxx>
Date: Mon Dec 12 16:44:26 2016 -0800
mm: add preempt points into __purge_vmap_area_lazy()
Author: Christoph Hellwig <hch@xxxxxx>
Date: Mon Dec 12 16:44:23 2016 -0800
mm: turn vmap_purge_lock into a mutex
Author: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Date: Fri May 20 16:57:38 2016 -0700
mm/vmalloc: keep a separate lazy-free list
So the first thing I want to do is to confirm that you see this problem
on a modern kernel. We've had trouble with NVidia before reporting
historical problems as if they were new.