mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@amd.com>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	nikunj@amd.com, willy@infradead.org, vbabka@suse.cz,
	david@redhat.com, akpm@linux-foundation.org, yuzhao@google.com,
	axboe@kernel.dk, viro@zeniv.linux.org.uk, brauner@kernel.org,
	jack@suse.cz, joshdon@google.com, clm@meta.com
Subject: Re: [RFC PATCH 0/1] Large folios in block buffered IO path
Date: Tue, 3 Dec 2024 10:31:48 +0530	[thread overview]
Message-ID: <b8422ee0-974c-43d8-9c1a-3e5e715fbd7d@amd.com> (raw)
In-Reply-To: <CAGudoHFSUoLXjEh8bvULXe2bysiW8S6yTcpgzCAgkuPuJxD6_Q@mail.gmail.com>

On 02-Dec-24 3:38 PM, Mateusz Guzik wrote:
> On Mon, Dec 2, 2024 at 10:37 AM Bharata B Rao <bharata@amd.com> wrote:
>>
>> On 28-Nov-24 10:01 AM, Mateusz Guzik wrote:
>>
>>> WIlly mentioned the folio wait queue hash table could be grown, you
>>> can find it in mm/filemap.c:
>>>     1062 #define PAGE_WAIT_TABLE_BITS 8
>>>     1063 #define PAGE_WAIT_TABLE_SIZE (1 << PAGE_WAIT_TABLE_BITS)
>>>     1064 static wait_queue_head_t folio_wait_table[PAGE_WAIT_TABLE_SIZE]
>>> __cacheline_aligned;
>>>     1065
>>>     1066 static wait_queue_head_t *folio_waitqueue(struct folio *folio)
>>>     1067 {
>>>     1068 │       return &folio_wait_table[hash_ptr(folio, PAGE_WAIT_TABLE_BITS)];
>>>     1069 }
>>>
>>> Can you collect off cpu time? offcputime-bpfcc -K > /tmp/out
>>
>> Flamegraph for "perf record --off-cpu -F 99 -a -g --all-kernel
>> --kernel-callchains -- sleep 120" is attached.
>>
>> Off-cpu samples were collected for 120s at around 45th minute run of the
>> FIO benchmark that actually runs for 1hr. This run was with kernel that
>> had your inode_lock fix but no changes to PAGE_WAIT_TABLE_BITS.
>>
>> Hopefully this captures the representative sample of the scalability
>> issue with folio lock.

Here is the data from offcputime-bpfcc -K run with inode_lock fix and no 
change to PAGE_WAIT_TABLE_BITS. This data was captured for the entire 
duration of FIO run (1hr). Since the data is huge, I am pasting a few 
relevant entries.

The first entry in the offcputime records

     finish_task_switch.isra.0
     schedule
     irqentry_exit_to_user_mode
     irqentry_exit
     sysvec_reschedule_ipi
     asm_sysvec_reschedule_ipi
     -                fio (33790)
         2

There are thousands of entries for read and write paths of FIO and I 
have shown only the first and last entries for the same here.

First entry for FIO read path that waits on folio_lock

     finish_task_switch.isra.0
     schedule
     io_schedule
     folio_wait_bit_common
     filemap_get_pages
     filemap_read
     blkdev_read_iter
     vfs_read
     ksys_read
     __x64_sys_read
     x64_sys_call
     do_syscall_64
     entry_SYSCALL_64_after_hwframe
     -                fio (34143)
         3381769535

Last entry for FIO read path that waits on folio_lock

     finish_task_switch.isra.0
     schedule
     io_schedule
     folio_wait_bit_common
     filemap_get_pages
     filemap_read
     blkdev_read_iter
     vfs_read
     ksys_read
     __x64_sys_read
     x64_sys_call
     do_syscall_64
     entry_SYSCALL_64_after_hwframe
     -                fio (34171)
         3516224519

First entry for FIO write path that waits on folio_lock

     finish_task_switch.isra.0
     schedule
     io_schedule
     folio_wait_bit_common
     __filemap_get_folio
     iomap_get_folio
     iomap_write_begin
     iomap_file_buffered_write
     blkdev_write_iter
     vfs_write
     ksys_write
     __x64_sys_write
     x64_sys_call
     do_syscall_64
     entry_SYSCALL_64_after_hwframe
     -                fio (33842)
         48900

Last entry for FIO write path that waits on folio_lock

     finish_task_switch.isra.0
     schedule
     io_schedule
     folio_wait_bit_common
     __filemap_get_folio
     iomap_get_folio
     iomap_write_begin
     iomap_file_buffered_write
     blkdev_write_iter
     vfs_write
     ksys_write
     __x64_sys_write
     x64_sys_call
     do_syscall_64
     entry_SYSCALL_64_after_hwframe
     -                fio (34187)
         1815993

The last entry in the offcputime records

     finish_task_switch.isra.0
     schedule
     futex_wait_queue
     __futex_wait
     futex_wait
     do_futex
     __x64_sys_futex
     x64_sys_call
     do_syscall_64
     entry_SYSCALL_64_after_hwframe
     -                multipathd (6308)
         3698877753

Regards,
Bharata.

  reply	other threads:[~2024-12-03  5:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27  5:47 Bharata B Rao
2024-11-27  5:47 ` [RFC PATCH 1/1] block/ioctl: Add an ioctl to enable large folios for " Bharata B Rao
2024-11-27  6:26   ` Christoph Hellwig
2024-11-27 10:37     ` Bharata B Rao
2024-11-28  5:43       ` Christoph Hellwig
2024-11-27  6:13 ` [RFC PATCH 0/1] Large folios in " Mateusz Guzik
2024-11-27  6:19   ` Mateusz Guzik
2024-11-27 12:02     ` Jan Kara
2024-11-27 12:13       ` Christian Brauner
2024-11-28  5:40       ` Ritesh Harjani
2024-11-27 12:18     ` Bharata B Rao
2024-11-27 12:28       ` Mateusz Guzik
2024-11-28  4:01         ` Bharata B Rao
2024-11-28  4:22           ` Matthew Wilcox
2024-11-28  4:37             ` Bharata B Rao
2024-11-28 11:23               ` Bharata B Rao
2024-11-28 23:31                 ` Mateusz Guzik
2024-11-29 10:32                   ` Bharata B Rao
2024-11-28  4:22           ` Mateusz Guzik
2024-11-28  4:31             ` Mateusz Guzik
2024-12-02  9:37               ` Bharata B Rao
2024-12-02 10:08                 ` Mateusz Guzik
2024-12-03  5:01                   ` Bharata B Rao [this message]
2024-11-28  4:43             ` Matthew Wilcox

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=b8422ee0-974c-43d8-9c1a-3e5e715fbd7d@amd.com \
    --to=bharata@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=clm@meta.com \
    --cc=david@redhat.com \
    --cc=jack@suse.cz \
    --cc=joshdon@google.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mjguzik@gmail.com \
    --cc=nikunj@amd.com \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=yuzhao@google.com \
    /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

all inboxes | Powered by JetHome®