From fc2feda137e00b08c9e97e7060f4c030a139fac5 Mon Sep 17 00:00:00 2001 From: Wei Lin Guay Date: Thu, 31 Aug 2017 21:52:27 +0200 Subject: [PATCH] Revert "RDS: fix the sg allocation based on actual message size" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit 23f90cccfba4 ("RDS: fix the sg allocation based on actual message size") because RDS has implemented N sge to support large fragment size, with each sge of PAGE_SIZE. Orabug: 26770234 Signed-off-by: Wei Lin Guay Reviewed-by: HÃ¥kon Bugge Tested-by: Shih-Yu Huang Acked-by: Santosh Shilimkar Signed-off-by: Dhaval Giani --- net/rds/message.c | 5 +---- net/rds/page.c | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/net/rds/message.c b/net/rds/message.c index 6ae9267732aa..c305f88c05e7 100644 --- a/net/rds/message.c +++ b/net/rds/message.c @@ -65,10 +65,7 @@ static void rds_message_purge(struct rds_message *rm) for (i = 0; i < rm->data.op_nents; i++) { rdsdebug("putting data page %p\n", (void *)sg_page(&rm->data.op_sg[i])); /* XXX will have to put_page for page refs */ - (rm->data.op_sg[i].length <= PAGE_SIZE) ? - __free_page(sg_page(&rm->data.op_sg[i])) : - __free_pages(sg_page(&rm->data.op_sg[i]), - get_order(rm->data.op_sg[i].length)); + __free_page(sg_page(&rm->data.op_sg[i])); } rm->data.op_nents = 0; diff --git a/net/rds/page.c b/net/rds/page.c index 1dae84883291..0451e7b67c89 100644 --- a/net/rds/page.c +++ b/net/rds/page.c @@ -127,11 +127,11 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes, /* jump straight to allocation if we're trying for a huge page */ if (bytes >= PAGE_SIZE) { - page = alloc_pages(gfp, get_order(bytes)); + page = alloc_page(gfp); if (!page) { ret = -ENOMEM; } else { - sg_set_page(scat, page, bytes, 0); + sg_set_page(scat, page, PAGE_SIZE, 0); ret = 0; } goto out; -- 2.50.1