Thread (20 messages) 20 messages, 5 authors, 2012-06-29

Re: needed lru_add_drain_all() change

From: Peter Zijlstra <peterz@infradead.org>
Date: 2012-06-27 10:31:24

On Tue, 2012-06-26 at 23:46 -0700, Andrew Morton wrote:
btw, the first step should be to audit all lru_add_drain_all() sites
and work out exactly why they are calling lru_add_drain_all() - what
are they trying to achive?
# git grep lru_add_drain_all
fs/block_dev.c: lru_add_drain_all();    /* make sure all lru add caches are flushed */
include/linux/swap.h:extern int lru_add_drain_all(void);
mm/compaction.c:        lru_add_drain_all();
mm/compaction.c:                lru_add_drain_all();
mm/ksm.c:               lru_add_drain_all();
mm/memcontrol.c:                lru_add_drain_all();
mm/memcontrol.c:        lru_add_drain_all();
mm/memcontrol.c:        lru_add_drain_all();
mm/memory-failure.c:            lru_add_drain_all();
mm/memory_hotplug.c:            lru_add_drain_all();
mm/memory_hotplug.c:    lru_add_drain_all();
mm/migrate.c:   lru_add_drain_all();
mm/migrate.c:    * here to avoid lru_add_drain_all().
mm/mlock.c:     lru_add_drain_all();    /* flush pagevec */
mm/mlock.c:             lru_add_drain_all();    /* flush pagevec */
mm/page_alloc.c:         * For avoiding noise data, lru_add_drain_all() should be called
mm/page_alloc.c:        lru_add_drain_all();
mm/swap.c:int lru_add_drain_all(void)


I haven't audited all sites, but most of them try to flush the per-cpu
lru pagevecs to make sure the pages are on the lru so they can take them
off again ;-)

Take compaction for instance, if a page in the middle of a range is on a
per-cpu pagevec it can't move it and the compaction might fail.


Hmm, another alternative is teaching isolate_lru_page() and friends to
take pages from the pagevecs directly, not sure what that would take.

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help