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: <20220106074423.GG7674@kadam>
Date:   Thu, 6 Jan 2022 10:44:23 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Damien Le Moal <damien.lemoal@...nsource.wdc.com>
Cc:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        axboe@...nel.dk, chaitanya.kulkarni@....com, damien.lemoal@....com,
        ming.lei@...hat.com, Johannes.Thumshirn@....com,
        shinichiro.kawasaki@....com, jiangguoqing@...inos.cn,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] null_blk: Use bitmap_zalloc() when applicable

On Thu, Dec 30, 2021 at 11:28:28AM +0900, Damien Le Moal wrote:
> >  
> > -	tag_size = ALIGN(nq->queue_depth, BITS_PER_LONG) / BITS_PER_LONG;
> > -	nq->tag_map = kcalloc(tag_size, sizeof(unsigned long), GFP_KERNEL);
> > +	nq->tag_map = bitmap_zalloc(nq->queue_depth, GFP_KERNEL);
> >  	if (!nq->tag_map) {
> >  		kfree(nq->cmds);
> >  		return -ENOMEM;
> 
> Before this patch, tag_size would always be a multiple of BITS_PER_LONG.
> Using bitmap_zalloc(), that alignment goes away, but I think this is OK.
> 

It's still going to be a multiple of long.  Bitmaps are always stored
in longs.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ