Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp470873ybc; Fri, 22 Nov 2019 08:04:16 -0800 (PST) X-Google-Smtp-Source: APXvYqybQyuKylcPgjdjghn8i5poyk/3JPCaKlewclonB0YGDsuyUqafjZykHWrQdkme5YPQapoH X-Received: by 2002:a05:651c:387:: with SMTP id e7mr13176188ljp.0.1574438656843; Fri, 22 Nov 2019 08:04:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574438656; cv=none; d=google.com; s=arc-20160816; b=Y623qIoykVvuCJ7zJPeVidZYa31QEid6o8yCf2lGcw1h9u40wzrXJEMHWlxnPTICqw aNjHzdLeOhWrQyKfDf5+BB/KwABT6DgzPr1nqR+H/v0mqnRn75eL5mnkH4IwW2D8yvNs HIzssB1AMsWf7iPhsyXa56Nq2FgZnAYQ1K1BRvWEw8XLHq/Ngjg0VZJrzuEl2GlEHNLT rGiQxeEvuTAg/J3wTf/R9UGiPuULmJkaqXGKZHsJh/JtTIVpr+krDByQ9E4vvD5k08eq fopYGutkVjrb/h64hy9NBmqWC+J+EeXotSB2E4UZ9ZGt3xBQdkNewyKw8HNfK+jIXMFL mz1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject; bh=8i6CzVMNFazng8TKHo+2bkvk6A3ga0Fj1OQEim5t8Xw=; b=lFbZMj7GGpYJiLClsaLcYzpBvEmHsglPMno8W6+He0bJ48hFdTLCboescsWkoeVYTm iqajSxot/LE6jWaAWomGmbV9MOoyjLVLromTI0SB6fh3juTRt5bm3OdkLJEWC1kqjQS7 to1v4SQNKSDDxfjOW6MNm4hW0/lrUdQz3t8HAXGKu220SK5KjkImQiZ6q4w3kMqOvMPo 2MDi0cPsPEMPIlIRhA/JxXCp5k/+T9YYCYuGk5GK+3YNq8b3mv+u7yuTXT0aghqrCF5D 1vuXp3gW91jWnb6s+rhpsjdd826Q6+rO3jmyah40YeeqoVgKDVT75OPnTCzeWjq4K8yf eEsA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gx4si4521968ejb.182.2019.11.22.08.03.51; Fri, 22 Nov 2019 08:04:16 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727188AbfKVQBq (ORCPT + 99 others); Fri, 22 Nov 2019 11:01:46 -0500 Received: from mga17.intel.com ([192.55.52.151]:7773 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbfKVQBq (ORCPT ); Fri, 22 Nov 2019 11:01:46 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2019 08:01:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,230,1571727600"; d="scan'208";a="408930168" Received: from linux.intel.com ([10.54.29.200]) by fmsmga006.fm.intel.com with ESMTP; 22 Nov 2019 08:01:45 -0800 Received: from [10.251.82.176] (abudanko-mobl.ccr.corp.intel.com [10.251.82.176]) by linux.intel.com (Postfix) with ESMTP id 0C86C58049B; Fri, 22 Nov 2019 08:01:42 -0800 (PST) Subject: Re: [PATCH v1 2/3] perf mmap: declare type for cpu mask of arbitrary length From: Alexey Budankov To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <26d1512a-9dea-bf7e-d18e-705846a870c4@linux.intel.com> <0c716b33-a91e-2972-637f-e7c3a187fa77@linux.intel.com> <20191122131513.GE17308@krava> <53af9c5c-a33d-4fc4-88e9-851b1caad3f1@linux.intel.com> Organization: Intel Corp. Message-ID: <61ce5a52-9c34-f936-b09b-f8f59cedcb66@linux.intel.com> Date: Fri, 22 Nov 2019 19:01:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <53af9c5c-a33d-4fc4-88e9-851b1caad3f1@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.11.2019 16:58, Alexey Budankov wrote: > On 22.11.2019 16:20, Jiri Olsa wrote: >> On Wed, Nov 20, 2019 at 12:37:48PM +0300, Alexey Budankov wrote: >>> >>> +#define mmap_cpu_mask_bytes(m) \ >> >> we try to have all macros upper case > > In v2. > >> >>> + (BITS_TO_LONGS(((struct mmap_cpu_mask *)m)->nbits) * sizeof(unsigned long)) >> >> we have BITS_TO_BYTES > > In v2. Avoided BITS_TO_BYTES() in this particular case because the storage is allocated in unsigned long chunks, thus the possibly unused tail bytes at the last chunk would be accounted in the returned size, and for compatibility with cpu_set_t which is also allocated in unsigned longs. ~Alexey