]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/rds: Reduce memory footprint in rds_sendmsg
authorWei Lin Guay <wei.lin.guay@oracle.com>
Tue, 27 Jun 2017 03:41:52 +0000 (21:41 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 6 Jul 2017 02:44:49 +0000 (19:44 -0700)
Orabug: 26151323

8K + 256 (8448B) is an important message size for the RDBMS workload. Since
Infiniband supports scatter-gather in hardware, there is no reason to
fragment each RDS message into PAGE_SIZE work requests. Hence, RDS fragment
sizes up to 16K has been introduced.

Fixes: 23f90cccfba4 ("RDS: fix the sg allocation based on actual msg sz")
Previous behavior was allocating a contiguous memory buffer, corresponding
to the size of the RDS message. Although this was functional correct, it
introduced hard pressure on the memory allocation system, which was
not needed.

This commit fixes the drawback introduced by only allocating
the buffer according to RDS_MAX_FRAG_SIZE.

Orabug: 26350949

Signed-off-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Signed-off-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Acked-by: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Tested-by: John Sobecki <john.sobecki@oracle.com>
net/rds/page.c
net/rds/rds.h

index 59cd71cbb991f5a22ad2bb12dbbc83e99f1edb49..e874b32bc952f311206f4ed7bb559ad0895df7a5 100644 (file)
@@ -129,8 +129,8 @@ 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) {
                if (large_page) {
-                       order =  get_order(bytes);
-                       size = bytes;
+                       size = min_t(unsigned int, bytes, RDS_MAX_FRAG_SIZE);
+                       order = get_order(size);
                } else {
                        order =  0;
                        size = PAGE_SIZE;
index 61c78639958c181432f175879b4e6ac69d550c34..264f8b43b46581c1c31e20ea9dd40a870b40c22b 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <uapi/linux/rds.h>
+#include <linux/sizes.h>
 
 #include "info.h"