From: Mandeep Singh Baines Date: Mon, 30 Jul 2012 21:43:22 +0000 (-0700) Subject: lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table() X-Git-Tag: firefly_0821_release~3680^2~2297^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e04f228335bde305d2833e40382ed37fc36f9efe;p=firefly-linux-kernel-4.4.55.git lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table() We are seeing a lot of sg_alloc_table allocation failures using the new drm prime infrastructure. We isolated the cause to code in __sg_alloc_table that was re-writing the gfp_flags. There is a comment in the code that suggest that there is an assumption about the allocation coming from a memory pool. This was likely true when sg lists were primarily used for disk I/O. Signed-off-by: Mandeep Singh Baines Cc: Jens Axboe Cc: Paul Gortmaker Cc: Cong Wang Cc: Daniel Vetter Cc: Rob Clark Cc: Sumit Semwal Cc: Inki Dae Cc: Dave Airlie Cc: Sonny Rao Cc: Olof Johansson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 6096e89bee55..d09bdd8b40ce 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -279,14 +279,6 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents, if (!left) sg_mark_end(&sg[sg_size - 1]); - /* - * only really needed for mempool backed sg allocations (like - * SCSI), a possible improvement here would be to pass the - * table pointer into the allocator and let that clear these - * flags - */ - gfp_mask &= ~__GFP_WAIT; - gfp_mask |= __GFP_HIGH; prv = sg; } while (left);