Return-Path: X-Google-Smtp-Source: ACJfBov4Hfk9bQ5qTx0RTMqhSjgAmn2EXmsoUHUdS4GWEHoCHg0FXCFyoP5jpWFdb+VKDnp0nae3 ARC-Seal: i=1; a=rsa-sha256; t=1516264669; cv=none; d=google.com; s=arc-20160816; b=x5NoWlDPt+84J5Bt1Do22RRQa5M3JwLUB+v4q6k+TTfGY/NuZJqEy7kfkyhDmxylHC ksR9yuHPXnY9zXOIiLODu/PO9yUT9UCUnbwluVWGvNTJJzjw0C0MSAVjaEyWXsgmDqjD WwEqFccvreKr61HXbG9kw6iPd+TWwZKZqtzbhOsl7ZSRi8O8YOMq6MT0YrWAS/hIidbs PT87+7x7XyOHNV5RtxMgpIyDucyC0xLs0sHhoyrNbp/Oc/iaf6ZTaMFBz5djSfNOgzV1 r7AzAtLseE+XysjO/deWPhBwKecOOekdOgptqJxtTeZSRMEVo5a2WsNp/QZ9Ec0JZAbQ P7vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from :arc-authentication-results; bh=R1Eeopm4NIDIELahLGBn5zc+l6wg0iMYeJezbZf9Lx8=; b=C0CkrZceN9JWe3rJG4ZHSMwcWUEayG4GYgjcZr3FeKfJF9p5DfI6SlAGOlsJc12hml YfGha/HyVeAOpBI202BWYNnQH//Iv8SxOXeaLOeGwex/tdY4KQO/xsk2nd0tyEpYnnJw jTO0vuWE8Vc78JQzE902jfF2vfMIs4cNO8tHQHie7cu+vr1xsfHXmdSxmpFPv4dgmlHd nUfgd/NL9s6SNfL/GcqtR+4AksEOt72wQMws+gR94pYU48wxgmanqsfydcbDNr9BpjSU cXqXIQEM0OIqrYmQ02Xc4WkHmIDPfcC3opjVg8DWz+8Nn8LQDsOoCvGhCx4pT3cMRLXz SxkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of prime.zeng@hisilicon.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=prime.zeng@hisilicon.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of prime.zeng@hisilicon.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=prime.zeng@hisilicon.com From: Zeng Tao To: CC: , Zeng Tao , "Laura Abbott" , Sumit Semwal , "Greg Kroah-Hartman" , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Martijn Coenen , , Subject: [PATCH v2] staging: ION: Sys_heap: fix the incorrect pool->gfp_mask setting Date: Fri, 19 Jan 2018 00:37:06 +0800 Message-ID: <1516293427-17153-1-git-send-email-prime.zeng@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.158] X-CFilter-Loop: Reflected X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589918742095647044?= X-GMAIL-MSGID: =?utf-8?q?1589918742095647044?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: The gfp_mask low order pool is overlapped by the high order inside the loop, so the gfp_mask of all pools are set to high_order_gfp_flags. And all the allcations will have no __GFP_RECLAIM flag, we will easily get the allocation failure problem with memory presure. Changes since v1: 1. fix the tag 2. change the flags define based on the comment. Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up cached buffer alloc") Signed-off-by: Zeng Tao Cc: stable --- drivers/staging/android/ion/ion_system_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 4dc5d7a..12d0801 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -305,6 +305,8 @@ static int ion_system_heap_create_pools(struct ion_page_pool **pools, if (orders[i] > 4) gfp_flags = high_order_gfp_flags; + else + gfp_flags = low_order_gfp_flags; pool = ion_page_pool_create(gfp_flags, orders[i], cached); if (!pool) -- 2.7.4