On Fri, 6 Jun 2008 18:04:30 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
I do not know if 50% is optimum. It is just what the upstream kernel
has had since 2.4.10 or so. Before that it used to be 75%. This same
percentage is used to free swap spaces at swapin time.
I wonder if we wouldn't be off best simply placing the two on their
own cache line. After all, they are often handled together.
I believe that should be a separate patch though, since I am not
changing that situation from what is already upstream and this
patch series contains more than enough stuff already.
With CONFIG_SWAP=n the macro PageSwapCache(page) will always be
declared false due to the declarations in page-flags.h. That
means that vm_swap_full() will be evaluated and the compiler
should leave it out.
#ifdef CONFIG_SWAP
PAGEFLAG(SwapCache, swapcache)
#else
PAGEFLAG_FALSE(SwapCache)
#endif
It is safe because the callers already hold an extra reference to
each page. I have added a full kerneldoc comment to this function
to explain that.
--
All rights reversed.
--