linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* how not to write a search algorithm
@ 2002-08-04  8:35 Andrew Morton
  2002-08-04 13:16 ` Rik van Riel
  0 siblings, 1 reply; 20+ messages in thread
From: Andrew Morton @ 2002-08-04  8:35 UTC (permalink / raw)
  To: linux-mm

Worked out why my box is going into a 3-5 minute coma with one test.
Think what the LRUs look like when the test first hits page reclaim
on this 2.5G ia32 box:

               head                           tail
active_list:   <800M of ZONE_NORMAL> <200M of ZONE_HIGHMEM>
inactive_list:          <1.5G of ZONE_HIGHMEM>

now, somebody does a GFP_KERNEL allocation.

uh-oh.

VM calls refill_inactive.  That moves 25 ZONE_HIGHMEM pages onto
the inactive list.  It then scans 5000 pages, achieving nothing.

VM calls refill_inactive.  That moves 25 ZONE_HIGHMEM pages onto
the inactive list.  It then scans about 10000 pages, achieving nothing.

VM calls refill_inactive.  That moves 25 ZONE_HIGHMEM pages onto
the inactive list.  It then scans about 20000 pages, achieving nothing.

VM calls refill_inactive.  That moves 25 ZONE_HIGHMEM pages onto
the inactive list.  It then scans about 40000 pages, achieving nothing.

VM calls refill_inactive.  That moves 25 ZONE_HIGHMEM pages onto
the inactive list.  It then scans about 80000 pages, achieving nothing.

VM calls refill_inactive.  That moves 25 ZONE_HIGHMEM pages onto
the inactive list.  It then scans about 160000 pages, achieving nothing.

VM calls refill_inactive.  That moves 25 ZONE_HIGHMEM pages onto
the inactive list.  It then scans about 320000 pages, achieving nothing.

The page allocation fails.  So __alloc_pages tries it all again.


This all gets rather boring.


Per-zone LRUs will fix it up.  We need that anyway, because a ZONE_NORMAL
request will bogusly refile, on average, memory_size/800M pages to the
head of the inactive list, thus wrecking page aging.

Alan's kernel has a nice-looking implementation.  I'll lift that out
next week unless someone beats me to it.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2002-08-05 10:50 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-04  8:35 how not to write a search algorithm Andrew Morton
2002-08-04 13:16 ` Rik van Riel
2002-08-04 20:00   ` Andrew Morton
2002-08-04 19:54     ` Rik van Riel
2002-08-04 20:38     ` William Lee Irwin III
2002-08-04 21:09       ` Andrew Morton
2002-08-04 22:02         ` William Lee Irwin III
2002-08-04 22:43           ` Andrew Morton
2002-08-04 22:47             ` William Lee Irwin III
2002-08-05  3:00               ` Andrew Morton
2002-08-05  2:55                 ` Rik van Riel
2002-08-05  7:40                 ` William Lee Irwin III
2002-08-05  8:44                   ` Andrew Morton
2002-08-05 10:50                     ` William Lee Irwin III
2002-08-04 22:45         ` Daniel Phillips
2002-08-04 23:03           ` Andrew Morton
2002-08-04 23:00             ` William Lee Irwin III
2002-08-04 23:02             ` Daniel Phillips
2002-08-04 23:21               ` Andrew Morton
2002-08-05  0:03             ` Daniel Phillips

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox