[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7295d9c3-ecc3-ae60-1818-72b0565741ff@nvidia.com>
Date: Mon, 18 Jun 2018 10:44:28 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Christoph Hellwig <hch@...radead.org>, <john.hubbard@...il.com>
CC: Matthew Wilcox <willy@...radead.org>,
Michal Hocko <mhocko@...nel.org>,
Christopher Lameter <cl@...ux.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Dan Williams <dan.j.williams@...el.com>,
Jan Kara <jack@...e.cz>, <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-rdma <linux-rdma@...r.kernel.org>
Subject: Re: [PATCH 2/2] mm: set PG_dma_pinned on get_user_pages*()
Hi Christoph,
Thanks for looking at this...
On 06/18/2018 12:56 AM, Christoph Hellwig wrote:
> On Sat, Jun 16, 2018 at 06:25:10PM -0700, john.hubbard@...il.com wrote:
>> From: John Hubbard <jhubbard@...dia.com>
>>
>> This fixes a few problems that come up when using devices (NICs, GPUs,
>> for example) that want to have direct access to a chunk of system (CPU)
>> memory, so that they can DMA to/from that memory. Problems [1] come up
>> if that memory is backed by persistence storage; for example, an ext4
>> file system. I've been working on several customer bugs that are hitting
>> this, and this patchset fixes those bugs.
>
> What happens if we do get_user_page from two different threads or even
> processes on the same page? As far as I can tell from your patch
> the first one finishing the page will clear the bit and then we are
> back to no protection.
The patch does not do that. The flag is only ever cleared when the page is
freed. That can't happen until each of the two threads above is done and
calls put_page(). So while there may be other design issues here, the above
case is not one of them. :)
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists