public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Haiyue Wang <haiyuewa@163.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH liburing v1] zcrx: Get the page size at runtime
Date: Sat, 19 Apr 2025 09:12:53 -0600	[thread overview]
Message-ID: <debd0318-2d0c-4e0e-80c0-b47acbf93987@kernel.dk> (raw)
In-Reply-To: <20250419133819.7633-1-haiyuewa@163.com>

On 4/19/25 7:38 AM, Haiyue Wang wrote:
> Use the API `sysconf()` to query page size at runtime, instead of using
> hard code number 4096.

This is v2, no? It's customary to include a "changes since the last
version" when posting a v2. JFYI.

> @@ -329,7 +329,13 @@ static void parse_opts(int argc, char **argv)
>  
>  int main(int argc, char **argv)
>  {
> -	parse_opts(argc, argv);
> +	page_size = sysconf(_SC_PAGESIZE);
> +	if (page_size < 0) {
> +		perror("sysconf(_SC_PAGESIZE)");
> +		return 1;
> +	}
> +
> +        parse_opts(argc, argv);

Whitespace damage here, it's using spaces rather than tabs.

Outside of that, I think this looks fine. liburing helpers should
probably have something for this going forward, so every test that uses
the correct page size (or still hardcodes 4096...) would get it right
without needing to know about this. But that's beyond the scope of this
change.

-- 
Jens Axboe

  reply	other threads:[~2025-04-19 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-19 13:38 [PATCH liburing v1] zcrx: Get the page size at runtime Haiyue Wang
2025-04-19 15:12 ` Jens Axboe [this message]
2025-04-19 16:51   ` Haiyue 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=debd0318-2d0c-4e0e-80c0-b47acbf93987@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=haiyuewa@163.com \
    --cc=io-uring@vger.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