diff options
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/mempool.h> | 26 | #include <linux/mempool.h> |
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/blktrace_api.h> | ||
28 | #include <scsi/sg.h> /* for struct sg_iovec */ | 29 | #include <scsi/sg.h> /* for struct sg_iovec */ |
29 | 30 | ||
30 | #define BIO_POOL_SIZE 256 | 31 | #define BIO_POOL_SIZE 256 |
@@ -1095,6 +1096,9 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) | |||
1095 | if (!bp) | 1096 | if (!bp) |
1096 | return bp; | 1097 | return bp; |
1097 | 1098 | ||
1099 | blk_add_trace_pdu_int(bdev_get_queue(bi->bi_bdev), BLK_TA_SPLIT, bi, | ||
1100 | bi->bi_sector + first_sectors); | ||
1101 | |||
1098 | BUG_ON(bi->bi_vcnt != 1); | 1102 | BUG_ON(bi->bi_vcnt != 1); |
1099 | BUG_ON(bi->bi_idx != 0); | 1103 | BUG_ON(bi->bi_idx != 0); |
1100 | atomic_set(&bp->cnt, 3); | 1104 | atomic_set(&bp->cnt, 3); |
@@ -1243,11 +1247,11 @@ static int __init init_bio(void) | |||
1243 | scale = 4; | 1247 | scale = 4; |
1244 | 1248 | ||
1245 | /* | 1249 | /* |
1246 | * scale number of entries | 1250 | * Limit number of entries reserved -- mempools are only used when |
1251 | * the system is completely unable to allocate memory, so we only | ||
1252 | * need enough to make progress. | ||
1247 | */ | 1253 | */ |
1248 | bvec_pool_entries = megabytes * 2; | 1254 | bvec_pool_entries = 1 + scale; |
1249 | if (bvec_pool_entries > 256) | ||
1250 | bvec_pool_entries = 256; | ||
1251 | 1255 | ||
1252 | fs_bio_set = bioset_create(BIO_POOL_SIZE, bvec_pool_entries, scale); | 1256 | fs_bio_set = bioset_create(BIO_POOL_SIZE, bvec_pool_entries, scale); |
1253 | if (!fs_bio_set) | 1257 | if (!fs_bio_set) |