All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dave Kleikamp <dave.kleikamp@oracle.com>,
	Jens Axboe <axboe@kernel.dk>, Zach Brown <zab@zabbo.net>,
	Maxim Patlasov <mpatlasov@parallels.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO
Date: Thu, 7 May 2015 20:12:31 +0800	[thread overview]
Message-ID: <CACVXFVOJH-7eKvpFe+9vN_0kyo8Thik+Mn75PTtmNhMdyjxoVw@mail.gmail.com> (raw)
In-Reply-To: <20150507071618.GA7595@infradead.org>

On Thu, May 7, 2015 at 3:16 PM, Christoph Hellwig <hch@infradead.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

  reply	other threads:[~2015-05-07 12:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 17:08 [PATCH v3 0/4] block: loop: improve loop with AIO Ming Lei
2015-05-06 17:08 ` [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO Ming Lei
2015-05-07  7:16   ` Christoph Hellwig
2015-05-07 12:12     ` Ming Lei [this message]
2015-05-11  7:19       ` Christoph Hellwig
2015-05-11 13:02         ` Ming Lei
2015-05-12  7:24           ` Christoph Hellwig
2015-05-12  8:54             ` Ming Lei
2015-05-06 17:08 ` [PATCH v3 2/4] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop Ming Lei
2015-05-06 17:08 ` [PATCH v3 3/4] block: loop: use kthread_work Ming Lei
2015-05-07  7:17   ` Christoph Hellwig
2015-05-07 10:32     ` Ming Lei
2015-05-11  7:20       ` Christoph Hellwig
2015-05-11 13:12         ` Ming Lei
2015-05-12  7:25           ` Christoph Hellwig
2015-05-12  8:55             ` Ming Lei
2015-05-06 17:08 ` [PATCH v3 4/4] block: loop: support DIO & AIO Ming Lei
2015-05-07  7:24   ` Christoph Hellwig
2015-05-07 12:32     ` Ming Lei
2015-05-07 22:20       ` Dave Chinner
2015-05-08  4:09         ` Ming Lei
2015-05-11  1:28           ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACVXFVOJH-7eKvpFe+9vN_0kyo8Thik+Mn75PTtmNhMdyjxoVw@mail.gmail.com \
    --to=ming.lei@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=dave.kleikamp@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatlasov@parallels.com \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zab@zabbo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.