Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1049451imm; Wed, 4 Jul 2018 10:31:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpei/34P2Q4t9/CGT1WyPbRXifGkrP+iDf5uioIu7jo3a+WLuwdEiGYP07/A2y15CWMHhPp4 X-Received: by 2002:a63:1a49:: with SMTP id a9-v6mr2737347pgm.423.1530725462171; Wed, 04 Jul 2018 10:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530725462; cv=none; d=google.com; s=arc-20160816; b=dBOHfzJcz6AcfaRkaNYdij4BUUvIh56z8jBs+JD4zWUF6+A4phhx0agxJT3S8g7XfX CAwjHh868KIC9M0dGEOBDyphhRVAnMMojgJctpuCPW84XsQgxY3ajGEdXNlOlheUYQEw F427cxweXvm3r7SoCjexRLPcutf3JuYml2RrwKSYCEj2tYIoV7xbt3IcU1nkkLDbj2xN 96YT6UdbzSqnLD92gBU21skLK/r50/Z9aT0s7PYlHn+KJkHSx+L89FoT2jE+5dGwQ/QX ryKmmXghpqok0aAt/awNeYFa3OQOEYY7gkjy60q6tngWnbwe07FkHGFI1UIYLTzWZ9YZ cOkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=NNospwWfZBS6eqRdRdhY6/K73KL73jJZk2Tm4wJ0bTQ=; b=ydUcyjfwjvLIDuH5hx78LhxFWiz0Yc+e4dMQiVHV5cJ3H8vHE2mmA5jTOAZnMbjcH6 ZIJJd1CVUlx5vcVeRc7SaB0/RbYUAa8RWFfVYqNUJjn4Ywq4SN6idrHttrYW/LcSc3sC i57z+KL5KHLfNzgR9Q/sBRc33nYaowDkKjcptMSVnwNGsWOCQtdWIhJpKR+xxuMAGdeS tQEJn6ztt9Uh4kgxEtNAWVHW/NM4j2ipBss8fyZ8En/w10N+GX+sDaYg48Mh/m7bagDY H6CuD8z4QYRieFYaOJAYgRt0al+hMRYYJJxEeRyoor3O50Ot5QjZdOfzaLryWdT/AdiX DwuA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26-v6si3790706pgo.169.2018.07.04.10.30.47; Wed, 04 Jul 2018 10:31:02 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752709AbeGDRaK (ORCPT + 99 others); Wed, 4 Jul 2018 13:30:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50632 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752165AbeGDRaJ (ORCPT ); Wed, 4 Jul 2018 13:30:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C082668801; Wed, 4 Jul 2018 17:30:08 +0000 (UTC) Received: from krava (unknown [10.43.17.196]) by smtp.corp.redhat.com (Postfix) with SMTP id 20F9F2026D76; Wed, 4 Jul 2018 17:30:06 +0000 (UTC) Date: Wed, 4 Jul 2018 19:30:05 +0200 From: Jiri Olsa To: Yury Norov Cc: Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Kate Stewart , Matthew Wilcox , Philippe Ombredanne , David Ahern , David Carrillo-Cisneros , Andi Kleen , Jin Yao , linux-kernel@vger.kernel.org, Andy Shevchenko , Dmitry Torokhov , Andrew Morton , Mike Snitzer Subject: Re: [PATCH 2/2] bitmap: sync tools with new bitmap allocation API Message-ID: <20180704173005.GF19164@krava> References: <20180623073502.16321-1-ynorov@caviumnetworks.com> <20180623073502.16321-2-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180623073502.16321-2-ynorov@caviumnetworks.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 04 Jul 2018 17:30:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 04 Jul 2018 17:30:08 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 23, 2018 at 10:35:02AM +0300, Yury Norov wrote: > On top of next-20180622 and Andy Shevchenko series: > https://lkml.org/lkml/2018/6/18/841 > > The series mentioned above introduces helpers for bitmap allocation. > tools/ has its own bitmap_alloc() which differs from bitmap_alloc() > proposed in new kernel API, and is equivalent to bitmap_zalloc(). > In this series tools is switched to new API. > > This is RFC because I didn't find counterpart free() call to some > bitmap_zalloc()'s. So I didn't convert them to bitmap_free(). Could > someone point me out? The functions are: > setup_nodes(); > do_read_bitmap(); // Free is called, but only in fail path. > memory_node__read(); > > Signed-off-by: Yury Norov > --- > tools/include/linux/bitmap.h | 19 +++++++++++++++---- > tools/perf/builtin-c2c.c | 10 +++++----- > tools/perf/tests/bitmap.c | 4 ++-- > tools/perf/tests/mem2node.c | 4 ++-- > tools/perf/util/header.c | 6 +++--- > 5 files changed, 27 insertions(+), 16 deletions(-) > > diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h > index 48c208437bbd..b9b85b94c937 100644 > --- a/tools/include/linux/bitmap.h > +++ b/tools/include/linux/bitmap.h > @@ -98,12 +98,23 @@ static inline int test_and_set_bit(int nr, unsigned long *addr) > } > > /** > - * bitmap_alloc - Allocate bitmap > - * @nbits: Number of bits > + * Allocation and deallocation of bitmap. > */ > -static inline unsigned long *bitmap_alloc(int nbits) > +static inline unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) > { > - return calloc(1, BITS_TO_LONGS(nbits) * sizeof(unsigned long)); > + (void) flags; > + return malloc(BITS_TO_LONGS(nbits) * sizeof(unsigned long)); > +} hum I don't see any tools/ user fo bitmap_alloc now, but I guess we don't mind ;-) jirka