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>
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);