]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
net: thunderx: Alloc higher order pages when pagesize is small
authorSunil Goutham <sgoutham@cavium.com>
Thu, 11 Feb 2016 16:20:26 +0000 (21:50 +0530)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:19:44 +0000 (10:19 +0100)
Allocate higher order pages when pagesize is small, this will
reduce number of calls to page allocator and wastage of memory.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from linux-next commit 6e4be8d6717cb63c58f6b404e63a881c76d8878c)
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/net/ethernet/cavium/thunder/nicvf_queues.c

index 50ab6f4d8c196cadb788593f077633a6eea06cde..5adb208c1ad2f3ff57f7641d7dde049cbec7798f 100644 (file)
@@ -78,7 +78,7 @@ static void nicvf_free_q_desc_mem(struct nicvf *nic, struct q_desc_mem *dmem)
 static inline int nicvf_alloc_rcv_buffer(struct nicvf *nic, gfp_t gfp,
                                         u32 buf_len, u64 **rbuf)
 {
-       int order = get_order(buf_len);
+       int order = (PAGE_SIZE <= 4096) ?  PAGE_ALLOC_COSTLY_ORDER : 0;
 
        /* Check if request can be accomodated in previous allocated page */
        if (nic->rb_page) {