You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
sbitmap: randomize initial alloc_hint values
In order to get good cache behavior from a sbitmap, we want each CPU to stick to its own cacheline(s) as much as possible. This might happen naturally as the bitmap gets filled up and the alloc_hint values spread out, but we really want this behavior from the start. blk-mq apparently intended to do this, but the code to do this was never wired up. Get rid of the dead code and make it part of the sbitmap library. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
committed by
Jens Axboe
parent
f4a644db86
commit
98d95416db
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/random.h>
|
||||
|
||||
#include <linux/blk-mq.h>
|
||||
#include "blk.h"
|
||||
@@ -419,13 +418,6 @@ void blk_mq_free_tags(struct blk_mq_tags *tags)
|
||||
kfree(tags);
|
||||
}
|
||||
|
||||
void blk_mq_tag_init_last_tag(struct blk_mq_tags *tags, unsigned int *tag)
|
||||
{
|
||||
unsigned int depth = tags->nr_tags - tags->nr_reserved_tags;
|
||||
|
||||
*tag = prandom_u32() % depth;
|
||||
}
|
||||
|
||||
int blk_mq_tag_update_depth(struct blk_mq_tags *tags, unsigned int tdepth)
|
||||
{
|
||||
tdepth -= tags->nr_reserved_tags;
|
||||
|
||||
Reference in New Issue
Block a user