Received: by 10.192.165.148 with SMTP id m20csp211834imm; Tue, 24 Apr 2018 20:45:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+4UPDDfsDPbU7Nigls0vU5k6/r5oGLHAE8RpbRCUlQK081LNxNpPHEVZccnbxwOctJJSly X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr23197549plb.297.1524627957388; Tue, 24 Apr 2018 20:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524627957; cv=none; d=google.com; s=arc-20160816; b=TGuha4fwB6NpblSFOnc7ZberYhdIPHNr+ZO1dq7M5BEfl0ScQzi5L6HTGwMgWqkPgq Q+nmgsmmDv5T47E8g4sxEZub9gfq85iuYJ/Ks5Q1il06twIKLPwVPw/Kpv/EkXsPiDr7 PaGuJnj0sVLhqMbRmbSoHV2xgKuy/DmQPEYqW+XVNqSOqGFus9vkzkn25A6ip1hDwLjt Db7eRKwvlyvZ/8MPsUArFj0tIBg6I7aFkz/SfPCiuG11/DqnZnCJalma5uft8a/zkCLF jcNP27zYsSRtMc1SZkvMFMywX6EsTdSvJcjUoaG3PYCaGkE7fZolc6Wf8W/ngZ7TqAfa sToQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=31D9SCu8215O6XpvEc8vqHA5CfZDEN3K2jgwI7MdffU=; b=ARDnpnO9+Uz/geJTMeRAmw4OYmUTIyOKNHQc3ejeFIXmV4kjOwkqpX03JkAX1wLdYs Ady6gqo5fkcBifgXGV+sIJPcU+sImy/6Y7HE0tyvu9tYmaq/hoJdkzOwdqikYZGJYIvD hk94TKXA0EH4pkelvkV+AAIBOJNRsrDeUQD+uBXTYpXrFPar8iP5/8YBO4ooofuTmo7a MrGPUHVz1ET4I1izp/S7ew7utgS9xqALsUpWmvhW9FksIEGJKL7prlm9SSz6J7A84PQd jmqUYr43rUvTsi5/DbojKu20bw0GSxUJqtVhgcDW+MVJGHbk9dzp+2N1KGtjXMq4T7ta 2NZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EMOxoNqI; dkim=pass header.i=@codeaurora.org header.s=default header.b=O8XCtg53; 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 d23si12550430pgv.512.2018.04.24.20.45.41; Tue, 24 Apr 2018 20:45:57 -0700 (PDT) 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; dkim=pass header.i=@codeaurora.org header.s=default header.b=EMOxoNqI; dkim=pass header.i=@codeaurora.org header.s=default header.b=O8XCtg53; 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 S1751251AbeDYDob (ORCPT + 99 others); Tue, 24 Apr 2018 23:44:31 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42412 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbeDYDo3 (ORCPT ); Tue, 24 Apr 2018 23:44:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1721D60AE0; Wed, 25 Apr 2018 03:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524627869; bh=401NGg41BEuDVUiH8GKa8EWJBzZJc8oI1TPMxWE36lk=; h=From:To:Cc:Subject:Date:From; b=EMOxoNqIcsZyPvSwMVsqQsb+qvAHrHn7vUUq4+2GWKMA+boDD2iuMoulTxYj2ji2M gSCPnzea18OAc3Lexf6rCXpaIOonGFca5vBLa+L62zmP8lJp49htYWFBAJMSPJd/G5 EpOIdpzJCoZGaPiJ8LonvAdLFZ1tKhP+cmAPIXaA= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from vjitta-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vjitta@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4B92F6071A; Wed, 25 Apr 2018 03:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524627868; bh=401NGg41BEuDVUiH8GKa8EWJBzZJc8oI1TPMxWE36lk=; h=From:To:Cc:Subject:Date:From; b=O8XCtg53dtF3UY1gqXzPAVj/lvWNeaaSGWyfGb4rF6O0ptmfqypWznrgo2kOrNNAj a+OWxk/Hav7eg0eYG0m4KpqxTw8SSBdeWF75SRQPx8yXJGqnDvxYOaMw/ibsRA01lY RaWI+tG3QvHhotMASPZlUohIzRJrxDp2ugY4DJU0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4B92F6071A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vjitta@codeaurora.org From: vjitta@codeaurora.org To: labbott@redhat.com, sumit.semwal@linaro.org Cc: gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com, maco@android.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Vijayanand Jitta Subject: [PATCH] ion: Consider ion pool pages as indirectly reclaimable Date: Wed, 25 Apr 2018 09:13:50 +0530 Message-Id: <1524627830-17187-1-git-send-email-vjitta@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vijayanand Jitta An issue is observed where mallocs are failing due to overcommit failure. The failure happens when there is high ION page pool since ION page pool is not considered reclaimable by the overcommit calculation code. This change considers ion pool pages as indirectly reclaimable and thus accounted as available memory in the overcommit calculation. Signed-off-by: Vijayanand Jitta --- drivers/staging/android/ion/ion_page_pool.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index db8f614..9bc56eb 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -32,6 +32,9 @@ static void ion_page_pool_add(struct ion_page_pool *pool, struct page *page) list_add_tail(&page->lru, &pool->low_items); pool->low_count++; } + + mod_node_page_state(page_pgdat(page), NR_INDIRECTLY_RECLAIMABLE_BYTES, + (1 << (PAGE_SHIFT + pool->order))); mutex_unlock(&pool->mutex); } @@ -50,6 +53,8 @@ static struct page *ion_page_pool_remove(struct ion_page_pool *pool, bool high) } list_del(&page->lru); + mod_node_page_state(page_pgdat(page), NR_INDIRECTLY_RECLAIMABLE_BYTES, + -(1 << (PAGE_SHIFT + pool->order))); return page; } -- 1.9.1