Received: by 10.192.165.148 with SMTP id m20csp1192781imm; Fri, 27 Apr 2018 14:32:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr5Ybq+JpQDk+faifJPUfTXxp/XeBoODweXo4nLtpc+SAQT9+R6noyXbWK/YyXuhtgu7mIK X-Received: by 2002:a17:902:ab86:: with SMTP id f6-v6mr3216549plr.185.1524864745824; Fri, 27 Apr 2018 14:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524864745; cv=none; d=google.com; s=arc-20160816; b=OdG3IWpRkkQzjg0yEW5/mfiboq1e3GGXt9PEscPHvOAIxm+L3RVy3XAcVVlV7+HbG6 Sm8YURcMPk4MyRJ9yWOYE87fzm6jchB86q40V6K+wSdZLmIqAk+1zrm1UxK0lp/oJBnX xHVVpFL3UMN1e3COB7/LRPeHsNzrluRnaWBTejH7n/HaVvDX4mmKw70MzG+faSAe0by/ d/CkV1fRY/3I2YluUdTtrOwsjM2HkTM0pdQPSx3LlgNjNtgZ7CyJ5ygF8q2P1k5jpnss JoGCUmKYcmVlkVGbWV0Qq4R6sscOrlCxPKVSOzza3/bG6p73rcssX2BwGVDx/nLoUKVP 6DUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=J3fzGz8YFYRHNmjunBVOfaCtPuTEug7aqMJxNDBLEq0=; b=R4gltnspc9AIwl3UT9uRs7ohP8wWFCvV8Qt+wGNlsr0Cx13JyYm/I5ZRrnex9pnfU2 M7sp3S/xlNAEmnL/gbLq+YRbU3B/y3rzj0lTSuQOYy4Wt7TpF0ZPI649rAkoFQFm/Lmp jvqoIEKL+REQ1Zi3EBq+ffAHKNdEuS95r8O0NZi9uHQUWMdnsNn3U+m6eihd1EBgHMxA vF2cspCB5Q3WAoiQdVmU6uxiWMR9hlvdPyid49fcmNAONvu/gHHKUTmhUcogTT3dtS3N KZGWpMDY1AQHpzLgT3VVp1Zvmg9gDkrbdjP+d4fv63LBelCtWhD8ik7hW6Mgbmb+XJcY Vtsg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si1912900pgt.407.2018.04.27.14.32.10; Fri, 27 Apr 2018 14:32:25 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759290AbeD0VbD (ORCPT + 99 others); Fri, 27 Apr 2018 17:31:03 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:36702 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757815AbeD0VbC (ORCPT ); Fri, 27 Apr 2018 17:31:02 -0400 Received: by mail-oi0-f66.google.com with SMTP id v2-v6so2819605oif.3 for ; Fri, 27 Apr 2018 14:31:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J3fzGz8YFYRHNmjunBVOfaCtPuTEug7aqMJxNDBLEq0=; b=uDhFwvT5pMjSGbwoEakiUWHULGZzW1B0RqYSqQDiiwdpxyZrOV7TmLxoVqgDinjZZQ uO279FWxy2Km3SlT0dt+LBmMRWv4h3M4VZjEtLnSAkxs7LjY1z9Ytorn5uNm9dycZxiG JOPnJHoeiYy/DpOA71N4/RRZBmL3NNY6EY7leCQHZbWPgrnhzsx7PoFBjvDqtKM5okrl KddcMy2CKHvl1HmobGW1vaoezbofGLBqgLf+8cJLjN4M1vqOPDegfclsCUus51HayHF3 doKIR6OjhPCec4FypJ8w1wO/ei98jDhsooHjN5aYefSHix7F7Ct7RWnvWek8LcwiIGEL 54mQ== X-Gm-Message-State: ALQs6tD/3+UCi6ExO/e6XIMirMLzElxrGgBQtWj0obdWxGUOH9cjEnz9 h+tRlCWO29/TIy5e0009OgKfEA== X-Received: by 2002:aca:d10:: with SMTP id 16-v6mr2326279oin.108.1524864661862; Fri, 27 Apr 2018 14:31:01 -0700 (PDT) Received: from ?IPv6:2601:602:9802:a8dc::d2dd? ([2601:602:9802:a8dc::d2dd]) by smtp.gmail.com with ESMTPSA id 59-v6sm1262104ott.5.2018.04.27.14.30.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Apr 2018 14:31:00 -0700 (PDT) Subject: Re: [PATCH] ion: Consider ion pool pages as indirectly reclaimable To: vjitta@codeaurora.org Cc: sumit.semwal@linaro.org, gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com, maco@android.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-kernel-owner@vger.kernel.org References: <1524627830-17187-1-git-send-email-vjitta@codeaurora.org> <8618859b-06f9-39a7-80a9-af36cf9faf9f@redhat.com> From: Laura Abbott Message-ID: <38cf04f1-bded-7edf-4455-6e6c284277b8@redhat.com> Date: Fri, 27 Apr 2018 14:30:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/27/2018 02:29 AM, vjitta@codeaurora.org wrote: > On 2018-04-27 10:40, vjitta@codeaurora.org wrote: >> On 2018-04-25 21:17, Laura Abbott wrote: >>> On 04/24/2018 08:43 PM, vjitta@codeaurora.org wrote: >>>> 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; >>>>   } >>>> >>> >>> I'm sure this fixes the problem but I don't think we want to >>> start throwing page adjustments into Ion. Why isn't this >>> memory already considered reclaimable by existing calculations? >>> >>> Thanks, >>> Laura >> >> You can refer to discussion here https://lkml.org/lkml/2018/3/5/361 introducing >> NR_INDIRECTLY_RECLAIMABLE_BYTES for the memory which is not currently considered >> as reclaimable >> >> Thanks, >> Vijay > > There was also discussion specific to ion in that thread you can find it here > https://lkml.org/lkml/2018/4/25/642 > > Thanks, > Vijay Thanks for pointing that thread out. I'm still a little wary since Ion is in staging but if the rest of mm are okay with it Acked-by: Laura Abbott Thanks, Laura