Skip to contentSkip to conversation

reduce shrink_mmap rate of failure (initial attempt)

DISCUSSION Roger Larsson 3 participants 3 messages Jun 7, 2000 – Jun 8, 2000 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines

That patch hangs my machine here when I run mmap002. The machine is in shrink_mmap. It hangs trying to get the pagmap_lru_lock.

I think that the idea is good, but it doesn't work here :(.

Later, Juan.

Ouch...

The only possible explaination is that we are searching for pages on a zone. But no such pages are possible to free from LRU...
And we LOOP the list, holding the lru lock...
Note: without this patch you may end up in another bad situation where shrink_mmap always fails and swapping will start until it swaps out a page of that specific zone.
And without the test? We would free all other LRU pages without finding one that we want :-(

This will be interesting to fix...

May the allocation of pages play a part? Filling zone after zone will give no mix between the zones.

/RogerL
(from work)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#1 lore raw
Quoted 6 lines · Roger Larsson
Quoted 2 lines

That patch hangs my machine here when I run mmap002. The machine is in shrink_mmap. It hangs trying to get the pagmap_lru_lock.

The only possible explaination is that we are searching for pages on a zone. But no such pages are possible to free from LRU... And we LOOP the list, holding the lru lock...

Indeed. I'll make sure to have this fixed in the multi-list setup I'm working on. A quick fix is to have a per-zone counter of the number of lru pages, so you can just stop when zone->lru_pages == 0.

Quoted 2 lines

May the allocation of pages play a part? Filling zone after zone will give no mix between the zones.

Ohh, but it does. On most systems, after memory fills up, we'll be allocating a few pages from one zone, then a few pages from the next zone, then kswapd kicks in and we start all over again.

The fact that you and quintela had to go through trouble to hit the bug makes me believe that it's not a very big issue in the normal case ... just something we want fixed and luckily the fix is easy.

regards,

Rik
--
The Internet is not a network of computers. It is a network of people. That is its real strength.

Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies
http://www.conectiva.com/ http://www.surriel.com/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

#2 lore raw
In reply to Roger Larsson

Hi again,

There is an even more likely scenario...

* shrink_mmap is called when no zone is under pressure. then it will search the list over and over again...

Who could do such a nasty thing?

do_try_to_free_pages !

Its agenda is not to stop when there is no pressure - it will go on until FREE_COUNT (8) pages are freed...

Even in the normal ac10 this should be a problem.
Several turns in do_try_to_free_pages with shrink_mmap failing will be done - each swapping out some pages...

It will take time and swap...

/RogerL

Quoted 24 lines · Roger Larsson
Quoted 7 lines

That patch hangs my machine here when I run mmap002. The machine is in shrink_mmap. It hangs trying to get the pagmap_lru_lock.

I think that the idea is good, but it doesn't work here :(.

Later, Juan.

Ouch...

The only possible explaination is that we are searching for pages on a zone. But no such pages are possible to free from LRU...
And we LOOP the list, holding the lru lock...
Note: without this patch you may end up in another bad situation where shrink_mmap always fails and swapping will start until it swaps out a page of that specific zone.
And without the test? We would free all other LRU pages without finding one that we want :-(

This will be interesting to fix...

May the allocation of pages play a part? Filling zone after zone will give no mix between the zones.

Quoted 7 lines

/RogerL
(from work)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

--
Home page:
http://www.norran.net/nra02596/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/