[v2,0/2] sched: blk: Handle HMP systems when completing IO

Message ID 20240223155749.2958009-1-qyousef@layalina.io
Headers
Series sched: blk: Handle HMP systems when completing IO |

Message

Qais Yousef Feb. 23, 2024, 3:57 p.m. UTC
  Due to recent changes in how topology is represented on asymmetric multi
processing systems like big.LITTLE where all cpus share the last LLC, there is
a performance regression as cpus with different compute capacities appear under
the same LLC and we no longer send an IPI when the requester is running on
a different cluster with different compute capacity.

Restore the old behavior by adding a new cpus_equal_capacity() function to help
check for the new condition for these systems.

Changes since v1:

	* Split the patch per subsystem.
	* Convert cpus_gte_capacity() to cpus_equal_capacity()
	* Make cpus_equal_capacity() return immediately for SMP systems.

Qais Yousef (2):
  sched: Add a new function to compare if two cpus have the same
    capacity
  block/blk-mq: Don't complete locally if capacities are different

 block/blk-mq.c                 |  5 +++--
 include/linux/sched/topology.h |  6 ++++++
 kernel/sched/core.c            | 11 +++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
  

Comments

Shrikanth Hegde Feb. 24, 2024, 1:43 p.m. UTC | #1
On 2/23/24 9:27 PM, Qais Yousef wrote:
> Due to recent changes in how topology is represented on asymmetric multi
> processing systems like big.LITTLE where all cpus share the last LLC, there is
> a performance regression as cpus with different compute capacities appear under
> the same LLC and we no longer send an IPI when the requester is running on
> a different cluster with different compute capacity.
> 
> Restore the old behavior by adding a new cpus_equal_capacity() function to help
> check for the new condition for these systems.
> 
> Changes since v1:
> 
> 	* Split the patch per subsystem.
> 	* Convert cpus_gte_capacity() to cpus_equal_capacity()
> 	* Make cpus_equal_capacity() return immediately for SMP systems.
> 

nit: Did you mean !SMP systems here? 
Because in changes i see its returning true directly if its in !CONFIG_SMP path. 

> Qais Yousef (2):
>   sched: Add a new function to compare if two cpus have the same
>     capacity
>   block/blk-mq: Don't complete locally if capacities are different
> 
>  block/blk-mq.c                 |  5 +++--
>  include/linux/sched/topology.h |  6 ++++++
>  kernel/sched/core.c            | 11 +++++++++++
>  3 files changed, 20 insertions(+), 2 deletions(-)
>
  
Jens Axboe Feb. 24, 2024, 7:48 p.m. UTC | #2
On Fri, 23 Feb 2024 15:57:47 +0000, Qais Yousef wrote:
> Due to recent changes in how topology is represented on asymmetric multi
> processing systems like big.LITTLE where all cpus share the last LLC, there is
> a performance regression as cpus with different compute capacities appear under
> the same LLC and we no longer send an IPI when the requester is running on
> a different cluster with different compute capacity.
> 
> Restore the old behavior by adding a new cpus_equal_capacity() function to help
> check for the new condition for these systems.
> 
> [...]

Applied, thanks!

[1/2] sched: Add a new function to compare if two cpus have the same capacity
      commit: b361c9027b4e4159e7bcca4eb64fd26507c19994
[2/2] block/blk-mq: Don't complete locally if capacities are different
      commit: af550e4c968294398fc76b075f12d51c76caf753

Best regards,
  
Qais Yousef Feb. 24, 2024, 11:12 p.m. UTC | #3
On 02/24/24 19:13, Shrikanth Hegde wrote:
> 
> 
> On 2/23/24 9:27 PM, Qais Yousef wrote:
> > Due to recent changes in how topology is represented on asymmetric multi
> > processing systems like big.LITTLE where all cpus share the last LLC, there is
> > a performance regression as cpus with different compute capacities appear under
> > the same LLC and we no longer send an IPI when the requester is running on
> > a different cluster with different compute capacity.
> > 
> > Restore the old behavior by adding a new cpus_equal_capacity() function to help
> > check for the new condition for these systems.
> > 
> > Changes since v1:
> > 
> > 	* Split the patch per subsystem.
> > 	* Convert cpus_gte_capacity() to cpus_equal_capacity()
> > 	* Make cpus_equal_capacity() return immediately for SMP systems.
> > 
> 
> nit: Did you mean !SMP systems here? 
> Because in changes i see its returning true directly if its in !CONFIG_SMP path. 

I was referring to this hunk

+       if (!sched_asym_cpucap_active())
+               return true;

in cpus_equal_capacity(). In SMP system the condition is always true and
there's a static key that tells us if the system is asymmetric.

> 
> > Qais Yousef (2):
> >   sched: Add a new function to compare if two cpus have the same
> >     capacity
> >   block/blk-mq: Don't complete locally if capacities are different
> > 
> >  block/blk-mq.c                 |  5 +++--
> >  include/linux/sched/topology.h |  6 ++++++
> >  kernel/sched/core.c            | 11 +++++++++++
> >  3 files changed, 20 insertions(+), 2 deletions(-)
> >