Re: [PATCH] more ZERO_PAGE handling ( was 2.6.24 regression:deadlock on coredump of big process)

From: KAMEZAWA Hiroyuki
Date: Tue May 06 2008 - 22:23:28 EST


On Wed, 7 May 2008 11:14:04 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> > > pte = *ptep;
> > > - if (!pte_present(pte))
> > > + if (!pte_present(pte)) {
> > > + if (!(flags & FOLL_WRITE) && pte_none(pte)) {
> > > + pte_unmap_unlock(ptep, ptl);
> > > + goto null_or_zeropage;
> > > + }
> > > goto unlock;
> > > + }
> >
> > Just a small nitpick: I guess you don't need this FOLL_WRITE test because
> > null_or_zeropage will test FOLL_ANON which implies !FOLL_WRITE. It should give
> > slightly smaller code.
> >
> > Otherwise, looks good to me:
> >
> Hmm, but
>
> do_execve()
> -> copy_strings()
> -> get_arg_page()
> -> get_user_pages()
>
> can do write-page-fault in ANON (and it's a valid ops.)
>
> So, I think it's safe not to remove FOLL_WRITE check here.
>
BTW, in above case, returning ZERO_PAGE() when pgd/pud/pmd is not available is
safe ? (above path is expanding-stack at exec.)

Thanks,
-Kame




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/