linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: John Hubbard <jhubbard@nvidia.com>, David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
	David Hildenbrand <david@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	Jeff Layton <jlayton@kernel.org>,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] iov_iter: Improve page extraction (pin or just list)
Date: Mon, 30 Jan 2023 15:11:39 -0700	[thread overview]
Message-ID: <088e40fd-3fc7-77dd-a3de-0a2b097d3717@kernel.dk> (raw)
In-Reply-To: <e68c5cab-c3a6-1872-98fa-9f909f23be79@nvidia.com>

On 1/30/23 3:02?PM, John Hubbard wrote:
> On 1/30/23 13:57, Jens Axboe wrote:
>>> This does cause about a 2.7% regression for me, using O_DIRECT on a raw
>>> block device. Looking at a perf diff, here's the top:
>>>
>>>                 +2.71%  [kernel.vmlinux]  [k] mod_node_page_state
>>>                 +2.22%  [kernel.vmlinux]  [k] iov_iter_extract_pages
>>>
>>> and these two are gone:
>>>
>>>       2.14%             [kernel.vmlinux]  [k] __iov_iter_get_pages_alloc
>>>       1.53%             [kernel.vmlinux]  [k] iov_iter_get_pages
>>>
>>> rest is mostly in the noise, but mod_node_page_state() sticks out like
>>> a sore thumb. They seem to be caused by the node stat accounting done
>>> in gup.c for FOLL_PIN.
>>
>> Confirmed just disabling the node_stat bits in mm/gup.c and now the
>> performance is back to the same levels as before.
>>
>> An almost 3% regression is a bit hard to swallow...
> 
> This is something that we say when adding pin_user_pages_fast(),
> yes. I doubt that I can quickly find the email thread, but we
> measured it and weren't immediately able to come up with a way
> to make it faster.
> 
> At this point, it's a good time to consider if there is any
> way to speed it up. But I wanted to confirm that you're absolutely
> right: the measurement sounds about right, and that's also the
> hotspot that we say, too.

From spending all of 5 minutes on this, it must be due to exceeding the
pcp stat_threashold, as we then end up doing two atomic_long_adds().
Looking at proc, looks like it's 108. And with this test, then we're
hitting that slow path ~80k/second. Uhm...

-- 
Jens Axboe



  reply	other threads:[~2023-01-30 22:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 11:14 David Howells
2023-01-30 21:33 ` Jens Axboe
2023-01-30 21:55   ` Jens Axboe
2023-01-30 21:57     ` Jens Axboe
2023-01-30 22:02       ` John Hubbard
2023-01-30 22:11         ` Jens Axboe [this message]
2023-01-30 22:12       ` David Howells
2023-01-30 22:15         ` Jens Axboe
2023-01-31  8:32           ` David Hildenbrand
2023-01-31 12:28             ` Jan Kara
2023-01-31 17:54               ` John Hubbard
2023-01-31 13:41           ` David Howells
2023-01-31 13:48             ` David Hildenbrand
2023-01-31 14:50               ` Jens Axboe
2023-01-31 15:02                 ` David Hildenbrand
2023-01-31 15:04                   ` Jens Axboe
2023-01-31 15:10                     ` David Hildenbrand
2023-01-31 15:15                       ` Jens Axboe
2023-01-30 21:52 ` David Howells

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=088e40fd-3fc7-77dd-a3de-0a2b097d3717@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=david@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=jlayton@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=logang@deltatee.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox