Re: [PATCH]: Option to run cache reap in thread mode

Andrew Morton
2004-06-18T22:03:37Z

Manfred Spraul <manfred@colorfullife.com> wrote:
>
> I'll write something:
> - allow to disable the DMA kmalloc caches for archs that do not need them.
> - increase the timer frequency and scan only a few caches in each timer.
> - perhaps a quicker test for cache_reap to notice that nothing needs to
> be done. Right now four tests are done (!flags & _NO_REAP,
> ac->touched==0, ac->avail != 0, global timer not yet expired). It's
> possible to skip some tests. e.g. move the _NO_REAP caches on a separate
> list, replace the time_after(.next_reap,jiffies) with a separate timer.

Come to think of it, replacing the timer with schedule_delayed_work() and
doing it all via keventd should work OK. Doing everything in a single pass
is the most CPU-efficient way of doing it, and as long as we're preemptible
and interruptible the latency issues will be solved.