From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7461CC433F5 for ; Fri, 7 Oct 2022 23:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbiJGXal (ORCPT ); Fri, 7 Oct 2022 19:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229798AbiJGXa3 (ORCPT ); Fri, 7 Oct 2022 19:30:29 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0582D3740D for ; Fri, 7 Oct 2022 16:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665185428; x=1696721428; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=PNssUzBwhqhEAhtMVzvvKKGAbRzvhWqeld2MLSjq8Fc=; b=Jeu8UaeTsi3/Lhs2BHu/zaGhmC/ljUanGThhr6BRhCujDHcCr4YLoQjX EwWg625tRFb1ShLF/+D/hQJcRqBZWx1Fxr7mMAVBRG2sgGGeo2DebcW2t OxLg/pit7grf94dxX5s8EPOzvaCdzya7Jw5BUBDA15OWa2TlJiYuy+Ja3 N1zDyvGmIfKzeNvzCjbr+CXxT0WB92G+uXLWJHertGmCGq7eOJtN3IPNu RceJl11Kpuee+sIZ6WDXN2Unl6cuHzJqIzn5B0vcnvdg/PaqzGOY+eUOt z3kiDZPQ13xzHWWIUDKpqTCygFpa/oXrrSC07g8+hPErMx3l5Rn+UMRWz w==; X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="302584626" X-IronPort-AV: E=Sophos;i="5.95,168,1661842800"; d="scan'208";a="302584626" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2022 16:30:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="603053334" X-IronPort-AV: E=Sophos;i="5.95,168,1661842800"; d="scan'208";a="603053334" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga006.jf.intel.com with ESMTP; 07 Oct 2022 16:30:27 -0700 Date: Fri, 7 Oct 2022 16:36:58 -0700 From: Ricardo Neri To: Peter Zijlstra Cc: Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org, "Tim C . Chen" Subject: Re: [RFC PATCH 10/23] sched/fair: Use classes of tasks when selecting a busiest runqueue Message-ID: <20221007233658.GA6555@ranerica-svr.sc.intel.com> References: <20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com> <20220909231205.14009-11-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 27, 2022 at 01:25:57PM +0200, Peter Zijlstra wrote: > On Fri, Sep 09, 2022 at 04:11:52PM -0700, Ricardo Neri wrote: > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 7368a0b453ee..085b1f75d90b 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -10009,6 +10009,7 @@ static struct rq *find_busiest_queue(struct lb_env *env, > > int i; > > > > for_each_cpu_and(i, sched_group_span(group), env->cpus) { > > + int busiest_class_delta_score = INT_MIN; > > You sure you want to break ties toward a negative IPC 'improvement' ? Yes. We may have a negative IPC class delta if the destination CPU has lower prioriy than the CPUs in the busiest group. This may occur when the busiest group is a core with more than one busy SMT sibling. > > > unsigned long capacity, load, util; > > unsigned int nr_running; > > enum fbq_type rt; > > @@ -10118,6 +10119,20 @@ static struct rq *find_busiest_queue(struct lb_env *env, > > if (busiest_nr < nr_running) { > > busiest_nr = nr_running; > > busiest = rq; > > + } else if (sched_task_classes_enabled() && > > + busiest_nr == nr_running) { > > + int curr_class_delta_score; > > + > > + curr_class_delta_score = arch_get_task_class_score(rq->curr->class, > > + env->dst_cpu) - > > + arch_get_task_class_score(rq->curr->class, > > + cpu_of(rq)); > > *sigh*, you really couldn't find a more ugly layout if you tried. > > Perhaps use less than novella length identifiers? Sure, I will revisit the naming of the identifiers. Thanks and BR, Ricardo