Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1045491imm; Wed, 4 Jul 2018 10:26:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdE7oJofjnvoWw+n2PxxMabUCJDBydCPQpwqs2NoMjo7TEO3m0vylu4qCHNpiP68OYQcPg2 X-Received: by 2002:a63:f45:: with SMTP id 5-v6mr752220pgp.447.1530725167537; Wed, 04 Jul 2018 10:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530725167; cv=none; d=google.com; s=arc-20160816; b=s2CxOPbLc1vZ9qeTKOLzTOPgQkD4lJyZ6OrtNBbiMbL9WGnM8GvPEeg2G75bwac6ch d4gXWLxpHEc8ohBcC0XFEKnBCbDJHjfJJjcnEWIR1x9bkPb6FLk8uwm3ycD7yYsAQ8co 6ECaPgoyXg1WpS7Dfp1vwev951y98Fmc3vGiAr6RZCXcTSwHIvn2KGuogfdizUlbm4tp FMNTlfOGRBG+gIfEQSuGDJpLraKIoWpSPq4qCbF7B8TuKA31ViLTbbmIjEcQSp6xJ2fQ 5dmFnRf75QNiNUpxDXbQmMlP26yAhGAQRsbC1ZPxnPGyuno/Zu1ewqA7vF8sknRFf0xT M3jA== 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=DqVWG4TGty6GTgeHfwiKbX+JAQsF13vdmPoB6YDiq9s=; b=vxJvXZbo1FNDLSM/nJbDuvXDX9kC29jAymfMJIu+KXqOY9wMmFlfn7ONmhpZG0/ftU YTJao7QkZU7LHTmgSVXO46mpJeenx1LF25wxkUHAjKlasp21Q+9Th42UHKfyzy+wX0um 90pXKPHrlTmGesp4szdVkWVhlcuqmmbdWt8bAf+ZBX0RSbpE+KuhV6da3WsAKOL5ptv7 Lu9ZrE7hebD6zQBbA0J5m9ikgYZa8xBYhbO46tQH+oMsv13cR4L3Ub+ilicMolwmMb5z 6ezYQ3Wfd5gBuKGRgSDhZXnitVHWAtxw5SAtS1uklHgJ3G7dTr8vs4Ss5Mc/dYjeev3l hG4A== 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 y186-v6si3798373pgb.395.2018.07.04.10.25.53; Wed, 04 Jul 2018 10:26:07 -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 S1752684AbeGDRYv (ORCPT + 99 others); Wed, 4 Jul 2018 13:24:51 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42440 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752019AbeGDRYu (ORCPT ); Wed, 4 Jul 2018 13:24:50 -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 9BE8C212D1; Wed, 4 Jul 2018 17:24:49 +0000 (UTC) Received: from krava (unknown [10.43.17.196]) by smtp.corp.redhat.com (Postfix) with SMTP id 276862026D76; Wed, 4 Jul 2018 17:24:46 +0000 (UTC) Date: Wed, 4 Jul 2018 19:24:45 +0200 From: Jiri Olsa To: Dmitry Torokhov Cc: Yury Norov , 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 , Andrew Morton , Mike Snitzer Subject: Re: [PATCH 2/2] bitmap: sync tools with new bitmap allocation API Message-ID: <20180704172445.GE19164@krava> References: <20180623073502.16321-1-ynorov@caviumnetworks.com> <20180623073502.16321-2-ynorov@caviumnetworks.com> <20180624213103.GA166241@dtor-ws> <20180624224522.GA23998@yury-thinkpad> <20180704153617.tps2asygskoym46d@penguin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180704153617.tps2asygskoym46d@penguin> 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.2]); Wed, 04 Jul 2018 17:24:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 04 Jul 2018 17:24:49 +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 Wed, Jul 04, 2018 at 03:36:17PM +0000, Dmitry Torokhov wrote: SNIP > > > > 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) > > > > > > This makes absolutely no sense for userspace API. What gfp_t even means > > > here? > > > > > > If you want to introduce bitmap_zalloc and bitmap_free it is fine but > > > adding dummy parameters to match kernel API exactly is a folly. > > > > Identical API makes easier porting the code from kernel to tools. > > Refer for example declaration of kmalloc in: > > tools/testing/radix-tree/linux.c > > tools/testing/scatterlist/linux/mm.h > > tools/virtio/linux/kernel.h > > tools/virtio/ringtest/ptr_ring.c > > These are unittests for the APIs in question, of course they would have > to match exactly. > > perf tool however is not a unittest, so there is no need to match kernel > API. +1, please remove that flags argument thanks, jirka