Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758069AbbKSJBY (ORCPT ); Thu, 19 Nov 2015 04:01:24 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:34720 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757419AbbKSJBV (ORCPT ); Thu, 19 Nov 2015 04:01:21 -0500 From: Rasmus Villemoes To: Jia He Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Andrew Morton , Denys Vlasenko , Kyungmin Park , Michal Nazarewicz , Yury Norov , Tejun Heo , Martin Kepplinger , George Spelvin , Ingo Molnar , Arnd Bergmann Subject: Re: [PATCH v2 0/3] Improve bitmap_empty and bitmap_full Organization: D03 References: <1447915724-29709-1-git-send-email-hejianet@gmail.com> X-Hashcash: 1:20:151119:martink@posteo.de::/jITh6NRqdYepZ/F:000000000000000000000000000000000000000000000KbG X-Hashcash: 1:20:151119:yury.norov@gmail.com::Bz7GNUx2FrpBo7Cp:0000000000000000000000000000000000000000009e9 X-Hashcash: 1:20:151119:linux@horizon.com::C8YUmihBtXZPcvmZ:000000000000000000000000000000000000000000000jHw X-Hashcash: 1:20:151119:arnd@arndb.de::1+EpqSIqx4hBcSI2:00000eI/ X-Hashcash: 1:20:151119:dvlasenk@redhat.com::wMwE9NOzF2TpitO6:0000000000000000000000000000000000000000001hmE X-Hashcash: 1:20:151119:hejianet@gmail.com::duye/nJ5h0EKS8Dw:00000000000000000000000000000000000000000002PfJ X-Hashcash: 1:20:151119:linux-kernel@vger.kernel.org::P3Nnek3/+viJifoG:0000000000000000000000000000000002k5P X-Hashcash: 1:20:151119:linux-arch@vger.kernel.org::BULjvpJZzdV28bbN:0000000000000000000000000000000000036TM X-Hashcash: 1:20:151119:tj@kernel.org::iaM8snIMQzjfmJgD:00002koW X-Hashcash: 1:20:151119:kyungmin.park@samsung.com::Fwk/6lzQtX8XesjN:00000000000000000000000000000000000034n3 X-Hashcash: 1:20:151119:akpm@linux-foundation.org::6fSqC2C+4ig0+ElE:0000000000000000000000000000000000003u+o X-Hashcash: 1:20:151119:mingo@kernel.org::a4Gjyljh3/4XymyJ:04XQg X-Hashcash: 1:20:151119:mina86@mina86.com::2qvViLwblz+gIxOr:000000000000000000000000000000000000000000004uu1 Date: Thu, 19 Nov 2015 10:01:17 +0100 In-Reply-To: <1447915724-29709-1-git-send-email-hejianet@gmail.com> (Jia He's message of "Thu, 19 Nov 2015 14:48:41 +0800") Message-ID: <87bnaqtlb6.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1113 Lines: 25 On Thu, Nov 19 2015, Jia He wrote: > find_fisrt_{zero_}bit are too heavy for bitmap_{full,empty}. We don't > need to calculate and compare the position of bitmap. This set of patch > instroduces lightweight api and replaces the heavy one. > Please check the history of the code you're modifying. git blame include/linux/bitmap.h would immediately point you to 2afe27c718b "lib/bitmap.c: bitmap_[empty,full]: remove code duplication". While it's obviously true that find_first_bit does slightly more work than strictly necessary to establish whether the bitmap is empty, it does the same number of memory accesses, so I wouldn't consider it particularly heavy-weight. Getting rid of .text as 2afe27c718b did is a good thing, so you'd have to explain why we should reintroduce specialized functions for this. Your code is also buggy :-( Rasmus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/