Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
From: Roman Penyaev <rpenyaev@suse.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org,
	linux-block@vger.kernel.org, linux-arch@vger.kernel.org,
	hch@lst.de, jmoyer@redhat.com, avi@scylladb.com,
	linux-block-owner@vger.kernel.org
Subject: Re: [PATCH 05/15] Add io_uring IO interface
Date: Thu, 17 Jan 2019 16:19:43 +0100
Message-ID: <6a33592e2cbd2506ab77f148114997c3@suse.de> (raw)
In-Reply-To: <c3d902f9-06f8-9e9e-4dcf-ad09e4e291ae@kernel.dk>

On 2019-01-17 15:54, Jens Axboe wrote:
> On 1/17/19 7:34 AM, Roman Penyaev wrote:
>> On 2019-01-17 14:54, Jens Axboe wrote:
>>> On 1/17/19 5:02 AM, Roman Penyaev wrote:
>>>> Hi Jens,
>>>> 
>>>> On 2019-01-16 18:49, Jens Axboe wrote:
>>>> 
>>>> [...]
>>>> 
>>>>> +static void *io_mem_alloc(size_t size)
>>>>> +{
>>>>> +	gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN |
>>>>> __GFP_COMP
>>>>> |
>>>>> +				__GFP_NORETRY;
>>>>> +
>>>>> +	return (void *) __get_free_pages(gfp_flags, get_order(size));
>>>> 
>>>> Since these pages are shared between kernel and userspace, do we 
>>>> need
>>>> to care about d-cache aliasing on armv6 (or other "strange" archs
>>>> which I've never seen) with vivt or vipt cpu caches?
>>>> 
>>>> E.g. vmalloc_user() targets this problem by aligning kernel address
>>>> on SHMLBA, so no flush_dcache_page() is required.
>>> 
>>> I'm honestly not sure, it'd be trivial enough to stick a
>>> flush_dcache_page() into the few areas we'd need it. The rings are
>>> already page (SHMLBA) aligned.
>> 
>> For arm SHMLBA is not a page, it is 4x page.  So for userspace vaddr
>> which mmap() returns is aligned, but for kernel not.  So indeed
>> flush_dcache_page() should be used.
> 
> Oh indeed, my bad.
> 
>> The other question which I can't answer myself is the order of
>> flush_dcache_page() and smp_wmb().  Does flush_scache_page() implies
>> flush of the cpu write buffer?   Or firstly smp_wmb() should be done
>> in order to flush everything to cache.  Here is what arm spec says
>> about write-back cache:
>> 
>> "Writes that miss in the cache are placed in the write buffer and
>> appear on the AMBA ASB interface. The CPU continues execution as
>> soon as the write is placed in the write buffer."
>> 
>> So if you firstly do flush_dcache_page() will it flush write buffer?
>> Because it seems that firstly smp_wmb() and then flush_dcache_page(),
>> or I am going mad?
> 
> I don't think you're going mad! We'd first need smp_wmb() to order the
> writes, then the flush_dcache_page(). For filling the CQ ring, we'd 
> also
> need to flush the page the cqe belongs to.

Then this is the issue for aio.c as well.

> 
> Question is if we care enough about performance on vivt to do something
> about that. I know what my answer will be... If others care, they can
> incrementally improve upon that.

That's perfect answer!  May I reuse it? :) Because I expect same 
questions
(if someone cares) for my attempt to do uring for epoll, where I want 
rely
on vmalloc_user() and not to call flush_dcache_page() at all.


--
Roman





  reply index

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 17:49 [PATCHSET v5] " Jens Axboe
2019-01-16 17:49 ` [PATCH 01/15] fs: add an iopoll method to struct file_operations Jens Axboe
2019-01-16 17:49 ` [PATCH 02/15] block: wire up block device iopoll method Jens Axboe
2019-01-16 17:49 ` [PATCH 03/15] block: add bio_set_polled() helper Jens Axboe
2019-01-16 17:49 ` [PATCH 04/15] iomap: wire up the iopoll method Jens Axboe
2019-01-16 17:49 ` [PATCH 05/15] Add io_uring IO interface Jens Axboe
2019-01-17 12:02   ` Roman Penyaev
2019-01-17 13:54     ` Jens Axboe
2019-01-17 14:34       ` Roman Penyaev
2019-01-17 14:54         ` Jens Axboe
2019-01-17 15:19           ` Roman Penyaev [this message]
2019-01-17 12:48   ` Roman Penyaev
2019-01-17 14:01     ` Jens Axboe
2019-01-17 20:03       ` Jeff Moyer
2019-01-17 20:09         ` Jens Axboe
2019-01-17 20:14           ` Jens Axboe
2019-01-17 20:50             ` Jeff Moyer
2019-01-17 20:53               ` Jens Axboe
2019-01-17 21:02                 ` Jeff Moyer
2019-01-17 21:17                   ` Jens Axboe
2019-01-17 21:21                     ` Jeff Moyer
2019-01-17 21:27                       ` Jens Axboe
2019-01-18  8:23               ` Roman Penyaev
2019-01-16 17:49 ` [PATCH 06/15] io_uring: add fsync support Jens Axboe
2019-01-16 17:49 ` [PATCH 07/15] io_uring: support for IO polling Jens Axboe
2019-01-16 17:49 ` [PATCH 08/15] fs: add fget_many() and fput_many() Jens Axboe
2019-01-16 17:49 ` [PATCH 09/15] io_uring: use fget/fput_many() for file references Jens Axboe
2019-01-16 17:49 ` [PATCH 10/15] io_uring: batch io_kiocb allocation Jens Axboe
2019-01-16 17:49 ` [PATCH 11/15] block: implement bio helper to add iter bvec pages to bio Jens Axboe
2019-01-16 17:50 ` [PATCH 12/15] io_uring: add support for pre-mapped user IO buffers Jens Axboe
2019-01-16 20:53   ` Dave Chinner
2019-01-16 21:20     ` Jens Axboe
2019-01-16 22:09       ` Dave Chinner
2019-01-16 22:21         ` Jens Axboe
2019-01-16 23:09           ` Dave Chinner
2019-01-16 23:17             ` Jens Axboe
2019-01-16 22:13       ` Jens Axboe
2019-01-16 17:50 ` [PATCH 13/15] io_uring: add submission polling Jens Axboe
2019-01-16 17:50 ` [PATCH 14/15] io_uring: add file registration Jens Axboe
2019-01-16 17:50 ` [PATCH 15/15] io_uring: add io_uring_event cache hit information Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2019-01-10  2:43 [PATCHSET v2] io_uring IO interface Jens Axboe
2019-01-10  2:43 ` [PATCH 05/15] Add " Jens Axboe
2019-01-11 18:19   ` Martin K. Petersen
2019-01-11 18:34     ` Jens Axboe
2019-01-13 16:22       ` Jens Axboe
2019-01-15 17:31         ` Martin K. Petersen

Reply instructions:

You may reply publically 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=6a33592e2cbd2506ab77f148114997c3@suse.de \
    --to=rpenyaev@suse.de \
    --cc=avi@scylladb.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jmoyer@redhat.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-block-owner@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org linux-block@archiver.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/ public-inbox