Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1704172imm; Sat, 23 Jun 2018 00:36:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIaUKE/3Krih61ZToBX0nSMfDT0oDioz7RY2agiSwctaa6q6coZRxRdqsKFaUpEDyQsaU39 X-Received: by 2002:a17:902:9f81:: with SMTP id g1-v6mr4527207plq.304.1529739391446; Sat, 23 Jun 2018 00:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529739391; cv=none; d=google.com; s=arc-20160816; b=AfQVFrwer1V0z3QQs/XH17PBM3mwyR8SJJk0/g7ZNmgmFperupJI7fIApXnsQRZmiL xFSXVHrjEptb3apK3SkSkEIAzGZEve4TvA30hPThXAm8XSji9V6FtUWBRZQzbDH6sAEN evqI0SvNg3TevJAYPFoVRvkW+ctyv34GIZXK8mdLnbISHoe/Q35taXb3EhCQZ2tK1Aup FzfSLtc/JjbeIqGl7VCGlvOLCKG6+iUcfYAdvAU+K0hZKcOUVAXmTx9iHbRzeErnYPd7 xHrzN13wpdWKaDuI//q2zGGkNuLha9lABNxtMR+jUBDl+P6x6dOa1BTUijHbYjeNv+2v +crw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=7m6/trLI3Mdrj6dyJBDfuDyPuGK9qBvqhtuR7tDqTzA=; b=FDqobKBH0u/GCqJ24dyvVhsO6DAsx4SP4nDxPt+j1TVd/yqFyMgmyYi6dqHzKIVsgN 8oM6gPUcg9DnVgkEntiomTI6TFDFGGiwMZAHef5Grw6zvO7S45QgAxlPdcZmM85ilyUI cLbby1hq9uB5fpD3X5c+DFiR33SGSoSfS3Gc5uZKWp71n5qZIdzIPt96gCI0BKkFKGO4 HH66wp7MN0+eBcdz56PG9BSsuLvg7DChcO8b6/ER1VVY+g8fpXlDLm2QO4kd6+NofuVI OBlQm8yPaZtUdxkbzFn8pbj9ECQvDpOTo0ULEm1EqrtjSJ8V93HMTD7uSNWOxFK2nhl7 eSMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=a3rj34yk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k14-v6si9594943pls.477.2018.06.23.00.36.14; Sat, 23 Jun 2018 00:36:31 -0700 (PDT) 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=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=a3rj34yk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751590AbeFWHff (ORCPT + 99 others); Sat, 23 Jun 2018 03:35:35 -0400 Received: from mail-bl2nam02on0062.outbound.protection.outlook.com ([104.47.38.62]:5237 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751537AbeFWHfd (ORCPT ); Sat, 23 Jun 2018 03:35:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7m6/trLI3Mdrj6dyJBDfuDyPuGK9qBvqhtuR7tDqTzA=; b=a3rj34ykMX43Ir5LIaEkrNnczX3kfn6mMiYLQuc0MS57+ZLuS3awgb3un6TF00h6wrNTfcX3AM4ECioJK+FQxU1cYajOvNxOIGbCnsDjFeR+f/Sckfmt+kk9FTL+Fl493odh+fGI1ZlgFfqw6hKziimufNC7oJl7aobgRhAr/Rw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (50.233.148.156) by BN7PR07MB4370.namprd07.prod.outlook.com (2603:10b6:406:b5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Sat, 23 Jun 2018 07:35:26 +0000 From: Yury Norov To: Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Kate Stewart , Matthew Wilcox , Philippe Ombredanne , David Ahern , David Carrillo-Cisneros , Andi Kleen , Jin Yao , linux-kernel@vger.kernel.org Cc: Yury Norov , Andy Shevchenko , Dmitry Torokhov , Andrew Morton , Mike Snitzer Subject: [PATCH 1/2] perf: drop unneeded bitmap_zero() in util/header.c Date: Sat, 23 Jun 2018 10:35:01 +0300 Message-Id: <20180623073502.16321-1-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: AM5PR0701CA0024.eurprd07.prod.outlook.com (2603:10a6:203:51::34) To BN7PR07MB4370.namprd07.prod.outlook.com (2603:10b6:406:b5::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81ffdb32-4f55-443f-033d-08d5d8dbe535 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:BN7PR07MB4370; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4370;3:dvcrT3sNkbVUtyhuaTyiAOSi14wbOjZu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9M3HWwvYabauBRPoES1IHum6CF6kADMdzJX4e/eXdMGLJ2QCVW3oDKArtnEGVQtBYodCSct5EztATzKemgAY/EgnrDZsuuMH5Rv+GBtH/d0VW4d3wdRVY813E0tfaJA9VAIP0jfrPCT8n8LciNsj+rZ/lDyJItks2tOVnT25NfYfZpwGVJw7aXEtL38p16yL6jPprXyETa5Z+CHqJtIoPfIOLiyNPEXZcVCIsMWcqGWFSW5hKuNlxbp9syJF0H27ttexcGMTwscLN5Z8zAPmSb70UXDQ7Fp8q5UjQR0fQiikiFkZkp355fNomhq+K7IqCder6AJvSRShaie4fe7hT5v+C+duTNFMhRGJqITgSZN66nJh3JMitoAw1I088y2fz/3o665QlF5WjppSu23Fm4QrxJF/ktxDPn0iRqZ0U=;4:I++qPCkGzJpDntcamPWH2iM3a7SA0H2Jl6gmAaarUn7zxW425Ogzqee09XIe/5AkJdXKIO0gdqz207wHs8AIW+d0sCc9hGGQ546FeRuydG0E/REvx9T4YXf4do7k7heRlxul/r9RWOPujHr6+p6s8tqs7iSROzhb90x8CFaiqzouZDFVxnvgA4K6AG4/2+9GWkOjXAHQHCkJfEMTFyxHGyotDafIjYJsoUS5fC04VUFOTiaYilKCSe7cIuNoSlOxXEhyRAInBqOFcxsthdp5qA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:BN7PR07MB4370;BCL:0;PCL:0;RULEID:;SRVR:BN7PR07MB4370; X-Forefront-PRVS: 07126E493C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(979002)(6069001)(39850400004)(346002)(396003)(376002)(366004)(39380400002)(189003)(199004)(36756003)(52116002)(386003)(186003)(16526019)(316002)(2906002)(7736002)(478600001)(6486002)(956004)(72206003)(5660300001)(2616005)(305945005)(7416002)(966005)(51416003)(48376002)(47776003)(50466002)(16586007)(6496006)(54906003)(105586002)(42882007)(26005)(106356001)(97736004)(110136005)(6666003)(66066001)(76506005)(3846002)(81166006)(68736007)(6306002)(53936002)(81156014)(476003)(8936002)(50226002)(25786009)(486006)(39060400002)(8676002)(4326008)(1076002)(6116002)(921003)(1121003)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB4370;H:localhost;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN7PR07MB4370;23:2DpQ9L9Q0isq3I+Ryev37woTRysNpZ4RDp+guLckG?= =?us-ascii?Q?oOBfFO+vbSYrgq1rdU2K/gn05YHeylVJwCEvCRxREtb88geahBMYZsUnke7J?= =?us-ascii?Q?AoacY0Tfq0NG+WAdOl3AwRxn8qFHJajqV4lBvlyVIIjzG89VnzgKt2yG0e2d?= =?us-ascii?Q?9eDlmKjGRCsadZsQQZmL+PyfbAsob5JszTn5hHjijSlzht5NVWtgkrxWItQB?= =?us-ascii?Q?DIRDiNrVQT/k1C+wmKKivgDifDdWJbOm68Cb1sH1lSGjtVieBz4LmM0EbznQ?= =?us-ascii?Q?Avhz3L/V+DaWFotWLUfsbW49bX17Do+J2rptE07C5D+Z0+vgfCW11+8JA28p?= =?us-ascii?Q?eRqHL8G93/SWRRxBEeap6PxE0nHK2EcWju548IHtYqh3HsoWzGtK3QDuZKSa?= =?us-ascii?Q?QOz5mteBdwCC76WQk1ife3Atz+QDrR1V02Hcc5XJasDt0eVbqkXq5A/rbcaq?= =?us-ascii?Q?9S/cThYbWL0lZvs9wn39IIJVku5f6rw/bvoG3Px2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Za3RHyMtwpRoaeNEwMrpZZFSnELCriaOS/FgCVGX?= =?us-ascii?Q?y5lRL7eRg=3D=3D?= X-Microsoft-Antispam-Message-Info: ghsGD67sfis03hIpZb6BEkB//Le6t0K//Av+BNEiru6U5NIMt0bdDo1AWomumo4IcWYmimMCjTKA5ffVbpOkOiAHupsOTKnaPgoO2+n6B+wKlD9Klbg5kLFTxZc8K12LCQWmuTM++B823sfBcVm2PbkvcVBquOe9MslBfe/ag/YAHDkSODtnA5NMtuotLhxjAKxtyZPk0T4Qijq+xoYUI2zksvmih3NigCPIGydXvU8T8j4rsMHbOnXipyHFwwhGoEW7DWXAJC1XEMaR+kqGVZ1ooj/sddIw+lPcwErOPwKtrBCUMXSFqu79pAAvsFbc7qyw84gL+SqHo1gm6p57IA== X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4370;6:mEtcLMOheijUfH3TjY66Dq7jgeFG5BrkkZtZ6d/RMPhAiqvWopbY7G2DORjGbC/cUAJkdbV/0KRACahM6XHwqo6hl7lsxsZhpPdgLfZ5sDHQx0UhalINmzBDW1THHoICfh6qJzn2UM9spMuAsJIMZdjDUBZZOnT+CTcuQV6zU3Kcd4YIM89+JS3XuctlyiV4/LLo/5xhwiX/R3p94uEMNsDw/FvKCkqDK2I/LiVM+nLv6DzLqlmrrdlZjYgdZO6upR42M+kg27ActPRU4tlK8omB+Z8vCxf55SZLXTK7/41sopRqWia0R+JqRhWv3OqRPssIMElhTqkxz4Fy6vm7+ywThIBBHpkUck3+GynXONygeewGcfGCWaaoY0R9pEhnVjPQtbC6uK2Aw85auJRXxhV7+5AVAYize90r7IYz1BOBwGrfNCpgHivFH5ma/LPulYazxyjhkayKaC5k63g1nA==;5:dh/hgteiFyCdrd1n/j0C6nSLcA32IMD7RLPuWIzI63FF6rIZgMFTEMD8HyAvh2pB7Zmtu1nroVbE9kreKGdXtWMPO5yEFlmwK+tcuml4dekROxou6kJr9EEAoyJ0XF4DZ2fTno+m7LMEvneHMeUJt17BVOhTX+2H0YBEX1Q8seE=;24:2H/3RyBDUqUZBXKHKuuRTDdkmwjzktdV8ZFOP4HRWUk/fJUvEoVK4+O9/z5RmPXZxxg2sr5rl1SfJ5H2tt4o+z69KRlLXYvjptCjj9UWEYQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4370;7:4lx/Gmghm4QuBqam/cRuWULKzhRqv3wKqF1abXmWGX5hP9lrDLNCDAdXKGDzDEjPG2U1HyfBrAYF6YxKIkzaE+Km76fSG8Q1gMy+wZXl5lpcvTxCRISo1oyPE9UE2zwYjA1ZXMa6JLHTmgEFlp9kVQmqgyNBZEdnq6zq25KGAQSsupdiP0EvdHafB/uIIxZJStDcazfN6AmGxVe3c3SjDL3X9cQ02loWD3cwQzbXDj8x4exLYQqjd43H7Bf6Pw5L X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2018 07:35:26.0700 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81ffdb32-4f55-443f-033d-08d5d8dbe535 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4370 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On top of next-20180622. bitmap_zero() is called after bitmap_alloc() in perf code. But bitmap_alloc() internally uses calloc() which guarantees that allocated area is zeroed. So following bitmap_zero is unneeded. Drop it. This happened because of confusing name for bitmap allocator. It should has name bitmap_zalloc instead of bitmap_alloc. This series: https://lkml.org/lkml/2018/6/18/841 introduces new API for bitmap allocations in kernel, and functions there are named correctly. Following patch propogates the API to tools, and fixes naming issue. Signed-off-by: Yury Norov --- tools/perf/tests/bitmap.c | 2 -- tools/perf/tests/mem2node.c | 5 +---- tools/perf/util/header.c | 3 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/perf/tests/bitmap.c b/tools/perf/tests/bitmap.c index 47bedf25ba69..96e7fc1ad3f9 100644 --- a/tools/perf/tests/bitmap.c +++ b/tools/perf/tests/bitmap.c @@ -16,8 +16,6 @@ static unsigned long *get_bitmap(const char *str, int nbits) bm = bitmap_alloc(nbits); if (map && bm) { - bitmap_zero(bm, nbits); - for (i = 0; i < map->nr; i++) set_bit(map->map[i], bm); } diff --git a/tools/perf/tests/mem2node.c b/tools/perf/tests/mem2node.c index 0c3c87f86e03..d8e3d49d3638 100644 --- a/tools/perf/tests/mem2node.c +++ b/tools/perf/tests/mem2node.c @@ -24,11 +24,8 @@ static unsigned long *get_bitmap(const char *str, int nbits) bm = bitmap_alloc(nbits); if (map && bm) { - bitmap_zero(bm, nbits); - - for (i = 0; i < map->nr; i++) { + for (i = 0; i < map->nr; i++) set_bit(map->map[i], bm); - } } if (map) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 540cd2dcd3e7..3a6bec22baa3 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -279,8 +279,6 @@ static int do_read_bitmap(struct feat_fd *ff, unsigned long **pset, u64 *psize) if (!set) return -ENOMEM; - bitmap_zero(set, size); - p = (u64 *) set; for (i = 0; (u64) i < BITS_TO_U64(size); i++) { @@ -1285,7 +1283,6 @@ static int memory_node__read(struct memory_node *n, unsigned long idx) return -ENOMEM; } - bitmap_zero(n->set, size); n->node = idx; n->size = size; -- 2.17.1