lkml.org 
[lkml]   [2015]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO
From
On Mon, May 11, 2015 at 3:19 PM, Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, May 07, 2015 at 08:12:31PM +0800, Ming Lei wrote:
>> In case of loop, it is quite specific about dirtying READ pages in
>> direct IO because fs over loop has considered dirtying these pages
>> already.
>>
>> For other cases of ITER_BVEC or ITER_KVEC, if the page is
>> anonymous or mapped, dirtying is still needed, otherwise
>> the new written data may be dropped like direct-io from user space.
>
> But those would be user pages. Anyone who passes a kernel page doesn't

Inside kernel it is hard to say one page in page cache is kernel or
user page, :-)

> expect it do be dirtied for normal kernel interfaces.

Currently the coming direct IO introduced for loop should be the 1st direct
read inside kernel, so there isn't the case of passing kernel pages, and
obviously ITER_BVEC/ITER_KVEC doesn't mean the page is 'kernel' page.

Another direct IO inside kernel is __swap_writepage(), and it is still
ITER_BVEC and user page. Maybe in the future swap_readpage()
can use direct IO with BVEC too.

It depends if all kernel direct read I/O to 'user' page(anonymous, mapped,
page cache) via BVEC/KVEC do not need to dirty the page. At least for loop,
I understand the reason is specific, that is why I suggest to use the flag now,
at least it has document benefit because the reason isn't obvious.

Thanks,
Ming Lei


\
 
 \ /
  Last update: 2015-05-11 15:41    [W:0.082 / U:7.204 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site