From: Gioh Kim <gioh.kim@lge.com>
To: Laura Abbott <lauraa@codeaurora.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
John Stultz <john.stultz@linaro.org>,
Rebecca Schultz Zavin <rebecca@android.com>
Cc: devel@driverdev.osuosl.org, gunho.lee@lge.com,
linux-kernel@vger.kernel.org
Subject: Re: [RFCv2 3/3] staging: ion: limit pool size
Date: Mon, 27 Oct 2014 09:48:45 +0900 [thread overview]
Message-ID: <544D966D.9060700@lge.com> (raw)
In-Reply-To: <544ABC53.5030300@codeaurora.org>
2014-10-25 오전 5:53, Laura Abbott 쓴 글:
> Hi,
>
> On 10/23/2014 11:47 PM, Gioh Kim wrote:
>> This patch limits pool size by page unit.
>>
>
> This looks useful. Might be nice to add a debugfs option
> to change this at runtime as well.
>
>> Signed-off-by: Gioh Kim <gioh.kim@lge.com>
>> ---
>> drivers/staging/android/ion/Kconfig | 4 ++++
>> drivers/staging/android/ion/ion_page_pool.c | 26 ++++++++++++++++----------
>> 2 files changed, 20 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/staging/android/ion/Kconfig b/drivers/staging/android/ion/Kconfig
>> index 3452346..e6b1a54 100644
>> --- a/drivers/staging/android/ion/Kconfig
>> +++ b/drivers/staging/android/ion/Kconfig
>> @@ -33,3 +33,7 @@ config ION_TEGRA
>> help
>> Choose this option if you wish to use ion on an nVidia Tegra.
>>
>> +config ION_POOL_LIMIT
>> + int "Limit count of pages in pool"
>> + depends on ION
>> + default "0"
>
> Can you add help text here? It would be useful to clarify that the
> units are in pages and that 0 will allow unlimited growth of the
> pool. This should also clarify that this is a limit per
> individual pool and not a limit for all page pools in the system.
>
>> diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c
>> index 165152f..d63e93f 100644
>> --- a/drivers/staging/android/ion/ion_page_pool.c
>> +++ b/drivers/staging/android/ion/ion_page_pool.c
>> @@ -22,8 +22,11 @@
>> #include <linux/module.h>
>> #include <linux/slab.h>
>> #include <linux/swap.h>
>> +#include <linux/kconfig.h>
>> #include "ion_priv.h"
>>
>> +#define POOL_LIMIT CONFIG_ION_POOL_LIMIT
>> +
>
> I don't think the extra #define helps anything here, was
> there something else intended here?
No, I just follow other codes.
If it isn't necessary, I will remove it at v2 patch.
>
>> static void *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
>> {
>> struct page *page = alloc_pages(pool->gfp_mask, pool->order);
>> @@ -41,8 +44,21 @@ static void ion_page_pool_free_pages(struct ion_page_pool *pool,
>> __free_pages(page, pool->order);
>> }
>>
>> +static int ion_page_pool_total(struct ion_page_pool *pool, bool high)
>> +{
>> + int count = pool->low_count;
>> +
>> + if (high)
>> + count += pool->high_count;
>> +
>> + return count << pool->order;
>> +}
>> +
>> static int ion_page_pool_add(struct ion_page_pool *pool, struct page *page)
>> {
>> + if (POOL_LIMIT && ion_page_pool_total(pool, 1) > POOL_LIMIT)
>> + return 1;
>> +
>> mutex_lock(&pool->mutex);
>> if (PageHighMem(page)) {
>> list_add_tail(&page->lru, &pool->high_items);
>> @@ -103,16 +119,6 @@ void ion_page_pool_free(struct ion_page_pool *pool, struct page *page)
>> ion_page_pool_free_pages(pool, page);
>> }
>>
>> -static int ion_page_pool_total(struct ion_page_pool *pool, bool high)
>> -{
>> - int count = pool->low_count;
>> -
>> - if (high)
>> - count += pool->high_count;
>> -
>> - return count << pool->order;
>> -}
>> -
>> int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask,
>> int nr_to_scan)
>> {
>>
>
> Thanks,
> Laura
>
prev parent reply other threads:[~2014-10-27 0:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 6:47 [RFCv2 0/3] enable pool shrinking in page unit Gioh Kim
2014-10-24 6:47 ` [RFCv2 1/3] staging: ion: shrink page-pool by " Gioh Kim
2014-10-24 20:09 ` Laura Abbott
2014-10-27 0:01 ` Gioh Kim
2014-10-24 6:47 ` [RFCv2 2/3] staging: ion: debugfs to shrink pool Gioh Kim
2014-10-24 20:38 ` Laura Abbott
2014-10-27 0:24 ` Gioh Kim
2014-10-24 6:47 ` [RFCv2 3/3] staging: ion: limit pool size Gioh Kim
2014-10-24 20:53 ` Laura Abbott
2014-10-27 0:48 ` Gioh Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=544D966D.9060700@lge.com \
--to=gioh.kim@lge.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=gunho.lee@lge.com \
--cc=john.stultz@linaro.org \
--cc=lauraa@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rebecca@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.