summaryrefslogtreecommitdiff
path: root/drivers/s390/block/scm_blk_cluster.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2014-12-05 18:41:47 +0300
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-12-08 11:42:44 +0300
commitde88d0d28fe932637eb5b7ebf9e638256cf07979 (patch)
tree832876b01901d8c29c09ea170bc69f8dacfec25d /drivers/s390/block/scm_blk_cluster.c
parent9d4df77fab7347a74a9938521ffad8d8fab2671d (diff)
downloadlinux-de88d0d28fe932637eb5b7ebf9e638256cf07979.tar.xz
s390/scm_block: allocate aidaw pages only when necessary
AOBs (the structure describing the HW request) need to be 4K aligned but very little of that page is actually used. With this patch we place aidaws at the end of the AOB page and only allocate a separate page for aidaws when we have to (lists of aidaws must not cross page boundaries). Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/scm_blk_cluster.c')
-rw-r--r--drivers/s390/block/scm_blk_cluster.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/s390/block/scm_blk_cluster.c b/drivers/s390/block/scm_blk_cluster.c
index 4787f80e5537..2fd01320b978 100644
--- a/drivers/s390/block/scm_blk_cluster.c
+++ b/drivers/s390/block/scm_blk_cluster.c
@@ -131,16 +131,9 @@ static int scm_prepare_cluster_request(struct scm_request *scmrq)
scmrq->cluster.state = CLUSTER_READ;
/* fall through */
case CLUSTER_READ:
- aidaw = scm_aidaw_alloc();
- if (!aidaw)
- return -ENOMEM;
-
- memset(aidaw, 0, PAGE_SIZE);
- scmrq->aob->request.msb_count = 1;
msb->bs = MSB_BS_4K;
msb->oc = MSB_OC_READ;
msb->flags = MSB_FLAG_IDA;
- msb->data_addr = (u64) aidaw;
msb->blk_count = write_cluster_size;
addr = scmdev->address + ((u64) blk_rq_pos(req) << 9);
@@ -151,6 +144,12 @@ static int scm_prepare_cluster_request(struct scm_request *scmrq)
CLUSTER_SIZE))
msb->blk_count = 2 * write_cluster_size;
+ aidaw = scm_aidaw_fetch(scmrq, msb->blk_count * PAGE_SIZE);
+ if (!aidaw)
+ return -ENOMEM;
+
+ scmrq->aob->request.msb_count = 1;
+ msb->data_addr = (u64) aidaw;
for (i = 0; i < msb->blk_count; i++) {
aidaw->data_addr = (u64) scmrq->cluster.buf[i];
aidaw++;