lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 7 May 2015 20:12:31 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Dave Kleikamp <dave.kleikamp@...cle.com>,
	Jens Axboe <axboe@...nel.dk>, Zach Brown <zab@...bo.net>,
	Maxim Patlasov <mpatlasov@...allels.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for
 direct IO

On Thu, May 7, 2015 at 3:16 PM, Christoph Hellwig <hch@...radead.org> wrote:
> On Thu, May 07, 2015 at 01:08:23AM +0800, Ming Lei wrote:
>> When direct IO is submitted from kernel, it is often unnecessary
>> to dirty pages, for example of loop, dirtying pages have been
>> considered in the upper filesystem(over loop) side already, and
>> they don't need to be dirtied again.
>>
>> So this patch introduces IOCB_DONT_DIRTY_PAGE flag for direct IO,
>> and other ITER_BVEC and ITER_KVEC cases might benefit from it too.
>>
>> The patch is based on previous Dave's patch.
>
> in-kernel I/O should never dirty the pages written to or read from,
> so just checking the iov_iter type should be enough.

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.

So I suggest to use the flag of IOCB_DONT_DIRTY_PAGE for
the purpose.

Thanks,
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ