Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chi Zhiling <chizhiling@163.com>
To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Cc: Hugh Dickins <hughd@google.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>, Zi Yan <ziy@nvidia.com>,
	"Liam R. Howlett" <liam@infradead.org>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>, Chi Zhiling <chizhiling@kylinos.cn>
Subject: [RFC PATCH 0/4] mm/shmem: optimize read performance with folio batching
Date: Fri, 15 May 2026 17:46:58 +0800	[thread overview]
Message-ID: <20260515094702.1092355-1-chizhiling@163.com> (raw)

From: Chi Zhiling <chizhiling@kylinos.cn>

This series optimizes shmem read performance by implementing folio
batching in the read path and eliminating unnecessary lock operations.

Performance testing with fio:
(--ioengine=sync --rw=read --size=1G --runtime=120)

shmem (THP disabled):
  bs=1M:   11.4 GiB/s
  bs=64k:  11.1 GiB/s
  bs=4k:   3814 MiB/s

shmem (THP disabled) + fbatch:
  bs=1M:   12.8 GiB/s (+12%)
  bs=64k:  12.3 GiB/s (+11%)
  bs=4k:   3783 MiB/s (-0.8%)

shmem (THP enabled):
  bs=1M:   13.8 GiB/s
  bs=64k:  13.1 GiB/s
  bs=4k:   3851 MiB/s

shmem (THP enabled) + fbatch:
  bs=1M:   14.0 GiB/s (+1%)
  bs=64k:  13.4 GiB/s (+2%)
  bs=4k:   3811 MiB/s (-1%)

shmem preallocated via fallocate (THP disabled):
  bs=1M:   24.0 GiB/s
  bs=64k:  22.5 GiB/s
  bs=4k:   4670 MiB/s

shmem preallocated via fallocate (THP disabled) + fbatch:
  bs=1M:   29.3 GiB/s (+22%)
  bs=64k:  26.7 GiB/s (+19%)
  bs=4k:   4654 MiB/s (-0.3%)

shmem preallocated via fallocate (THP enabled):
  bs=1M:   24.0 GiB/s
  bs=64k:  22.9 GiB/s
  bs=4k:   4698 MiB/s

shmem preallocated via fallocate (THP enabled) + fbatch:
  bs=1M:   34.3 GiB/s (+43%)
  bs=64k:  31.5 GiB/s (+38%)
  bs=4k:   4689 MiB/s (-0.2%)


Chi Zhiling (4):
  mm/shmem: add SGP_GET to get unlocked folio
  mm/shmem: use SGP_GET in read operations
  mm/shmem: optimize file read with folio batching
  mm/shmem: make SGP_NOALLOC succeed on hole like SGP_READ

 include/linux/shmem_fs.h |   5 +-
 mm/khugepaged.c          |   2 +-
 mm/shmem.c               | 132 ++++++++++++++++++++++++++++++++-------
 3 files changed, 112 insertions(+), 27 deletions(-)

-- 
2.43.0



             reply	other threads:[~2026-05-15  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15  9:46 Chi Zhiling [this message]
2026-05-15  9:46 ` [RFC PATCH 1/4] mm/shmem: add SGP_GET to get unlocked folio Chi Zhiling
2026-05-15  9:47 ` [RFC PATCH 2/4] mm/shmem: use SGP_GET in read operations Chi Zhiling
2026-05-15  9:47 ` [RFC PATCH 3/4] mm/shmem: optimize file read with folio batching Chi Zhiling
2026-05-15  9:47 ` [RFC PATCH 4/4] mm/shmem: make SGP_NOALLOC succeed on hole like SGP_READ Chi Zhiling

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=20260515094702.1092355-1-chizhiling@163.com \
    --to=chizhiling@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=chizhiling@kylinos.cn \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=npache@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=willy@infradead.org \
    --cc=ziy@nvidia.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