On Tue, 7 Feb 2006 04:00 pm, Nick Piggin wrote:
Con Kolivas wrote:
On Tue, 7 Feb 2006 02:08 pm, Nick Piggin wrote:
prefetch_get_page is doing funny things with zones and nodes / zonelists
(eg. 'We don't prefetch into DMA' meaning something like 'this only works
on i386 and x86-64').
Hrm? It's just a generic thing to do; I'm not sure I follow why it's i386
and x86-64 only. Every architecture has ZONE_NORMAL so it will prefetch
there.
I don't think every architecture has ZONE_NORMAL.
!ZONE_DMA they all have, no?
If you omit __GFP_WAIT and already test the watermarks yourself it should
be OK.
Ok.
Workstations can have 2 or more dual core CPUs with multiple threads or
NUMA these days. Desktops and laptops will probably eventually gain more
cores and threads too.
While I am aware of the hardware changes out there I still doubt the scalability issues you're concerned about affect a desktop. The code cost and complexity will increase substantially yet I'm not sure that will be for any gain to the targetted users.
Why bother with the trylocks? On many architectures they'll RMW the
cacheline anyway, so scalability isn't going to be much improved (or do
you see big lock contention?)
Rather than scalability concerns per se the trylock is used as yet
another (admittedly rarely hit) way of defining busy.
They just seem to complicate the code for apparently little gain.
No biggie; I'll drop them.
The code is pretty aggressive at defining busy. It looks for pretty much
all of those and it prefetches till it stops then allowing idle to occur
again. Opting out of prefetching whenever there is doubt seems reasonable
to me.
What if you want to prefetch when there is slight activity going on though?
I don't. I want this to not cost us anything during any activity.
What if your pagecache has filled memory with useless stuff (which would
appear to be the case with updatedb).
There is no way the vm will ever be smart enough to say "this is crap, throw it out and prefetch some good stuff", so it doesn't matter.
- for all its efforts, it will still interact with page reclaim by
putting pages on the LRU and causing them to be cycled.
- on bursty loads, this cycling could happen a bit. and more reads on
the swap devices.
Theoretically yes I agree. The definition of busy is so broad that
prevents it prefetching that it is not significant.
Not if the workload is very bursty.
It's an either/or for prefetching; I don't see a workaround, just some sane balance.
Any code in a core system is intrusive by definition because it simply
adds to the amount of work that needs to be done when maintaining the
thing or trying to understand how things work, debugging people's badly
behaving workloads, etc.
I'm open to code suggestions and appreciate any outside help.
If it is going to be off by default, why couldn't they
echo 10 > /proc/sys/vm/swappiness rather than turning it on?
Because we still swap no matter what the sysctl setting is, which makes it even more useful in my opinion for those who aggressively set this tunable.