Hi Cheeramvelil & Hilman,
I found this patch do not ACK into the kernel mainline, and there is an obvious logical error.
commit 7f00db6493e69a3b6b7b9929218b127c62e6a53b Author: Vinil Cheeramvelil vinil.cheeramvelil@intel.com Date: Wed Jul 8 10:35:06 2015 +0800
ion: Handle the memory mapping correctly on x86
This patch modifies the ion page pool code to address limitation in x86 PAT. When one physical page is mapped to multiple virtual pages, the same cache policy should be used. Add set_memory_wc/uc call to avoid aliases. If not, all mappings will be cached(write back).
Change-Id: I98ee8902df0c80135dddfa998c4ca4c2bb44e40e Signed-off-by: Zhebin Jin zhebin.jin@intel.com Signed-off-by: Vinil Cheeramvelil vinil.cheeramvelil@intel.com
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index da2a63c..1f9feb7 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -85,8 +85,10 @@ static void free_buffer_page(struct ion_system_heap *heap,
if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) { struct ion_page_pool *pool = heap->pools[order_to_index(order)]; - - ion_page_pool_free(pool, page); + if (buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE) + ion_page_pool_free_immediate(pool, page); + else + ion_page_pool_free(pool, page);
the if else here is totally redundant } else { __free_pages(page, order); }
Hi Chenfeng,
On 14 January 2016 at 12:58, chenfeng puck.chen@hisilicon.com wrote:
Hi Cheeramvelil & Hilman,
I found this patch do not ACK into the kernel mainline, and there is an obvious logical error.
Good catch. This patch came from aosp/android-4.1 https://android.googlesource.com/kernel/common/+/7f00db6493e69a3b6b7b9929218.... Please send the relevant fix to AOSP for review.
Regards, Amit Pundir
commit 7f00db6493e69a3b6b7b9929218b127c62e6a53b Author: Vinil Cheeramvelil vinil.cheeramvelil@intel.com Date: Wed Jul 8 10:35:06 2015 +0800
ion: Handle the memory mapping correctly on x86 This patch modifies the ion page pool code to address limitation in x86 PAT. When one physical page is mapped to multiple virtual pages, the same cache policy should be used. Add set_memory_wc/uc call to avoid aliases. If not, all mappings will be cached(write back). Change-Id: I98ee8902df0c80135dddfa998c4ca4c2bb44e40e Signed-off-by: Zhebin Jin <zhebin.jin@intel.com> Signed-off-by: Vinil Cheeramvelil <vinil.cheeramvelil@intel.com>
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index da2a63c..1f9feb7 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -85,8 +85,10 @@ static void free_buffer_page(struct ion_system_heap *heap,
if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) { struct ion_page_pool *pool = heap->pools[order_to_index(order)];
ion_page_pool_free(pool, page);
if (buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)
ion_page_pool_free_immediate(pool, page);
else
ion_page_pool_free(pool, page);
the if else here is totally redundant } else { __free_pages(page, order); }
Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev
Looks like an integration error. Please refer to the original patch: https://android-review.googlesource.com/#/c/163703/
- if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) { + if (!cached) { struct ion_page_pool *pool = heap->pools[order_to_index(order)]; - - ion_page_pool_free(pool, page); + if (buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE) + ion_page_pool_free_immediate(pool, page); + else + ion_page_pool_free(pool, page); } else { __free_pages(page, order); }
Best Regards Zhebin Jin
-----Original Message----- From: Amit Pundir [mailto:amit.pundir@linaro.org] Sent: Thursday, January 14, 2016 16:14 To: chenfeng Cc: Jin, Zhebin; Cheeramvelil, Vinil; Kevin Hilman; dev; Dan zhao; Peter Panshilin; Yiping Xu; Suzhuangluan Subject: Re: [Dev] linaro branch [lsk-android-v4.1]
Hi Chenfeng,
On 14 January 2016 at 12:58, chenfeng puck.chen@hisilicon.com wrote:
Hi Cheeramvelil & Hilman,
I found this patch do not ACK into the kernel mainline, and there is an obvious logical error.
Good catch. This patch came from aosp/android-4.1 https://android.googlesource.com/kernel/common/+/7f00db6493e69a3b6b7b9929218.... Please send the relevant fix to AOSP for review.
Regards, Amit Pundir
commit 7f00db6493e69a3b6b7b9929218b127c62e6a53b Author: Vinil Cheeramvelil vinil.cheeramvelil@intel.com Date: Wed Jul 8 10:35:06 2015 +0800
ion: Handle the memory mapping correctly on x86 This patch modifies the ion page pool code to address limitation in x86 PAT. When one physical page is mapped to multiple virtual pages, the same cache policy should be used. Add set_memory_wc/uc call to avoid aliases. If not, all mappings will be cached(write back). Change-Id: I98ee8902df0c80135dddfa998c4ca4c2bb44e40e Signed-off-by: Zhebin Jin <zhebin.jin@intel.com> Signed-off-by: Vinil Cheeramvelil <vinil.cheeramvelil@intel.com>
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index da2a63c..1f9feb7 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -85,8 +85,10 @@ static void free_buffer_page(struct ion_system_heap *heap,
if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) { struct ion_page_pool *pool =
heap->pools[order_to_index(order)];
ion_page_pool_free(pool, page);
if (buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)
ion_page_pool_free_immediate(pool, page);
else
ion_page_pool_free(pool, page);
the if else here is totally redundant } else { __free_pages(page, order); }
Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev