From: David Hildenbrand <david@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, linux-block@vger.kernel.org,
Muchun Song <muchun.song@linux.dev>,
Jane Chu <jane.chu@oracle.com>,
Andres Freund <andres@anarazel.de>
Subject: Re: Direct I/O performance problems with 1GB pages
Date: Mon, 27 Jan 2025 17:20:25 +0100 [thread overview]
Message-ID: <503c29c8-bcc7-4a6c-ab2e-ebf238a9a1db@redhat.com> (raw)
In-Reply-To: <f3710cc4-cbbf-4f1e-93a0-9eb6697df2d3@redhat.com>
On 27.01.25 17:09, David Hildenbrand wrote:
>>
>>> If the workload doing a lot of single-page try_grab_folio_fast(), could it
>>> do so on a larger area (multiple pages at once -> single refcount update)?
>>
>> Not really. This is memory that's being used as the buffer cache, so
>> every thread in your database is hammering on it and pulling in exactly
>> the data that it needs for the SQL query that it's processing.
>
> Ouch.
>
>>
>>> Maybe there is a link to the report you could share, thanks.
>>
>> Andres shared some gists, but I don't want to send those to a
>> mailing list without permission. Here's the kernel part of the
>> perf report:
>>
>> 14.04% postgres [kernel.kallsyms] [k] try_grab_folio_fast
>> |
>> --14.04%--try_grab_folio_fast
>> gup_fast_fallback
>> |
>> --13.85%--iov_iter_extract_pages
>> bio_iov_iter_get_pages
>> iomap_dio_bio_iter
>> __iomap_dio_rw
>> iomap_dio_rw
>> xfs_file_dio_read
>> xfs_file_read_iter
>> __io_read
>> io_read
>> io_issue_sqe
>> io_submit_sqes
>> __do_sys_io_uring_enter
>> do_syscall_64
BTW, two things that come to mind:
(1) We always fallback to GUP-fast, I wonder why. GUP-fast would go via
try_grab_folio_fast().
(2) During GUP slow, we must take the PT lock of the PUD table. So the
folio refcount/pincount/whatever is actually sync'ed by the ... PT lock
here?
See assert_spin_locked(pud_lockptr(mm, pudp)); in follow_huge_pud().
Note that that PUD table lock is likely a per-MM lock ... and yes, it
indeed is. We don't have split PUD locks.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-01-27 16:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 0:46 Direct I/O performance problems with 1GB pages Matthew Wilcox
2025-01-27 14:09 ` David Hildenbrand
2025-01-27 16:02 ` Matthew Wilcox
2025-01-27 16:09 ` David Hildenbrand
2025-01-27 16:20 ` David Hildenbrand [this message]
2025-01-27 16:56 ` Matthew Wilcox
2025-01-27 16:59 ` David Hildenbrand
2025-01-27 18:21 ` Andres Freund
2025-01-27 18:54 ` Jens Axboe
2025-01-27 19:07 ` David Hildenbrand
2025-01-27 21:32 ` Pavel Begunkov
2025-01-27 16:24 ` Keith Busch
2025-01-27 17:25 ` Andres Freund
2025-01-27 19:20 ` David Hildenbrand
2025-01-27 19:36 ` Andres Freund
2025-01-28 5:56 ` Christoph Hellwig
2025-01-28 9:47 ` David Hildenbrand
2025-01-29 6:03 ` Christoph Hellwig
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=503c29c8-bcc7-4a6c-ab2e-ebf238a9a1db@redhat.com \
--to=david@redhat.com \
--cc=andres@anarazel.de \
--cc=jane.chu@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--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;
as well as URLs for NNTP newsgroup(s).