public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: Mike Rapoport <rppt@kernel.org>, akpm@linux-foundation.org
Cc: david@kernel.org, ljs@kernel.org, Liam.Howlett@oracle.com,
	vbabka@kernel.org, surenb@google.com, mhocko@suse.com,
	shuah@kernel.org, aubaker@redhat.com, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/mm: skip hugetlb_dio tests when DIO alignment is incompatible
Date: Fri, 27 Mar 2026 17:39:57 +0800	[thread overview]
Message-ID: <acZQbTMiXctRPXII@redhat.com> (raw)
In-Reply-To: <acYs_-UOv72cmO-P@kernel.org>

> > --- a/tools/testing/selftests/mm/hugetlb_dio.c
> > +++ b/tools/testing/selftests/mm/hugetlb_dio.c
> > @@ -20,6 +20,31 @@
> >  #include "vm_util.h"
> >  #include "kselftest.h"
> >  
> > +#ifndef STATX_DIOALIGN
> > +#define STATX_DIOALIGN		0x00002000U
> > +#endif
> > +
> > +void check_dio_alignment(size_t pagesize)
> > +{
> > +	int fd;
> > +	struct statx stx;
> > +	unsigned int dio_align = 1;
> > +
> > +	fd = open("/tmp", O_TMPFILE | O_RDWR, 0664);
> > +	if (fd < 0)
> > +		ksft_exit_skip("Unable to allocate file: %s\n", strerror(errno));
> > +
> > +	if (statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 &&
> > +				(stx.stx_mask & STATX_DIOALIGN))
> > +		dio_align = stx.stx_dio_offset_align;
> > +
> > +	close(fd);
> > +
> > +	if ((pagesize / 2) % dio_align != 0)
> > +		ksft_exit_skip("DIO alignment (%u) incompatible with sub-page offset %lu\n",
> > +				dio_align, pagesize / 2);
> 
> This also needlessly skips the test with aligned offsets.
> 
> I'd suggest detecting dio_align here, passing it to run_dio_using_hugetlb()
> and moving the check that skips a test there.

Good point, as the first test case use 'pagesize * 3' is fully aligned
and would work fine. But apparently I overlooked that.

Also, Sashiko reminder few minor issues, which I would fix them in next
version as well.
  https://sashiko.dev/#/patchset/20260327031243.15903-1-liwang%40redhat.com

-- 
Regards,
Li Wang



  reply	other threads:[~2026-03-27  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  3:12 [PATCH] selftests/mm: skip hugetlb_dio tests when DIO alignment is incompatible Li Wang
2026-03-27  7:08 ` Mike Rapoport
2026-03-27  9:39   ` Li Wang [this message]
2026-03-27 18:22 ` Andrew Morton

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=acZQbTMiXctRPXII@redhat.com \
    --to=liwang@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=aubaker@redhat.com \
    --cc=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.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