All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Kundan Kumar <kundan.kumar@samsung.com>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, willy@infradead.org,
	linux-block@vger.kernel.org, joshi.k@samsung.com,
	mcgrof@kernel.org, anuj20.g@samsung.com, nj.shetty@samsung.com,
	c.gameti@samsung.com, gost.dev@samsung.com
Subject: Re: [PATCH] block : add larger order folio size instead of pages
Date: Wed, 24 Apr 2024 18:52:46 +0530	[thread overview]
Message-ID: <20240424132246.7ny74cec7cvphg5i@green245> (raw)
In-Reply-To: <20240422111407.GA10989@lst.de>

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

On 22/04/24 01:14PM, Christoph Hellwig wrote:
>> +		folio = page_folio(page);
>> +
>> +		if (!folio_test_large(folio) ||
>> +		   (bio_op(bio) == REQ_OP_ZONE_APPEND)) {
>
>I don't understand why you need this branch.  All the arithmetics
>below should also work just fine for non-large folios

The branch helps to skip these calculations for zero order folio:
A) folio_offset = (folio_page_idx(folio, page) << PAGE_SHIFT) + offset;
B) folio_size(folio)

>, and there
>while the same_page logic in bio_iov_add_zone_append_page probablyg
>needs to be folio-ized first, it should be handled the same way here
>as well.

Regarding the same_page logic, if we add same page twice then we release
the page on second addition. It seemed to me that this logic will work even
if we merge large order folios. Please let me know if I am missing something.

If we pass a large size of folio to bio_iov_add_zone_append_page then we fail
early due queue_max_zone_append_sectors limit. This can be modified to add
lesser pages which are a part of bigger folio. Let me know if I shall proceed
this way or if it is fine not to add the entire folio.

>bio_iov_add_page should also be moved to take a folio
>before the (otherwise nice) changes here.

If we convert bio_iov_add_page() to bio_iov_add_folio()/bio_add_folio(),
we see a decline of about 11% for 4K I/O. When mTHP is enabled we may get
a large order folio even for a 4K I/O. The folio_offset may become larger
than 4K and we endup using expensive mempool_alloc during nvme_map_data in
NVMe driver[1].

[1]
static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
                struct nvme_command *cmnd)
{
...
...
                        if (bv.bv_offset + bv.bv_len <= NVME_CTRL_PAGE_SIZE * 2)
                                return nvme_setup_prp_simple(dev, req,
                                                             &cmnd->rw, &bv);
...
...
       iod->sgt.sgl = mempool_alloc(dev->iod_mempool, GFP_ATOMIC);
...
...
}

--
Kundan
>
>

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



  reply	other threads:[~2024-04-24 15:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240419092428epcas5p4f63759b0efa1f12dfbcf13c67fa8d0f0@epcas5p4.samsung.com>
2024-04-19  9:17 ` [PATCH] block : add larger order folio size instead of pages Kundan Kumar
2024-04-19 14:16   ` Matthew Wilcox
2024-04-22  9:44     ` Kundan Kumar
2024-04-22 11:14   ` Christoph Hellwig
2024-04-24 13:22     ` Kundan Kumar [this message]
2024-04-24 17:04       ` Keith Busch
2024-04-27  8:14       ` Christoph Hellwig
2024-04-24 16:16   ` Keith Busch

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=20240424132246.7ny74cec7cvphg5i@green245 \
    --to=kundan.kumar@samsung.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=c.gameti@samsung.com \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=joshi.k@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=nj.shetty@samsung.com \
    --cc=willy@infradead.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.