msm: kgsl: Correct gfp mask passed to kvcalloc

Remove __GFP_NOWARN and __GFP_NORETRY gfp masks
from kvcalloc calls to avoid out of memory errors
because of not triggering shrinker in cases we are
in low memory situations.

Change-Id: I79936816f895d0f79c7620cda00114457893b349
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
This commit is contained in:
Deepak Kumar 2021-03-02 19:30:07 +05:30
commit fde3eab781
4 changed files with 6 additions and 10 deletions

View file

@ -1950,8 +1950,7 @@ long kgsl_ioctl_gpu_aux_command(struct kgsl_device_private *dev_priv,
if (param->flags & KGSL_GPU_AUX_COMMAND_SYNC)
count++;
drawobjs = kvcalloc(count, sizeof(*drawobjs),
GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
drawobjs = kvcalloc(count, sizeof(*drawobjs), GFP_KERNEL);
if (!drawobjs) {
kgsl_context_put(context);
@ -2396,8 +2395,7 @@ static int memdesc_sg_virt(struct kgsl_memdesc *memdesc, unsigned long useraddr)
if (sglen == 0 || sglen >= LONG_MAX)
return -EINVAL;
pages = kvcalloc(sglen, sizeof(*pages),
GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
pages = kvcalloc(sglen, sizeof(*pages), GFP_KERNEL);
if (pages == NULL)
return -ENOMEM;

View file

@ -881,8 +881,7 @@ int kgsl_drawobj_add_timeline(struct kgsl_device_private *dev_priv,
return -EINVAL;
timelineobj->timelines = kvcalloc(cmd.count,
sizeof(*timelineobj->timelines),
GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
sizeof(*timelineobj->timelines), GFP_KERNEL);
if (!timelineobj->timelines)
return -ENOMEM;

View file

@ -443,8 +443,7 @@ int kgsl_pool_alloc_pages(u64 size, struct page ***pages, struct device *dev)
{
int count = 0;
int npages = size >> PAGE_SHIFT;
struct page **local = kvcalloc(npages, sizeof(*local),
GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
struct page **local = kvcalloc(npages, sizeof(*local), GFP_KERNEL);
u32 page_size, align;
u64 len = size;

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2002,2007-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2002,2007-2021, The Linux Foundation. All rights reserved.
*/
#include <asm/cacheflush.h>
@ -1000,7 +1000,7 @@ static int kgsl_system_alloc_pages(u64 size, struct page ***pages,
struct page **local;
int i, npages = size >> PAGE_SHIFT;
local = kvcalloc(npages, sizeof(*pages), GFP_KERNEL | __GFP_NORETRY);
local = kvcalloc(npages, sizeof(*pages), GFP_KERNEL);
if (!local)
return -ENOMEM;