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]
Message-ID: <9253783d-d53f-9587-61eb-2505bca5fc0c@arm.com>
Date:   Fri, 7 Dec 2018 20:20:24 +0000
From:   Valentin Schneider <valentin.schneider@....com>
To:     Steve Sistare <steven.sistare@...cle.com>, mingo@...hat.com,
        peterz@...radead.org
Cc:     subhra.mazumdar@...cle.com, dhaval.giani@...cle.com,
        daniel.m.jordan@...cle.com, pavel.tatashin@...rosoft.com,
        matt@...eblueprint.co.uk, umgwanakikbuti@...il.com,
        riel@...hat.com, jbacik@...com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, quentin.perret@....com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 03/10] sched/topology: Provide cfs_overload_cpus bitmap

Hi Steve,

On 06/12/2018 21:28, Steve Sistare wrote:
[...]
> @@ -1621,7 +1626,22 @@ static void __sdt_free(const struct cpumask *cpu_map)
>  
>  static int sd_llc_alloc(struct sched_domain *sd)
>  {
> -	/* Allocate sd->shared data here. Empty for now. */
> +	struct sched_domain_shared *sds = sd->shared;
> +	struct cpumask *span = sched_domain_span(sd);
> +	int nid = cpu_to_node(cpumask_first(span));
> +	int flags = __GFP_ZERO | GFP_KERNEL;
> +	struct sparsemask *mask;
> +
> +	/*
> +	 * Allocate the bitmap if not already allocated.  This is called for
> +	 * every CPU in the LLC but only allocates once per sd_llc_shared.
> +	 */
> +	if (!sds->cfs_overload_cpus) {
> +		mask = sparsemask_alloc_node(nr_cpu_ids, 3, flags, nid);
                                             ^^^^^^^^^^ ^^^
                                                 (1)    (2)

(1): Is this necessary? Wouldn't cpumask_weight(span) suffice?

(2): Could this get a name somewhere? In v3 this was
SPARSEMASK_DENSITY_DEFAULT, I think it'd make sense to have it in
sched/sparsemask.c

> +		if (!mask)
> +			return 1;
> +		sds->cfs_overload_cpus = mask;
> +	}
>  
>  	return 0;
>  }
> @@ -1633,7 +1653,8 @@ static void sd_llc_free(struct sched_domain *sd)
>  	if (!sds)
>  		return;
>  
> -	/* Free data here. Empty for now. */
> +	sparsemask_free(sds->cfs_overload_cpus);
> +	sds->cfs_overload_cpus = NULL;
>  }
>  
>  static int sd_llc_alloc_all(const struct cpumask *cpu_map, struct s_data *d)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ