On Fri, Aug 20, 2010 at 08:01:23PM -0500, Corey Wright wrote:
> the recent 22.214.171.124 conflicts with patch-126.96.36.199-vs188.8.131.52.9.diff
> in mm/memory.c and attached is my attempt at resolving the conflict.
> 184.108.40.206 adds check_stack_guard_page() to do_anonymous_page() right
> before anon_vma_prepare(), which conflicts with linux-vserver's
> addition of vx_rss_avail() in the same location. which one should be
> first or does it matter at all)?
if both functions have no side-effects, the criterion would
be to put simple checks first, but it would not matter for
the end result ...
> my guess, as reflected in the attached patch, is
> check_stack_guard_page() then vx_rss_avail() (because
> check_stack_guard_page() is more important than vx_rss_avail(), so
> check it first).
the Linux-VServer vx_rss_avail() has no side-effects but
might cause significant delays due to vxi dereferencing
so the check_stack_guard_page() might be faster ...
> if i'm wrong (or even right, but for the wrong reason),
> then please let me know why, as i'm interested in learning.
however, in this case, the check_stack_guard_page() has,
under certain circumstances, side-effects which can not
easily be undone in case the vx_rss_avail() fails, so
you definitely want to put that check first, despite the
fact that it might be more resource intensive than the
> --- linux-220.127.116.11/mm/memory.c 2010-08-20 17:59:24.000000000 -0500
> +++ linux-18.104.22.168-vs22.214.171.124.9/mm/memory.c 2010-08-20 19:56:34.000000000 -0500
> @@ -2434,6 +2442,9 @@ static int do_anonymous_page(struct mm_s
> if (check_stack_guard_page(vma, address) < 0)
> return VM_FAULT_SIGBUS;
> + if (!vx_rss_avail(mm, 1))
> + goto oom;
> /* Allocate our own private page. */
> if (unlikely(anon_vma_prepare(vma)))
> goto oom;
Received on Sun Aug 22 18:19:24 2010