Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1133095ybl; Tue, 3 Dec 2019 02:13:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwMF3pmC29GIUjzgM8fjRWaggdA4Fp2+X+MXwChbKGOQm8twkLw0qnlfIONqTJowM7zySq6 X-Received: by 2002:aca:ec45:: with SMTP id k66mr2966378oih.179.1575368024697; Tue, 03 Dec 2019 02:13:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575368024; cv=none; d=google.com; s=arc-20160816; b=SVDz9JuBrxDI5XtmXdOMb2HCTF5B3H4ztMsz9oH8giwz54Ed1NA02/xq4ceBaYLYCj I5+gCkZnDa32vvix7Yhsqd/IrkPuXqjm4x6xl2QlMft+PtH6TLXr8S84s8fAxFawq+Sf Oikfrf0dXV0uBvNASGkm1/SMi3IFrXlJ/hH1OwdDWX9Sfj3iX9ksfntD7n5CzM3f89Zn kwuAswKC7tIi2P9gt5ck6J1mTaFCAI1BMVNEIT9yJfIsbTx+4cQVpYG6rxbXpBVtM9Hy 7V9uYty6y94ekqaqnkexjsXozzJeP1E4LCeJzZB00q3D9U1nHaY4W3rOT1lJ125leKNY DaFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FtLx/oy4d5o//447y5luMsN0TKhrHJ0OoWvKUE0g2sc=; b=ziMnxes/82H49t9lMlaPzkK1VVSoXddMeMxX4ucJ4zPuKARZ3kv46Fjvx1EYhZCixE Frz8LqM5difRJAScycG03SyYn8Gyw3bhTttI7sfW9fHq9Q6tAZhGZ7iEPOJJUn3Vvuus muOEVk9/jQSIzJW0v+6JIm8NpU97mzOxETYUHQ+eGbbfyNb4wP4deXnGpezSbSiSAMSh FRVfSFsx655yXNAZowCtu7IBOiND5a0HqVFYTsB7gb0q1EaKsG/w4oFeVGtipP7LNZTS 0eiz9nddJHlpt7hu7tJVG2FFTJMyHnA+DZl6JKubcXZloUbn1oXgZwJsTHpK2OnC/B8D 6Wzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KwyB7r+E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si522725otq.275.2019.12.03.02.13.31; Tue, 03 Dec 2019 02:13:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KwyB7r+E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726144AbfLCKNB (ORCPT + 99 others); Tue, 3 Dec 2019 05:13:01 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:54022 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725773AbfLCKNA (ORCPT ); Tue, 3 Dec 2019 05:13:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575367979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FtLx/oy4d5o//447y5luMsN0TKhrHJ0OoWvKUE0g2sc=; b=KwyB7r+E1TGGqqsR8ZLeTvLuKHSU7XMZcE0n77axe6bjWqU3Rkj2bJzy+/gg850nHqZsrt SME9OxPXH1n3YVB5UBb0/eQo/dP5JSF+aHjh2U/v3C4R6/smo43PyuL2k9fPVtJOVOWV3Z Q514P0D+S8fRIdp5rzFeDZ85JOfNs2M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-243-X5C5DFFTPjWSBlFI11PdpQ-1; Tue, 03 Dec 2019 05:12:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9EF1C8017DF; Tue, 3 Dec 2019 10:12:54 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with SMTP id 04EAF5DA2C; Tue, 3 Dec 2019 10:12:52 +0000 (UTC) Date: Tue, 3 Dec 2019 11:12:52 +0100 From: Jiri Olsa To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v4 3/3] perf record: adapt affinity to machines with #CPUs > 1K Message-ID: <20191203101252.GD17468@krava> References: <2095b034-bf53-c374-0e34-adc006b00fbb@linux.intel.com> MIME-Version: 1.0 In-Reply-To: <2095b034-bf53-c374-0e34-adc006b00fbb@linux.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: X5C5DFFTPjWSBlFI11PdpQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 02, 2019 at 09:58:48AM +0300, Alexey Budankov wrote: SNIP > =20 > -static void build_node_mask(int node, cpu_set_t *mask) > +static void build_node_mask(int node, struct mmap_cpu_mask *mask) > { > =09int c, cpu, nr_cpus; > =09const struct perf_cpu_map *cpu_map =3D NULL; > @@ -240,17 +242,23 @@ static void build_node_mask(int node, cpu_set_t *ma= sk) > =09for (c =3D 0; c < nr_cpus; c++) { > =09=09cpu =3D cpu_map->map[c]; /* map c index to online cpu index */ > =09=09if (cpu__get_node(cpu) =3D=3D node) > -=09=09=09CPU_SET(cpu, mask); > +=09=09=09set_bit(cpu, mask->bits); > =09} > } > =20 > -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) > { > -=09CPU_ZERO(&map->affinity_mask); > +=09map->affinity_mask.nbits =3D cpu__max_cpu(); > +=09map->affinity_mask.bits =3D bitmap_alloc(map->affinity_mask.nbits); > +=09if (!map->affinity_mask.bits) > +=09=09return -1; hum, this one should be also behind (rec->opts.affinity !=3D PERF_AFFINITY_= SYS) condition, right? sry I haven't noticed that before.. other than that it looks all good thanks, jirka