lkml.org 
[lkml]   [2019]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 3/3] perf record: adapt affinity to machines with #CPUs > 1K
On Mon, Dec 02, 2019 at 09:58:48AM +0300, Alexey Budankov wrote:

SNIP

>
> -static void build_node_mask(int node, cpu_set_t *mask)
> +static void build_node_mask(int node, struct mmap_cpu_mask *mask)
> {
> int c, cpu, nr_cpus;
> const struct perf_cpu_map *cpu_map = NULL;
> @@ -240,17 +242,23 @@ static void build_node_mask(int node, cpu_set_t *mask)
> for (c = 0; c < nr_cpus; c++) {
> cpu = cpu_map->map[c]; /* map c index to online cpu index */
> if (cpu__get_node(cpu) == node)
> - CPU_SET(cpu, mask);
> + set_bit(cpu, mask->bits);
> }
> }
>
> -static void perf_mmap__setup_affinity_mask(struct mmap *map, struct mmap_params *mp)
> +static int perf_mmap__setup_affinity_mask(struct mmap *map, struct mmap_params *mp)
> {
> - CPU_ZERO(&map->affinity_mask);
> + map->affinity_mask.nbits = cpu__max_cpu();
> + map->affinity_mask.bits = bitmap_alloc(map->affinity_mask.nbits);
> + if (!map->affinity_mask.bits)
> + return -1;

hum, this one should be also behind (rec->opts.affinity != PERF_AFFINITY_SYS)
condition, right? sry I haven't noticed that before..

other than that it looks all good

thanks,
jirka

\
 
 \ /
  Last update: 2019-12-03 11:13    [W:0.062 / U:38.172 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site