Re: [PATCH] mm/gup.c: fix the wrong comments

From: Huang Shijie
Date: Sun Apr 07 2019 - 21:23:53 EST


On Thu, Apr 04, 2019 at 09:50:47AM -0700, Ira Weiny wrote:
> On Thu, Apr 04, 2019 at 03:23:47PM +0800, Huang Shijie wrote:
> > When CONFIG_HAVE_GENERIC_GUP is defined, the kernel will use its own
> > get_user_pages_fast().
> >
> > In the following scenario, we will may meet the bug in the DMA case:
> > .....................
> > get_user_pages_fast(start,,, pages);
> > ......
> > sg_alloc_table_from_pages(, pages, ...);
> > .....................
> >
> > The root cause is that sg_alloc_table_from_pages() requires the
> > page order to keep the same as it used in the user space, but
> > get_user_pages_fast() will mess it up.
>
> I wonder if there is something we can do to change sg_alloc_table_from_pages()
> to work? Reading the comment for it there is no indication of this limitation.
The sg_alloc_table_from_pages() cannot work if the page order is wrong...

> So should we update that comment as well?
Okay.

I will create a DMA patch to add more comment for sg_alloc_table_from_pages().

Thanks
Huang Shijie