From: Wei Lin Guay Date: Thu, 31 Aug 2017 19:52:27 +0000 (+0200) Subject: Revert "RDS: fix the sg allocation based on actual message size" X-Git-Tag: v4.1.12-117.0_27200813_3~27 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fc2feda137e00b08c9e97e7060f4c030a139fac5;p=users%2Fjedix%2Flinux-maple.git Revert "RDS: fix the sg allocation based on actual message size" 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 --- 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;