public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Nitesh Shetty <nj.shetty@samsung.com>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH 2/3] io_uring/rsrc: clean up io_coalesce_buffer()
Date: Mon, 21 Apr 2025 17:20:57 +0530	[thread overview]
Message-ID: <20250421115057.mr43ociu7erpohhj@ubuntu> (raw)
In-Reply-To: <ad698cddc1eadb3d92a7515e95bb13f79420323d.1745083025.git.asml.silence@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]

On 19/04/25 06:47PM, Pavel Begunkov wrote:
>We don't need special handling for the first page in
>io_coalesce_buffer(), move it inside the loop.
>
>Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
>---
> io_uring/rsrc.c | 47 ++++++++++++++++++++++-------------------------
> 1 file changed, 22 insertions(+), 25 deletions(-)
>
>diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
>index 40061a31cc1f..21613e6074d4 100644
>--- a/io_uring/rsrc.c
>+++ b/io_uring/rsrc.c
>@@ -685,37 +685,34 @@ static bool io_coalesce_buffer(struct page ***pages, int *nr_pages,
> 				struct io_imu_folio_data *data)
> {
> 	struct page **page_array = *pages, **new_array = NULL;
>-	int nr_pages_left = *nr_pages, i, j;
>-	int nr_folios = data->nr_folios;
>+	unsigned nr_pages_left = *nr_pages;
>+	unsigned nr_folios = data->nr_folios;
>+	unsigned i, j;
checkpatch.pl complains about just "unsigned", "unsigned int" is preferred.

>
> 	/* Store head pages only*/
>-	new_array = kvmalloc_array(nr_folios, sizeof(struct page *),
>-					GFP_KERNEL);
>+	new_array = kvmalloc_array(nr_folios, sizeof(struct page *), GFP_KERNEL);
Not sure whether 80 line length is preferred in uring subsystem, if yes
then this breaks it.

--Nitesh Shetty

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2025-04-21 12:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-19 17:47 [PATCH 0/3] registrered buffer coalescing cleanup Pavel Begunkov
2025-04-19 17:47 ` [PATCH 1/3] io_uring/rsrc: use unpin_user_folio Pavel Begunkov
2025-04-21  2:37   ` Anuj gupta
2025-04-19 17:47 ` [PATCH 2/3] io_uring/rsrc: clean up io_coalesce_buffer() Pavel Begunkov
2025-04-21  2:38   ` Anuj gupta
     [not found]   ` <CGME20250421115925epcas5p18c9a46be72b98c089dc1833befc4d06d@epcas5p1.samsung.com>
2025-04-21 11:50     ` Nitesh Shetty [this message]
2025-04-21 14:50       ` Jens Axboe
2025-04-19 17:47 ` [PATCH 3/3] io_uring/rsrc: remove null check on import Pavel Begunkov
2025-04-21 11:13 ` [PATCH 0/3] registrered buffer coalescing cleanup Jens Axboe

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=20250421115057.mr43ociu7erpohhj@ubuntu \
    --to=nj.shetty@samsung.com \
    --cc=asml.silence@gmail.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