Re: [PATCH 4/8] mm: FOLL_DUMP replace FOLL_ANON
From: Minchan Kim
Date: Sun Sep 13 2009 - 19:05:19 EST
Hi, Hugh.
On 2009年9月13日 16:46:12 +0100 (BST)
Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx> wrote:
>
On 2009年9月10日, Minchan Kim wrote:
>
> > Â Â Â Â/*
>
> > Â Â Â Â * When core dumping an enormous anonymous area that nobody
>
> > - Â Â Â Â* has touched so far, we don't want to allocate page tables.
>
> > + Â Â Â Â* has touched so far, we don't want to allocate unnecessary pages or
>
> > + Â Â Â Â* page tables. ÂReturn error instead of NULL to skip handle_mm_fault,
>
> > + Â Â Â Â* then get_dump_page() will return NULL to leave a hole in the dump.
>
> > + Â Â Â Â* But we can only make this optimization where a hole would surely
>
> > + Â Â Â Â* be zero-filled if handle_mm_fault() actually did handle it.
>
> > Â Â Â Â */
>
> > - Â Â Â if (flags & FOLL_ANON) {
>
> > - Â Â Â Â Â Â Â page = ZERO_PAGE(0);
>
> > - Â Â Â Â Â Â Â if (flags & FOLL_GET)
>
> > - Â Â Â Â Â Â Â Â Â Â Â get_page(page);
>
> > - Â Â Â Â Â Â Â BUG_ON(flags & FOLL_WRITE);
>
> > - Â Â Â }
>
> > + Â Â Â if ((flags & FOLL_DUMP) &&
>
> > + Â Â Â Â Â (!vma->vm_ops || !vma->vm_ops->fault))
>
>
>
> How about adding comment about zero page use?
>
>
What kind of comment did you have in mind?
>
We used to use ZERO_PAGE there, but with this patch we're not using it.
>
I thought the comment above describes what we're doing well enough.
>
>
I may have kept too quiet about ZERO_PAGEs, knowing that a later patch
>
was going to change the story; but I don't see what needs saying here.
I meant following as line.
>
> > + Â Â Â if ((flags & FOLL_DUMP) &&
>
> > + Â Â Â Â Â (!vma->vm_ops || !vma->vm_ops->fault))
Why do we care about anonymous vma and FOLL_DUMP?
Yeah, comment above mentioned page tables.
But i think someone who first look at can't think it easily.
If you think the comment is enough, I don't mind it.
>
Hugh
--
Kind regards,
Minchan Kim
--
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/