public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: MANISH PANDEY <quic_mapa@quicinc.com>
To: Bart Van Assche <bvanassche@acm.org>,
	Qais Yousef <qyousef@layalina.io>,
	Christian Loehle <christian.loehle@arm.com>
Cc: <axboe@kernel.dk>, <mingo@kernel.org>, <peterz@infradead.org>,
	<vincent.guittot@linaro.org>, <dietmar.eggemann@arm.com>,
	<linux-block@vger.kernel.org>, <sudeep.holla@arm.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Christoph Hellwig <hch@infradead.org>, <kailash@google.com>,
	<tkjos@google.com>, <dhavale@google.com>, <bvanassche@google.com>,
	<quic_nitirawa@quicinc.com>, <quic_cang@quicinc.com>,
	<quic_rampraka@quicinc.com>, <quic_narepall@quicinc.com>
Subject: Re: Regarding patch "block/blk-mq: Don't complete locally if capacities are different"
Date: Thu, 8 Aug 2024 11:35:20 +0530	[thread overview]
Message-ID: <e2c19f3a-13b0-4e88-ba44-7674f3a1ea87@quicinc.com> (raw)
In-Reply-To: <17bf99ad-d64d-40ef-864f-ce266d3024c7@acm.org>



On 8/5/2024 11:22 PM, Bart Van Assche wrote:
> On 8/5/24 10:35 AM, MANISH PANDEY wrote:
>> In our SoC's we manage Power and Perf balancing by dynamically 
>> changing the IRQs based on the load. Say if we have more load, we 
>> assign UFS IRQs on Large cluster CPUs and if we have less load, we 
>> affine the IRQs on Small cluster CPUs.
> 
> I don't think that this is compatible with the command completion code
> in the block layer core. The blk-mq code is based on the assumption that
> the association of a completion interrupt with a CPU core does not
> change. See also the blk_mq_map_queues() function and its callers.
> 
IRQ <-> CPU bonded before the start of the operation and it makes sure 
that completion interrupt CPU doesn't change.

> Is this mechanism even useful? If completion interrupts are always sent 
> to the CPU core that submitted the I/O, no interrupts will be sent to
> the large cluster if no code that submits I/O is running on that
> cluster. Sending e.g. all completion interrupts to the large cluster can
> be achieved by migrating all processes and threads to the large cluster.
> 
 >> migrating all completion interrupts to the large cluster can
 >> be achieved by migrating all processes and threads to the large
 >> cluster.

Agree, this can be achieved, but then for this all the process and 
threads have to be migrated to large cluster and this will have power 
impacts. Hence to balance power and perf, it is not preferred way for 
vendors.

>> This issue is more affecting UFS MCQ devices, which usages ESI/MSI 
>> IRQs and have distributed ESI IRQs for CQs.
>> Mostly we use Large cluster CPUs for binding IRQ and CQ and hence 
>> completing more completions on Large cluster which won't be from same 
>> capacity CPU as request may be from S/M clusters.
> 
> Please use an approach that is supported by the block layer. I don't
> think that dynamically changing the IRQ affinity is compatible with the
> block layer.

For UFS with MCQ, ESI IRQs are bounded at the time of initialization.
so basically i would like to use High Performance cluster CPUs to 
migrate few completions from Mid clusters and take the advantage of high 
capacity CPUs. The new change takes away this opportunity from driver.
So basically we should be able to use High Performance CPUs like below

diff --git a/block/blk-mq.c b/block/blk-mq.c
index e3c3c0c21b55..a4a2500c4ef6 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1164,7 +1164,7 @@ static inline bool blk_mq_complete_need_ipi(struct 
request *rq)
         if (cpu == rq->mq_ctx->cpu ||
             (!test_bit(QUEUE_FLAG_SAME_FORCE, &rq->q->queue_flags) &&
              cpus_share_cache(cpu, rq->mq_ctx->cpu) &&
-            cpus_equal_capacity(cpu, rq->mq_ctx->cpu)))
+            arch_scale_cpu_capacity(cpu) >= 	 
arch_scale_cpu_capacity(rq->mq_ctx->cpu)))
                 return false;

This way driver can use best possible CPUs for it's use case.
> 
> Thanks,
> 
> Bart.
> 

  reply	other threads:[~2024-08-08  6:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 13:46 Regarding patch "block/blk-mq: Don't complete locally if capacities are different" MANISH PANDEY
2024-08-01  9:25 ` MANISH PANDEY
2024-08-01 16:05   ` Qais Yousef
2024-08-02  9:03 ` Christian Loehle
2024-08-05  2:07   ` Qais Yousef
2024-08-05 10:18     ` Christian Loehle
2024-08-05 17:24       ` MANISH PANDEY
2024-08-09  0:47         ` Qais Yousef
2024-08-09  0:23       ` Qais Yousef
2024-08-13 16:20         ` Christian Loehle
2024-09-01 17:25           ` Qais Yousef
2024-08-05 17:17     ` Bart Van Assche
2024-08-05 17:35       ` MANISH PANDEY
2024-08-05 17:52         ` Bart Van Assche
2024-08-08  6:05           ` MANISH PANDEY [this message]
2024-08-09  0:36             ` Qais Yousef
2024-08-11 17:41             ` Dietmar Eggemann
2024-08-12 18:15               ` Sandeep Dhavale
2024-08-21 12:29                 ` MANISH PANDEY
2024-08-21 17:22                   ` Bart Van Assche
2024-08-22 10:46                     ` MANISH PANDEY
2024-08-22 14:24                       ` Bart Van Assche
2024-08-23  7:57                         ` MANISH PANDEY
2024-08-23 12:03                           ` Christian Loehle
2024-08-23 13:49                             ` MANISH PANDEY
2024-08-23 14:12                               ` Bart Van Assche
2024-08-26 17:32                                 ` Christian Loehle
2024-09-01 17:13                   ` Qais Yousef
2024-08-09  0:28       ` Qais Yousef

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=e2c19f3a-13b0-4e88-ba44-7674f3a1ea87@quicinc.com \
    --to=quic_mapa@quicinc.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=bvanassche@google.com \
    --cc=christian.loehle@arm.com \
    --cc=dhavale@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hch@infradead.org \
    --cc=jaegeuk@kernel.org \
    --cc=kailash@google.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=quic_cang@quicinc.com \
    --cc=quic_narepall@quicinc.com \
    --cc=quic_nitirawa@quicinc.com \
    --cc=quic_rampraka@quicinc.com \
    --cc=qyousef@layalina.io \
    --cc=sudeep.holla@arm.com \
    --cc=tkjos@google.com \
    --cc=vincent.guittot@linaro.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