Relax allocations requirements
CAS does not need atomic alocations virtually anywhere. GFP_NOIO should be sufficient in IO path. When allocation buffers during module initialization use GFP_KERNEL. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -721,7 +721,7 @@ static int cas_atomic_submit_discard_bio(struct cas_atomic_io *atom)
|
||||
int offset;
|
||||
unsigned long *cmd_addr = blk_mq_rq_to_pdu(req);
|
||||
|
||||
nvm_discard = kmalloc(sizeof(*nvm_discard), GFP_ATOMIC);
|
||||
nvm_discard = kmalloc(sizeof(*nvm_discard), GFP_NOIO);
|
||||
if (!nvm_discard) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@@ -187,7 +187,7 @@ static int _blockdev_alloc_many_requests(ocf_core_t core,
|
||||
flags = 0;
|
||||
}
|
||||
|
||||
data = cas_alloc_blk_data(bio_segments(bio), GFP_ATOMIC);
|
||||
data = cas_alloc_blk_data(bio_segments(bio), GFP_NOIO);
|
||||
if (!data) {
|
||||
CAS_PRINT_RL(KERN_CRIT "BIO data vector allocation error\n");
|
||||
error = -ENOMEM;
|
||||
@@ -420,7 +420,7 @@ static int __block_dev_queue_rq(struct request *rq, ocf_core_t core)
|
||||
}
|
||||
|
||||
if (single_io) {
|
||||
data = cas_alloc_blk_data(size, GFP_ATOMIC);
|
||||
data = cas_alloc_blk_data(size, GFP_NOIO);
|
||||
if (data == NULL) {
|
||||
CAS_PRINT_RL(KERN_CRIT
|
||||
"Out of memory. Ending IO processing.\n");
|
||||
@@ -445,7 +445,7 @@ static int __block_dev_queue_rq(struct request *rq, ocf_core_t core)
|
||||
} else {
|
||||
struct list_head list = LIST_HEAD_INIT(list);
|
||||
|
||||
data = cas_alloc_blk_data(0, GFP_ATOMIC);
|
||||
data = cas_alloc_blk_data(0, GFP_NOIO);
|
||||
if (data == NULL) {
|
||||
printk(KERN_CRIT
|
||||
"Out of memory. Ending IO processing.\n");
|
||||
@@ -753,7 +753,7 @@ static int _blockdev_make_request_fast(struct casdsk_disk *dsk,
|
||||
return CASDSK_BIO_HANDLED;
|
||||
}
|
||||
|
||||
data = cas_alloc_blk_data(bio_segments(bio), GFP_ATOMIC);
|
||||
data = cas_alloc_blk_data(bio_segments(bio), GFP_NOIO);
|
||||
if (!data) {
|
||||
CAS_PRINT_RL(KERN_CRIT "BIO data vector allocation error\n");
|
||||
CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(-ENOMEM));
|
||||
|
Reference in New Issue
Block a user