Re: missing madvise functionality

Andrew Morton
2007-04-05T08:32:25Z

On Thu, 05 Apr 2007 03:39:29 -0400 Rik van Riel <riel@redhat.com> wrote:

> Rik van Riel wrote:
>
> > MADV_DONTNEED, unpatched, 1000 loops
> >
> > real 0m13.672s
> > user 0m1.217s
> > sys 0m45.712s
> >
> >
> > MADV_DONTNEED, with patch, 1000 loops
> >
> > real 0m4.169s
> > user 0m2.033s
> > sys 0m3.224s
>
> I just noticed something fun with these numbers.
>
> Without the patch, the system (a quad core CPU) is 10% idle.
>
> With the patch, it is 66% idle - presumably I need Nick's
> mmap_sem patch.
>
> However, despite being 66% idle, the test still runs over
> 3 times as fast!

Please quote the context switch rate when testing this stuff (I use vmstat 1).
I've seen it vary by a factor of 10,000 depending upon what's happening.