From 8a2df635024f8c5f0e5eaa2c101d6c1eaa6cc87b Mon Sep 17 00:00:00 2001 From: Chaitanya Pratapa Date: Wed, 16 Feb 2022 23:03:51 -0800 Subject: [PATCH] msm: ipa: avoid OOM Killer for temp allocations Make changes to use __GFP_RETRY_MAYFAIL to avoid triggering OOM Killer when allocating pages for temp allocations. Change-Id: I2f5843c9a1c0a9f41e215c8241713f4670e4b35c Signed-off-by: Chaitanya Pratapa --- drivers/platform/msm/ipa/ipa_v3/ipa_dp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c index 6b78bed73980..0d4650181bc0 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c @@ -2189,6 +2189,9 @@ static struct ipa3_rx_pkt_wrapper *ipa3_alloc_rx_pkt_page( return NULL; rx_pkt->page_data.page_order = IPA_WAN_PAGE_ORDER; + /* For temporary allocations, avoid triggering OOM Killer. */ + if (is_tmp_alloc) + flag |= __GFP_RETRY_MAYFAIL | __GFP_NOWARN; /* Try a lower order page for order 3 pages in case allocation fails. */ rx_pkt->page_data.page = ipa3_alloc_page(flag, &rx_pkt->page_data.page_order,