All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: linux-block@vger.kernel.org, osandov@osandov.com, kch@nvidia.com
Subject: Re: [PATCH blktests] Fix _get_page_size()
Date: Sat, 20 Jun 2026 10:26:36 +0900	[thread overview]
Message-ID: <ajXmBu9lDZwgMG7_@shinmob> (raw)
In-Reply-To: <x497bnvlxlc.fsf@segfault.usersys.redhat.com>

CC+: Omar, Chaitanya,

On Jun 18, 2026 / 10:41, Jeff Moyer wrote:
> There is no CONFIG_PAGE_SHIFT stored in /boot/config-`uname -r` on RHEL
> systems (maybe all systems?).  As a result, tests that make use of
> _get_page_size() were doing the wrong thing.  For example, throtl/002
> used it to calculate I/O sizes for direct IO.  Those sizes ended up not
> being a multiple of the logical block size, and hence throtl/002 was
> failing.
> 
> Fixes: 8eca9fa ("common/rc, scsi/011, zbd/010: introduce _page_size_equals() helper")
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

Thanks for finding this out. When I applied the commit in the Fixes tag, I had
checked my Fedora system's /boot/config-* files and had found CONFIG_PAGE_SHIFT
defined. I wanted to avoid the dependency to getconf, and chose the way to rely
on CONFIG_PAGE_SHIFT. But that is not an option for other distros. Today I
checked my Debian system, and CONFIG_PAGE_SHIFT was not defined either. Now I
see that we should not use CONFIG_PAGE_SHIFT.

> 
> diff --git a/common/rc b/common/rc
> index 20f7c7a..d60a125 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -562,13 +562,8 @@ _have_systemctl_unit() {
>  	return 0
>  }
>  
> -# Get system page size from kernel conguration
>  _get_page_size() {
> -	local page_shift
> -
> -	page_shift=$(_get_kernel_option PAGE_SHIFT)
> -
> -	echo $((1<< page_shift))
> +	getconf PAGE_SIZE
>  }
>  
>  # Check if the system page size matches the required size (in bytes).
> 

The patch above should work, but it creates a new dependeny on the tool getconf.
There are 6 test cases that require page size and getconf. Then, we need to
check that getconf command is available for the test cases.

  $ git grep _page_size
  common/rc:_get_page_size() {
  common/rc:# Example: _page_size_equals 4096
  common/rc:_page_size_equals() {
  common/rc:      current_size=$(_get_page_size)
  tests/scsi/011: _page_size_equals 4096
  tests/throtl/002:       page_size=$(_get_page_size)
  tests/throtl/003:       page_size=$(_get_page_size)
  tests/throtl/007:       page_size=$(_get_page_size)
  tests/zbd/010:  _page_size_equals 4096
  tests/zbd/014:  page_size=$(_get_page_size)

Havind said that, I think now Linux eco-system is in the phase to add variety
of page sizes, and I expect more test cases that depend on page sizes will be
added in near future. So, this could be the good timing to add getconf to the
blktests minimal requirement list described in README.md. This means that
blktests users will need to install glibc-common package for Fedora, or
libc-bin package for Debian.

This is a rather fundamental change, so I would like to ask opinions from
other blktests users, especially Omar and Chaitanya. What do you think about
the idea to add getconf to the requirement list?

  reply	other threads:[~2026-06-20  1:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 14:41 [PATCH blktests] Fix _get_page_size() Jeff Moyer
2026-06-20  1:26 ` Shin'ichiro Kawasaki [this message]
2026-06-20  3:55   ` Bart Van Assche
2026-06-20  4:51     ` Shin'ichiro Kawasaki
2026-06-20  7:11       ` Bart Van Assche

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=ajXmBu9lDZwgMG7_@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=jmoyer@redhat.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@osandov.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.