public inbox for [email protected]
 help / color / mirror / Atom feed
From: Chenliang Li <[email protected]>
To: [email protected]
Cc: [email protected], [email protected],
	[email protected], [email protected],
	[email protected], [email protected],
	[email protected]
Subject: Re: [PATCH v2 3/4] io_uring/rsrc: add init and account functions for coalesced imus
Date: Mon, 13 May 2024 10:16:50 +0800	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Sat, 11 May 2024 10:48:18 -0600 Jens Axboe wrote:
> On 5/10/24 11:52 PM, Chenliang Li wrote:
>> This patch depends on patch 1 and 2.

> What does "patch 1 and 2" mean here, once it's in the git log? It
> doesn't really mean anything. It's quite natural for patches in a series
> to have dependencies on each other, eg patch 3 requirest 1 and 2.
> Highlighting it doesn't really add anything, so just get rid of that.

will delete that in V3.

>> +static int io_coalesced_buffer_account_pin(struct io_ring_ctx *ctx,
>> +					   struct page **pages,
>> +					   struct io_mapped_ubuf *imu,
>> +					   struct page **last_hpage,
>> +					   struct io_imu_folio_data *data)
>> +{
>> +	int i, j, ret;
>> +
>> +	imu->acct_pages = 0;
>> +	j = 0;
>> +	for (i = 0; i < data->nr_folios; i++) {
>> +		struct page *hpage = pages[j];
>> +
>> +		if (hpage == *last_hpage)
>> +			continue;
>> +		*last_hpage = hpage;
>> +		/*
>> +		 * Already checked the page array in try coalesce,
>> +		 * so pass in nr_pages=0 here to waive that.
>> +		 */
>> +		if (headpage_already_acct(ctx, pages, 0, hpage))
>> +			continue;
>> +		imu->acct_pages += data->nr_pages_mid;
>> +		j += (i == 0) ?
>> +			data->nr_pages_head : data->nr_pages_mid;
>
> Can we just initialize 'j' to data->nr_pages_head and change this to be:
>
>	if (i)
>		j += data->nr_pages_mid;

Yes, will change it in V3.

>> +	if (!imu->acct_pages)
>> +		return 0;
>> +
>> +	ret = io_account_mem(ctx, imu->acct_pages);
>> +	if (ret)
>> +		imu->acct_pages = 0;
>> +	return ret;
>> +}
>
>	ret = io_account_mem(ctx, imu->acct_pages);
>	if (!ret)
>		return 0;
>	imu->acct_pages = 0;
>	return ret;

Will change it.

>> +	if (ret) {
>> +		j = 0;
>> +		for (i = 0; i < data->nr_folios; i++) {
>> +			unpin_user_page(pages[j]);
>> +			j += (i == 0) ?
>> +				data->nr_pages_head : data->nr_pages_mid;
>> +		}
>> +		return ret;

> Same comment here.

Will change it.

  parent reply	other threads:[~2024-05-13  2:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240511055242epcas5p46612dde17997c140232207540e789a2e@epcas5p4.samsung.com>
2024-05-11  5:52 ` [PATCH v2 0/4] io_uring/rsrc: coalescing multi-hugepage registered buffers Chenliang Li
     [not found]   ` <CGME20240511055243epcas5p291fc5f72baf211a79475ec36682e170d@epcas5p2.samsung.com>
2024-05-11  5:52     ` [PATCH v2 1/4] io_uring/rsrc: add hugepage buffer coalesce helpers Chenliang Li
2024-05-11 16:43       ` Jens Axboe
     [not found]   ` <CGME20240511055245epcas5p407cdbc005fb5f0fe2d9bbb8da423ff28@epcas5p4.samsung.com>
2024-05-11  5:52     ` [PATCH v2 2/4] io_uring/rsrc: store folio shift and mask into imu Chenliang Li
     [not found]   ` <CGME20240511055247epcas5p2a54e23b6dddd11dda962733d259a10af@epcas5p2.samsung.com>
2024-05-11  5:52     ` [PATCH v2 3/4] io_uring/rsrc: add init and account functions for coalesced imus Chenliang Li
2024-05-11 16:48       ` Jens Axboe
     [not found]         ` <CGME20240513021656epcas5p2367b442e02b07e6405b857f98a4eff44@epcas5p2.samsung.com>
2024-05-13  2:16           ` Chenliang Li [this message]
     [not found]   ` <CGME20240511055248epcas5p287b7dfdab3162033744badc71fd084e1@epcas5p2.samsung.com>
2024-05-11  5:52     ` [PATCH v2 4/4] io_uring/rsrc: enable multi-hugepage buffer coalescing Chenliang Li
2024-05-11 16:49       ` Jens Axboe
2024-05-11 16:43   ` [PATCH v2 0/4] io_uring/rsrc: coalescing multi-hugepage registered buffers Jens Axboe
     [not found]     ` <CGME20240513020155epcas5p23699782b97749bfcce0511ce5378df3c@epcas5p2.samsung.com>
2024-05-13  2:01       ` Chenliang Li

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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