[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190408012320.GA11988@hsj-Precision-5520>
Date:   Mon, 8 Apr 2019 09:23:21 +0800
From:   Huang Shijie <sjhuang@...vatar.ai>
To:     Ira Weiny <ira.weiny@...el.com>
CC:     <akpm@...ux-foundation.org>, <sfr@...b.auug.org.au>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/gup.c: fix the wrong comments
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
Powered by blists - more mailing lists