public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] blk-mq: optimize the size of struct request
@ 2023-07-07  9:37 chengming.zhou
  2023-07-07  9:37 ` [PATCH v3 1/4] blk-mq: delete unused completion_data in " chengming.zhou
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: chengming.zhou @ 2023-07-07  9:37 UTC (permalink / raw)
  To: axboe, ming.lei, hch, tj; +Cc: linux-block, linux-kernel, zhouchengming

From: Chengming Zhou <zhouchengming@bytedance.com>

v3:
 - Collect Reviewed-by tags from Ming and Christoph. Thanks!
 - Remove the list and csd variables which are only used once.
 - Fix a bug report of blktests nvme/012 by re-initialization of
   rq->queuelist, which maybe corrupted by rq->rq_next reuse.
 - [v2] https://lore.kernel.org/all/20230629110359.1111832-1-chengming.zhou@linux.dev/

v2:
 - Change to use call_single_data_t, which use __aligned() to avoid
   to use 2 cache lines for 1 csd. Thanks Ming Lei.
 - [v1] https://lore.kernel.org/all/20230627120854.971475-1-chengming.zhou@linux.dev/

Hello,

After the commit be4c427809b0 ("blk-mq: use the I/O scheduler for
writes from the flush state machine"), rq->flush can't reuse rq->elv
anymore, since flush_data requests can go into io scheduler now.

That increased the size of struct request by 24 bytes, but this
patchset can decrease the size by 40 bytes, which is good I think.

patch 1 is just cleanup by the way.

patch 2 use percpu csd to do remote complete instead of per-rq csd,
decrease the size by 24 bytes.

patch 3-4 reuse rq->queuelist in flush state machine pending list,
and maintain unsigned long counter of inflight flush_data requests,
decrease the size by 16 bytes.

Thanks for comments!

Chengming Zhou (4):
  blk-mq: delete unused completion_data in struct request
  blk-mq: use percpu csd to remote complete instead of per-rq csd
  blk-flush: count inflight flush_data requests
  blk-flush: reuse rq queuelist in flush state machine

 block/blk-flush.c      | 24 ++++++++++++++----------
 block/blk-mq.c         | 12 ++++++------
 block/blk.h            |  5 ++---
 include/linux/blk-mq.h | 10 ++--------
 4 files changed, 24 insertions(+), 27 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-10  6:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07  9:37 [PATCH v3 0/4] blk-mq: optimize the size of struct request chengming.zhou
2023-07-07  9:37 ` [PATCH v3 1/4] blk-mq: delete unused completion_data in " chengming.zhou
2023-07-07 10:05   ` Ming Lei
2023-07-07  9:37 ` [PATCH v3 2/4] blk-mq: use percpu csd to remote complete instead of per-rq csd chengming.zhou
2023-07-10  6:42   ` Christoph Hellwig
2023-07-07  9:37 ` [PATCH v3 3/4] blk-flush: count inflight flush_data requests chengming.zhou
2023-07-07  9:37 ` [PATCH v3 4/4] blk-flush: reuse rq queuelist in flush state machine chengming.zhou
2023-07-07 10:06   ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox