Re: [PATCH] Add ability to dump mapped pages with/proc/sys/vm/drop_caches

From: Dave Jones
Date: Sun Sep 30 2007 - 23:37:21 EST

On Sun, Sep 30, 2007 at 08:03:51PM +0200, Soeren Sandmann wrote:
> This patch adds the ability to drop mapped pages with
> /proc/sys/vm/drop_caches. This is useful to get repeatable
> measurements of startup time for applications.
> Without it, pages that are mapped in already-running applications will
> not get dropped, so the time measured will not be a true cold-cache
> time.
> Rik pointed out that "be_atomic" is a bit pointless since there is a
> race on SMP anyway where pages can be added. However, it is there in
> the existing code, so I added it for the new code as well. Does anyone
> know why it's there?

this cset added it (and has a pretty explanatory commit msg)


commit fc9a07e7bf1a76e710f5df017abb07628db1781d
Author: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Date: Sun Jul 15 23:38:14 2007 -0700

invalidate_mapping_pages(): add cond_resched

invalidate_mapping_pages() can sometimes take a long time (millions of pages
to free). Long enough for the softlockup detector to trigger.

We used to have a cond_resched() in there but I took it out because the
drop_caches code calls invalidate_mapping_pages() under inode_lock.

The patch adds a nasty flag and puts the cond_resched() back.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at