Re: [PATCH] Fix to make check_pgt_cache work on !i386 architectures

Jakub Jelinek (jj@sunsite.ms.mff.cuni.cz)
Sat, 1 Aug 1998 08:53:02 +0200 (MET DST)


> Hi Jakub,
>
> I'd like to request one additional change, which is to have check_pgt_cache() accept the lower cache limit as an argument.
> Then the normal cache level regulation can use something like
>
> check_pgt_cache(pgt_cache_water[0]);
>
> while the vm system can use check_pgt_cache(0) when the cache needs to be trimmed. (With the understanding that a value of 0
> will free any memory not being used.)

Where would you like to call it with argument 0?
As we (David Miller and myself) explained a few times already, the nice
thing about page table cache is that it requires now locking, so it is
pretty fast. So you have to call it from the same CPU the cache is on, which
is usually not the case with try_to_free_pages etc.
What could be possible and could help would be to set the pgt_cache_water
marks defaults according to the actual amount of memory detected...

>
> If this sounds reasonable to you, I'll adapt my misc memory freeing patch to work with these calls.

I'm still missing any protection against the ugly race I and David explained
to you. I think it could really work, if you help scheduler_lock, just
played with tasks with the mm not on any CPU and right after clearing it's
pte (or making it readonly) down that mm's semaphore (it should be without
waiting, as that mm is not running at all) and release the scheduler_lock.
Then copy the page and then up the semaphore...

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
Ultralinux - first 64bit OS to take full power of the UltraSparc
Linux version 2.1.112 on a sparc64 machine (498.80 BogoMips).
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html