lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 05 May 2023 15:29:45 -0700
From:   Tim Chen <tim.c.chen@...ux.intel.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Ricardo Neri <ricardo.neri@...el.com>,
        "Ravi V . Shankar" <ravi.v.shankar@...el.com>,
        Ben Segall <bsegall@...gle.com>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Len Brown <len.brown@...el.com>, Mel Gorman <mgorman@...e.de>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Valentin Schneider <vschneid@...hat.com>,
        Ionela Voinescu <ionela.voinescu@....com>, x86@...nel.org,
        linux-kernel@...r.kernel.org,
        Shrikanth Hegde <sshegde@...ux.vnet.ibm.com>,
        Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
        naveen.n.rao@...ux.vnet.ibm.com,
        Yicong Yang <yangyicong@...ilicon.com>,
        Barry Song <v-songbaohua@...o.com>,
        Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Subject: Re: [PATCH 2/6] sched/fair: Check whether active load balance is
 needed in busiest group

On Fri, 2023-05-05 at 14:16 +0200, Peter Zijlstra wrote:
> 
> > +static inline bool asym_active_balance_busiest(struct lb_env *env, struct sd_lb_stats *sds)
> > +{
> > +	/*
> > +	 * Don't balance to a group without spare capacity.
> > +	 *
> > +	 * Skip non asymmetric sched group balancing. That check
> > +	 * is handled by code path handling imbalanced load between
> > +	 * similar groups.
> > +	 */
> > +	if (env->idle == CPU_NOT_IDLE ||
> > +	    sds->local_stat.group_type != group_has_spare ||
> > +	    !asymmetric_groups(sds->local, sds->busiest))
> > +		return false;
> > +
> > +	/*
> > +	 * For SMT source group, pull when there are two or more
> > +	 * tasks over-utilizing a core.
> > +	 */
> > +	if (sds->busiest->flags & SD_SHARE_CPUCAPACITY &&
> > +	    sds->busiest_stat.sum_h_nr_running > 1)
> > +		return true;
> > +
> > +	return false;
> > +}
> 
> This all seems to be mixing two 'asymmetric' things in the 'asym'
> namespace :/ One being the SD_ASYM_PACKING and then the above SMT/no-SMT
> core thing.

Yeah, I am kind of abusing the "asymmetric" word.  However, the above
code does try to set things up for the aysm_active_balance() code
later. Any suggestion on better names for "asymmetric_groups()" and
and "asym_active_balance_busiest()"? 

Perhaps "hybrid_groups()" and "hybrid_active_balance_busiest()"?

> 
> > +
> >  /**
> >   * calculate_imbalance - Calculate the amount of imbalance present within the
> >   *			 groups of a given sched_domain during load balance.
> > @@ -10164,6 +10200,12 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
> >  			return;
> >  		}
> >  
> > +		if (asym_active_balance_busiest(env, sds)) {
> > +			env->migration_type = migrate_task;
> > +			env->imbalance = 1;
> > +			return;
> > +		}
> > +
> >  		if (busiest->group_weight == 1 || sds->prefer_sibling) {
> >  			unsigned int nr_diff = busiest->sum_nr_running;
> >  			/*
> > @@ -10371,6 +10413,9 @@ static struct sched_group *find_busiest_group(struct lb_env *env)
> >  			 */
> >  			goto out_balanced;
> >  
> > +		if (asym_active_balance_busiest(env, &sds))
> > +			goto force_balance;
> > +
> >  		if (busiest->group_weight > 1 &&
> >  		    local->idle_cpus <= (busiest->idle_cpus + 1))
> >  			/*
> 
> All the cases here have a nice (CodingStyle busting) comment, perhaps
> add the missing {} when hou add the comment?

Sure, will add a comment here.

Tim

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ