Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4492904imm; Mon, 18 Jun 2018 16:19:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIlzCkOC1pE/UUkZ2/sZfR0n5KPe6COHdlw76auHvwJAfwCZ/uUN7JQVrTVdW045YZY/iFc X-Received: by 2002:a17:902:28e4:: with SMTP id f91-v6mr16349858plb.146.1529363985916; Mon, 18 Jun 2018 16:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529363985; cv=none; d=google.com; s=arc-20160816; b=B4nW2zyMkJvIUboR2dA6Fwzx//7XwhCbWtsUERt+4/JXDs44ScuHU/0so566G2CODj gHQTcH9+WrinMlI7F1udy9RSmlE01jinAGVUdOWW9LlMLxoPdiesTDnRLSSTEnxgZSzc QrL5mVpkbo482z/84uIURScXy09HIbDuXaxNt5AYbf93lu8WrlGY+wDeA2UM0ZFjs8bO FEJi3sC1ZxBcLRr097EKJKleMiIIvmaTUBu1CwQU/18oTd/7+8G2UApTH2Wpl0zp1PXh MBoJ9yJvFs1TF+5QfokYYclvpxhwDSWt4nwmzou/Cc44ieGXQy7zmxKlpFoBxRlTcqGJ a8SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=jy+h40C7dggu3pV2v4jLVnODDyvO2+jkraS+VhVrIig=; b=zxFR9CT/0Jj0MA2wz8jt/yDKf8beHJ9T01vw0Wp1iBOlOuFKMgVm4wXGUQWeLwL/Li rbtL9RVm07vJlfVYbSWvOlUe2LUk866xTp3jvpmObm3uXzADHpGEjZO5YKXw+NnPskcE 98TWvwiEmQ3ZEo/+rsxeQhbQ3tCBpuEmXv4+GiKPPRFeY5Kh6gfgObF1gfrbZyyt53tg h+LKycfAsznyyH+kGlSlhZHrkCIkCkP/bRl8OyJHKhA/Y3d5/vwG7Xvp8T3Za1iTS9Z0 14tKsLydI8q1rTiinnkTB98liQLj8i65o8AYLZe6JNincWL7FvTScVDWlXKi8vqKAJQY 2u7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r0L9XqVl; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m37-v6si15815859plg.491.2018.06.18.16.19.31; Mon, 18 Jun 2018 16:19:45 -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=@gmail.com header.s=20161025 header.b=r0L9XqVl; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936488AbeFRXSw (ORCPT + 99 others); Mon, 18 Jun 2018 19:18:52 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:38501 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934807AbeFRXSu (ORCPT ); Mon, 18 Jun 2018 19:18:50 -0400 Received: by mail-vk0-f68.google.com with SMTP id b77-v6so10591864vkb.5; Mon, 18 Jun 2018 16:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jy+h40C7dggu3pV2v4jLVnODDyvO2+jkraS+VhVrIig=; b=r0L9XqVl/PniDXUd+KhYbCJjuEePark+2AWEMStn9Y9IfjkSa/YGOtxoocowPeo+s4 BSvMB4TpRpn+bGXd+2MEfFFds5OXSOC6i9nW5ka7wvqRNI1Yud80wcBpwZ9QFG0behYh wAIzPlhRlkv1pZIjq6Aj+TbHzD135CVxohvRV5vR1weYrU1BbYK2aep6/fOwaf6Mt4kD 3Ip4FtF6F0URW3NOqahYlwKW8o4DUimgihGi99o5UPetS+HON6XuuiHJMNoocxGU6Ivr EKoNbshHX8KfsWkMCb1SnveWYwz6+FQImDUdbEw71bvqs+fCnhPG7YjHeFMyP7Ph7JDH C4FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jy+h40C7dggu3pV2v4jLVnODDyvO2+jkraS+VhVrIig=; b=qZM/RTt6LBC6pNx4zEcYtF8UF1M98EIhroYA+HfEFbvO7+r2/jnpgkvdN+Paf4Y1eD QMsLY6tan29iRdDcI4HbfqUOCFy7z+9lbC7hLMjx/95Xi+yYJjJ6aQYbW2xvmsQdbSS1 rsKDOC+NhaK9+SZ6+kHCfDXQ1ykUc5WeDIcIdBcXPKhtMTowEyTo9+h4HBt9bQFzEBt9 gp7p9QkYu0EzYoNWzd9G1pOakyMasv3LyHrImgwNCVyPnx4Qfa3qVEXv5EssXCO8Q7Av i7gMX+eXamG/tr99jR6v3IOPghRO/Yo4WZyHcgVAgalX/i0074e83s0heEAUJZ0fMc9f HeBw== X-Gm-Message-State: APt69E2vBs4C+rZrSaHf9svqAi0+nHjSGrIbsQYxrTGdPdQ/P5j2bt6x Vd84/tALBUnYn824ueySIzMOXCStnwcbqrMk0sTygFj8 X-Received: by 2002:a1f:860b:: with SMTP id i11-v6mr8288770vkd.15.1529363929334; Mon, 18 Jun 2018 16:18:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8b02:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 16:18:48 -0700 (PDT) In-Reply-To: <20180618161056.e52efd0e8bd36211e60705a2@linux-foundation.org> References: <20180618131003.88110-1-andriy.shevchenko@linux.intel.com> <20180618131003.88110-4-andriy.shevchenko@linux.intel.com> <20180618141404.68124daab97bd0f3a3051544@linux-foundation.org> <20180618161056.e52efd0e8bd36211e60705a2@linux-foundation.org> From: Andy Shevchenko Date: Tue, 19 Jun 2018 02:18:48 +0300 Message-ID: Subject: Re: [PATCH v3 3/5] bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free() To: Andrew Morton Cc: Dmitry Torokhov , Andy Shevchenko , agk@redhat.com, Mike Snitzer , device-mapper development , shli@kernel.org, linux-raid@vger.kernel.org, "linux-input@vger.kernel.org" , Yury Norov , lkml , Mika Westerberg , Joe Perches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 2:10 AM, Andrew Morton wrote: > On Mon, 18 Jun 2018 15:01:43 -0700 Dmitry Torokhov wrote: > >> > > +unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) >> > > +{ >> > > + return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), flags); >> > > +} >> > > +EXPORT_SYMBOL(bitmap_alloc); >> > > + >> > > +unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags) >> > > +{ >> > > + return bitmap_alloc(nbits, flags | __GFP_ZERO); >> > > +} >> > > +EXPORT_SYMBOL(bitmap_zalloc); >> > > + >> > > +void bitmap_free(const unsigned long *bitmap) >> > > +{ >> > > + kfree(bitmap); >> > > +} >> > > +EXPORT_SYMBOL(bitmap_free); >> > > + >> > >> > I suggest these functions are small and simple enough to justify >> > inlining them. >> > >> >> We can't as we end up including bitmap.h (by the way of cpumask.h) >> form slab.h, so we gen circular dependency. > > That info should have been in the changelog, I put it in cover letter, though it perhaps better to have in commit message itself. > and probably a code > comment. This is done in header file. You meant C-file? >> Maybe if we removed memcg >> stuff from slab.h so we do not need to include workqueue.h... > > Or move the basic slab API stuff out of slab.h into a new header. Or > create a new, standalone work_struct.h - that looks pretty simple. Latter one seems requires least effort without potentially breaking things. I take it as your suggestion, though I would still give a glance if it is possible to split exactly memcg part out of slab. -- With Best Regards, Andy Shevchenko