lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9b90677b2d97c556c400e3744518942e0b58d41.camel@perches.com>
Date:   Wed, 15 Apr 2020 00:47:39 -0700
From:   Joe Perches <joe@...ches.com>
To:     Wang Qing <wangqing@...o.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Dennis Zhou <dennis@...nel.org>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        David Sterba <dsterba@...e.com>,
        Josef Bacik <josef@...icpanda.com>,
        Stefano Brivio <sbrivio@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        William Breathitt Gray <vilhelm.gray@...il.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Yury Norov <yury.norov@...il.com>, linux-kernel@...r.kernel.org
Cc:     opensource.kernel@...o.com
Subject: Re: [PATCH] Bitmap: Optimized division operation to shift operation

On Wed, 2020-04-15 at 15:27 +0800, Wang Qing wrote:
> On some processors, the / operate will call the compiler`s div lib,
> which is low efficient. Bitmap is performance sensitive, We can
> replace the / operation with shift.

Seems more like bad compilers than useful code changes
unless you can specify what compilers and what processors.

> diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
[]
> @@ -337,7 +337,7 @@ static inline int bitmap_equal(const unsigned long *src1,
>  		return !((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits));
>  	if (__builtin_constant_p(nbits & BITMAP_MEM_MASK) &&
>  	    IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT))
> -		return !memcmp(src1, src2, nbits / 8);
> +		return !memcmp(src1, src2, nbits >> 3);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ