LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ion: Consider ion pool pages as indirectly reclaimable
@ 2018-04-25  3:43 vjitta
  2018-04-25 15:47 ` Laura Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: vjitta @ 2018-04-25  3:43 UTC (permalink / raw)
  To: labbott, sumit.semwal
  Cc: devel, tkjos, gregkh, linux-kernel, arve, Vijayanand Jitta, maco

From: Vijayanand Jitta <vjitta@codeaurora.org>

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 <vjitta@codeaurora.org>
---
 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

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ion: Consider ion pool pages as indirectly reclaimable
  2018-04-25  3:43 [PATCH] ion: Consider ion pool pages as indirectly reclaimable vjitta
@ 2018-04-25 15:47 ` Laura Abbott
  2018-04-27  5:10   ` vjitta
  0 siblings, 1 reply; 5+ messages in thread
From: Laura Abbott @ 2018-04-25 15:47 UTC (permalink / raw)
  To: vjitta, sumit.semwal; +Cc: gregkh, arve, tkjos, maco, devel, linux-kernel

On 04/24/2018 08:43 PM, vjitta@codeaurora.org wrote:
> From: Vijayanand Jitta <vjitta@codeaurora.org>
> 
> 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 <vjitta@codeaurora.org>
> ---
>   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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ion: Consider ion pool pages as indirectly reclaimable
  2018-04-25 15:47 ` Laura Abbott
@ 2018-04-27  5:10   ` vjitta
  2018-04-27  9:29     ` vjitta
  0 siblings, 1 reply; 5+ messages in thread
From: vjitta @ 2018-04-27  5:10 UTC (permalink / raw)
  To: Laura Abbott
  Cc: devel, linux-kernel-owner, tkjos, gregkh, linux-kernel, arve,
	maco, sumit.semwal

On 2018-04-25 21:17, Laura Abbott wrote:
> On 04/24/2018 08:43 PM, vjitta@codeaurora.org wrote:
>> From: Vijayanand Jitta <vjitta@codeaurora.org>
>> 
>> 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 <vjitta@codeaurora.org>
>> ---
>>   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
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ion: Consider ion pool pages as indirectly reclaimable
  2018-04-27  5:10   ` vjitta
@ 2018-04-27  9:29     ` vjitta
  2018-04-27 21:30       ` Laura Abbott
  0 siblings, 1 reply; 5+ messages in thread
From: vjitta @ 2018-04-27  9:29 UTC (permalink / raw)
  To: Laura Abbott
  Cc: devel, linux-kernel-owner, tkjos, gregkh, linux-kernel, arve,
	maco, sumit.semwal

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 <vjitta@codeaurora.org>
>>> 
>>> 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 <vjitta@codeaurora.org>
>>> ---
>>>   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
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ion: Consider ion pool pages as indirectly reclaimable
  2018-04-27  9:29     ` vjitta
@ 2018-04-27 21:30       ` Laura Abbott
  0 siblings, 0 replies; 5+ messages in thread
From: Laura Abbott @ 2018-04-27 21:30 UTC (permalink / raw)
  To: vjitta
  Cc: devel, linux-kernel-owner, tkjos, gregkh, linux-kernel, arve,
	maco, sumit.semwal

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 <vjitta@codeaurora.org>
>>>>
>>>> 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 <vjitta@codeaurora.org>
>>>> ---
>>>>   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 <labbott@redhat.com>

Thanks,
Laura

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-27 21:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25  3:43 [PATCH] ion: Consider ion pool pages as indirectly reclaimable vjitta
2018-04-25 15:47 ` Laura Abbott
2018-04-27  5:10   ` vjitta
2018-04-27  9:29     ` vjitta
2018-04-27 21:30       ` Laura Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).