From: Li Wang <liwang@redhat.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: akpm@linux-foundation.org, rppt@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, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v3] selftests/mm: skip hugetlb_dio tests when DIO alignment is incompatible
Date: Mon, 30 Mar 2026 15:23:08 +0800 [thread overview]
Message-ID: <acok3JY66OcV0Qab@redhat.com> (raw)
In-Reply-To: <a5b7add7-0507-40c0-a324-81f243ffa261@kernel.org>
On Mon, Mar 30, 2026 at 08:02:01AM +0200, David Hildenbrand (Arm) wrote:
> > /* Open the file to DIO */
>
> This comment is misleading as we are not opening "the" file, but we create a new one.
> See below, maybe we should clean that up.
+1
> > int main(void)
> > {
> > - size_t pagesize = 0;
> > - int fd;
> > + size_t pagesize = psize();
> > + unsigned int dio_align = get_dio_alignment();
>
> Both could be const.
+1
> Why can't we simply open the file once and pass the fd to run_dio_using_hugetlb()?
>
> fd = open("/tmp", O_TMPFILE | O_RDWR | O_DIRECT, 0664);
> if (fd < 0)
> ksft_exit_skip("Unable to allocate file: %s\n", strerror(errno));
> dio_align = get_dio_alignment(fd);
> if (dio_align <= 0)
> ksft_exit_skip("Unable to obtain DIO alignment: %s\n", strerror(errno));
Yes, apparently this is a good suggestion. Thanks!
--
Regards,
Li Wang
next prev parent reply other threads:[~2026-03-30 7:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 5:39 [PATCH v3] selftests/mm: skip hugetlb_dio tests when DIO alignment is incompatible Li Wang
2026-03-30 6:02 ` David Hildenbrand (Arm)
2026-03-30 7:23 ` Li Wang [this message]
2026-03-30 10:10 ` Li Wang
2026-03-30 10:43 ` David Hildenbrand (Arm)
2026-03-30 11:35 ` Li Wang
2026-03-30 11:57 ` Li Wang
2026-03-30 9:58 ` Li Wang
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=acok3JY66OcV0Qab@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-fsdevel@vger.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 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.