Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1780539imm; Sat, 18 Aug 2018 04:27:12 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzYWZqPsp346eDPIRQ1VYyq8MmjjKpyB/FAXtiTiGKw/J/5B68+YBm4GKfBJdGwweytRGee X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr36672322plb.99.1534591632314; Sat, 18 Aug 2018 04:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534591632; cv=none; d=google.com; s=arc-20160816; b=fjHKtil7OTkhdcyRDCUFwlQFXGAqqUDS0qJocqTHEZmRn89N1BwrxwtMxL5T1E1ZXZ 0N+/8qmsPiI19QbhLlgV1Wf3s0yAJQSba4yKlA/lRIYU6X4O4yI8Gy3a/qeA5Nj8YKgF JqC9mtzh4veD/XKu5rcFf3J1y8hwQ5US43mqeatfz2BjGdLE6Z8W/RDFK7KJBO7XOTf6 HeOpaK3BcN1VCMYjJ9ilk6rtqKMADAfMT1H89Yqjla0nPTm6uMMYUGcWxlR1q7YyJ4Ew A3HrBbTVa+bEm+DYSEJ2UMbvTXxmhUMMIGidrMJ/S2nOpH2WILhLnmLPZOnCJhgDV03m vkrg== 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:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=6JrF9XhSw9/EhU6v55guxbQtVdlfhekRqDNDUAvGYBc=; b=uxifUqMT+hX/wo3Ep8HozDK4/n5WKJg1Yj1bZuSLUUjpDYBcZWUfxqZ0neJSxqLy6s 6tXfvcVNVaLDXnJH83OlLI9AFOitVVvblCBJ41QkgklCc+FoMtMo484VIaYyHXzcI8Gj QnRw/xBKoevuiUmgmjVmBS3e/2rCCZF8TSG0pioxjEpcKLtadcjgba2kWhTfMjUVrkdF kEuSQpPxoSDg9MkflLXNVXZ+8HiM7lIZTARWh/A4bkg1HSDw9gm3NwGYHp7yQStGPgmY mWjYwbeHg7KPMK0hSpNVIGfxYIwiJK4MoxZqZo3IS2A1CE7/h7XVSFLJxlN7HjxoywOR eTPQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h126-v6si4161308pgc.429.2018.08.18.04.26.57; Sat, 18 Aug 2018 04:27:12 -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; 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 S1726441AbeHROcn (ORCPT + 99 others); Sat, 18 Aug 2018 10:32:43 -0400 Received: from terminus.zytor.com ([198.137.202.136]:40719 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726272AbeHROcn (ORCPT ); Sat, 18 Aug 2018 10:32:43 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w7IBOktk1285516 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 18 Aug 2018 04:24:46 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w7IBOkpj1285513; Sat, 18 Aug 2018 04:24:46 -0700 Date: Sat, 18 Aug 2018 04:24:46 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Yury Norov Message-ID: Cc: linux-kernel@vger.kernel.org, namhyung@kernel.org, akpm@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, acme@redhat.com, alexander.shishkin@linux.intel.com, peterz@infradead.org, willy@infradead.org, kstewart@linuxfoundation.org, pombredanne@nexb.com, ak@linux.intel.com, yao.jin@linux.intel.com, dsahern@gmail.com, andriy.shevchenko@linux.intel.com, davidcc@google.com, dmitry.torokhov@gmail.com, snitzer@redhat.com, hpa@zytor.com, ynorov@caviumnetworks.com, jolsa@redhat.com Reply-To: mingo@kernel.org, alexander.shishkin@linux.intel.com, acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, namhyung@kernel.org, akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, davidcc@google.com, dmitry.torokhov@gmail.com, snitzer@redhat.com, ynorov@caviumnetworks.com, jolsa@redhat.com, hpa@zytor.com, willy@infradead.org, peterz@infradead.org, pombredanne@nexb.com, kstewart@linuxfoundation.org, ak@linux.intel.com, yao.jin@linux.intel.com, dsahern@gmail.com In-Reply-To: <20180623073502.16321-1-ynorov@caviumnetworks.com> References: <20180623073502.16321-1-ynorov@caviumnetworks.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf tools: Drop unneeded bitmap_zero() calls Git-Commit-ID: 3c8b81864080b710bdce446fd8401923f26fc4d4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 3c8b81864080b710bdce446fd8401923f26fc4d4 Gitweb: https://git.kernel.org/tip/3c8b81864080b710bdce446fd8401923f26fc4d4 Author: Yury Norov AuthorDate: Sat, 23 Jun 2018 10:35:01 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 8 Aug 2018 15:55:44 -0300 perf tools: Drop unneeded bitmap_zero() calls 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 a 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 Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Morton Cc: Andriy Shevchenko Cc: David Ahern Cc: David Carrillo-Cisneros Cc: Dmitry Torokhov Cc: Jin Yao Cc: Jiri Olsa Cc: Kate Stewart Cc: Matthew Wilcox Cc: Mike Snitzer Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Philippe Ombredanne Link: http://lkml.kernel.org/r/20180623073502.16321-1-ynorov@caviumnetworks.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/bitmap.c | 2 -- tools/perf/tests/mem2node.c | 2 -- tools/perf/util/header.c | 3 --- 3 files changed, 7 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..9e9e4d37cc77 100644 --- a/tools/perf/tests/mem2node.c +++ b/tools/perf/tests/mem2node.c @@ -24,8 +24,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/util/header.c b/tools/perf/util/header.c index 5af58aac91ad..5f1af7b07b96 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;