From patchwork Thu Jan 18 16:37:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Tao X-Patchwork-Id: 124922 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp34945lja; Thu, 18 Jan 2018 00:37:28 -0800 (PST) X-Google-Smtp-Source: ACJfBovJkxc1aB+DhzkkA+5f042uacaLu6Jb80uGy+70q5r7SfeUJ63diWaEQZ54UXInBh6ct+Qe X-Received: by 10.98.202.84 with SMTP id n81mr14228284pfg.226.1516264648659; Thu, 18 Jan 2018 00:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516264648; cv=none; d=google.com; s=arc-20160816; b=yQLRw92p1Xs9jSv+q2a08wzkjk/Js6ciTv5cKQXWCGke5hMyXY0NKeK5dsxsRKRgh2 fCUsMpBwP8sHH5139BDHCgFlWcwVjvvHTd+/IRb7OqquhTOH+01xEUgO2GdZRzXlXVgF 1SRanb3Yp511C69oxUZJVH7DfV9FgqSJU3Dm7iYzn1ZJtbDUqkX+Q4x8lFdOslu3ejqw exN+fbQb3jAAmMI4D6ZFrnH+ppxIwGjFMEgsmuaET6WWRYgjJB2NBatvOnLdYmtV6JZ7 dHoCwnfgXRk6+QDTs0u6vrTPclPgrmBUQxjz2I7cWdFiUQCryBXkWt+s+1AfbGZ84b+3 p6ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:mime-version:message-id:date:subject :cc:from:arc-authentication-results; bh=R1Eeopm4NIDIELahLGBn5zc+l6wg0iMYeJezbZf9Lx8=; b=TD/ThCtTBvO4TH75MxOVbd5XuZhDgAToF1neFNfmon8amgpf9lI9ew03U5m3EdcyXb 4TqOUFg1yhrxyLx5Y2B12X0x02vO0e13aBOpmrvK/vcKqqPauboywtoUe+1OlPI4Dfl2 lCLjXT0BZZnWhokIO6bHXxE4W7PruOxi+71VzlSyhgBhFH+XQhVP6m0xrY2Ylsyg4DPG lyNAQUNscvPDVCIVODlvsLjQHLqFGd+yNYOovNoGgFUUWPJCpBrvoRxWoYPQKKzbKTZC J4lUo4vRnIgksATVQgRQaXkiE6yi7jnyH6mQanZfHA/sdzZFBcMVYDhJ1ozBRQVXxsdc sGPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si5907476plo.208.2018.01.18.00.37.28; Thu, 18 Jan 2018 00:37:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754898AbeARIh0 (ORCPT + 28 others); Thu, 18 Jan 2018 03:37:26 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:56331 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753505AbeARIhZ (ORCPT ); Thu, 18 Jan 2018 03:37:25 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 02681F4260F86; Thu, 18 Jan 2018 16:37:05 +0800 (CST) Received: from dessert.huawei.com (10.69.192.158) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.361.1; Thu, 18 Jan 2018 16:36:57 +0800 From: Zeng Tao CC: , Zeng Tao , "Laura Abbott" , Sumit Semwal , "Greg Kroah-Hartman" , =?utf-8?q?Arve_Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Martijn Coenen , , Subject: [PATCH v2] 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 X-Originating-IP: [10.69.192.158] X-CFilter-Loop: Reflected To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/staging/android/ion/ion_system_heap.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 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)