mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
block: reuse BIO_INLINE_VECS for integrity bvecs
bvec_alloc always uses biovec_slabs, and thus always needs to use the same number of inline vecs. Share a single definition for the data and integrity bvecs. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
8358c28a5d
commit
dc0b8a57ad
@@ -14,8 +14,6 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include "blk.h"
|
#include "blk.h"
|
||||||
|
|
||||||
#define BIP_INLINE_VECS 4
|
|
||||||
|
|
||||||
static struct kmem_cache *bip_slab;
|
static struct kmem_cache *bip_slab;
|
||||||
static struct workqueue_struct *kintegrityd_wq;
|
static struct workqueue_struct *kintegrityd_wq;
|
||||||
|
|
||||||
@@ -63,7 +61,7 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio,
|
|||||||
inline_vecs = nr_vecs;
|
inline_vecs = nr_vecs;
|
||||||
} else {
|
} else {
|
||||||
bip = mempool_alloc(&bs->bio_integrity_pool, gfp_mask);
|
bip = mempool_alloc(&bs->bio_integrity_pool, gfp_mask);
|
||||||
inline_vecs = BIP_INLINE_VECS;
|
inline_vecs = BIO_INLINE_VECS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(!bip))
|
if (unlikely(!bip))
|
||||||
@@ -470,6 +468,6 @@ void __init bio_integrity_init(void)
|
|||||||
|
|
||||||
bip_slab = kmem_cache_create("bio_integrity_payload",
|
bip_slab = kmem_cache_create("bio_integrity_payload",
|
||||||
sizeof(struct bio_integrity_payload) +
|
sizeof(struct bio_integrity_payload) +
|
||||||
sizeof(struct bio_vec) * BIP_INLINE_VECS,
|
sizeof(struct bio_vec) * BIO_INLINE_VECS,
|
||||||
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
|
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
|
||||||
}
|
}
|
||||||
|
@@ -25,12 +25,6 @@
|
|||||||
#include "blk.h"
|
#include "blk.h"
|
||||||
#include "blk-rq-qos.h"
|
#include "blk-rq-qos.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* Test patch to inline a certain number of bi_io_vec's inside the bio
|
|
||||||
* itself, to shrink a bio data allocation from two mempool calls to one
|
|
||||||
*/
|
|
||||||
#define BIO_INLINE_VECS 4
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if you change this list, also change bvec_alloc or things will
|
* if you change this list, also change bvec_alloc or things will
|
||||||
* break badly! cannot be bigger than what you can fit into an
|
* break badly! cannot be bigger than what you can fit into an
|
||||||
|
@@ -55,6 +55,7 @@ void blk_free_flush_queue(struct blk_flush_queue *q);
|
|||||||
|
|
||||||
void blk_freeze_queue(struct request_queue *q);
|
void blk_freeze_queue(struct request_queue *q);
|
||||||
|
|
||||||
|
#define BIO_INLINE_VECS 4
|
||||||
struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *);
|
struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *);
|
||||||
void bvec_free(mempool_t *, struct bio_vec *, unsigned int);
|
void bvec_free(mempool_t *, struct bio_vec *, unsigned int);
|
||||||
unsigned int bvec_nr_vecs(unsigned short idx);
|
unsigned int bvec_nr_vecs(unsigned short idx);
|
||||||
|
Reference in New Issue
Block a user