qcacmn: Mitigate the slab allocation failures with __GFP_DIRECT_RECLAIM

__qdf_nbuf_frag_alloc fallback allocation using alloc_skb slab
allocation, use GFP_KERNEL flag which is inclusive of
__GFP_DIRECT_RECLAIM. This will mitigate the allocation failures.

Change-Id: Ib852bf0f812839f0a99093855cebc928d0c79fd1
CRs-Fixed: 3585716
This commit is contained in:
Prakash Manjunathappa
2023-08-11 00:17:17 -07:00
committed by Rahul Choudhary
parent b7b5ec0c8a
commit fb7d334b7c

View File

@@ -629,11 +629,13 @@ struct sk_buff *__qdf_nbuf_frag_alloc(qdf_device_t osdev, size_t size,
{
struct sk_buff *skb;
int flags = GFP_KERNEL & ~__GFP_DIRECT_RECLAIM;
bool atomic = false;
if (align)
size += (align - 1);
if (in_interrupt() || irqs_disabled() || in_atomic()) {
atomic = true;
flags = GFP_ATOMIC;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
/*
@@ -651,6 +653,9 @@ struct sk_buff *__qdf_nbuf_frag_alloc(qdf_device_t osdev, size_t size,
goto skb_alloc;
/* 32k page frag alloc failed, try page slab allocation */
if (likely(!atomic))
flags |= __GFP_DIRECT_RECLAIM;
skb = alloc_skb(size, flags);
if (skb)
goto skb_alloc;