lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table
authorMandeep Singh Baines <msb@chromium.org>
Fri, 22 Jun 2012 23:22:29 +0000 (16:22 -0700)
committerOlof Johansson <olofj@chromium.org>
Tue, 26 Jun 2012 18:20:56 +0000 (11:20 -0700)
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.

LKML-Reference: https://lkml.org/lkml/2012/6/22/494

BUG=chrome-os-partner:10745
TEST=none

Change-Id: Id8dac90f15c14aa5bf68a81df3a2e5103dd32251
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit-int.chromium.org/20672
Reviewed-by: Sonny Rao <sonnyrao@google.com>
Tested-by: Subash Patel <subash@chromium.org>
lib/scatterlist.c

index 9a3d483..5e281f5 100644 (file)
@@ -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);