[PATCH] android: binder: no outgoing transaction when thread todo has transaction

2018-08-13 Thread Sherry Yang
e waiting for proc work can directly receive work from another thread, and no work is allowed to be queued on such a thread without waking up the thread. This patch also enforces that a thread is not waiting for proc work when a work is directly enqueued to its todo list. Acked-by: Arve Hjønnevåg

[PATCH v2] android: binder: Rate-limit debug and userspace triggered err msgs

2018-08-07 Thread Sherry Yang
Use rate-limited debug messages where userspace can trigger excessive log spams. Acked-by: Arve Hjønnevåg Signed-off-by: Sherry Yang --- v2: rebase onto char-misc-next to resolve include order difference from master drivers/android/binder.c | 5 +++-- drivers/android/binder_alloc.c

[PATCH 1/2] android: binder: Show extra_buffers_size in trace

2018-07-26 Thread Sherry Yang
Add extra_buffers_size to the binder_transaction_alloc_buf tracepoint. Acked-by: Arve Hjønnevåg Signed-off-by: Sherry Yang --- drivers/android/binder_trace.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/android/binder_trace.h b/drivers/android

[PATCH 2/2] android: binder: Rate-limit debug and userspace triggered err msgs

2018-07-26 Thread Sherry Yang
Use rate-limited debug messages where userspace can trigger excessive log spams. Acked-by: Arve Hjønnevåg Signed-off-by: Sherry Yang --- drivers/android/binder.c | 5 +++-- drivers/android/binder_alloc.c | 41 +- 2 files changed, 29 insertions(+), 17

Re: [PATCH] android: binder: Check for errors in binder_alloc_shrinker_init().

2017-12-06 Thread Sherry Yang
, 2017 at 8:29 AM, Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp> wrote: > Both list_lru_init() and register_shrinker() might return an error. > > Signed-off-by: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp> > Cc: Sherry Yang <sher...@android.com>

[PATCH v2 1/4] android: binder: Don't get mm from task

2017-10-20 Thread Sherry Yang
Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 22 +- drivers/android/binder_alloc.h | 1 - 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/android/binder_alloc.c b/dri

[PATCH v2 2/4] android: binder: Fix null ptr dereference in debug msg

2017-10-20 Thread Sherry Yang
Don't access next->data in kernel debug message when the next buffer is null. Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH v2 4/4] android: binder: Change binder_shrinker to static

2017-10-20 Thread Sherry Yang
binder_shrinker struct is not used anywhere outside of binder_alloc.c and should be static. Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH v2 3/4] android: binder: Remove unused vma argument

2017-10-20 Thread Sherry Yang
The vma argument in update_page_range is no longer used after 74310e06 ("android: binder: Move buffer out of area shared with user space"), since mmap_handler no longer calls update_page_range with a vma. Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <

[PATCH 1/2] android: binder: Change binder_shrinker to static

2017-10-06 Thread Sherry Yang
binder_shrinker struct is not used anywhere outside of binder_alloc.c and should be static. Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH 2/2] android: binder: Fix null ptr dereference in debug msg

2017-10-06 Thread Sherry Yang
Don't access next->data in kernel debug message when the next buffer is null. Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH 1/2] android: binder: Remove unused vma argument

2017-09-15 Thread Sherry Yang
The vma argument in update_page_range is no longer used after 74310e06 ("android: binder: Move buffer out of area shared with user space"), since mmap_handler no longer calls update_page_range with a vma. Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <

[PATCH 2/2] android: binder: Don't get mm from task

2017-09-15 Thread Sherry Yang
Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 22 +- drivers/android/binder_alloc.h | 1 - 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/android/binder_alloc.c b/dri

[PATCH v2] android: binder: Drop lru lock in isolate callback

2017-09-14 Thread Sherry Yang
m_reap_task and exit_mmap run concurrently"). Fixes: f2517eb76f1f2 ("android: binder: Add global lru shrinker to binder") Reported-by: Kyle Yan <k...@codeaurora.org> Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by: Sherry Yang <sher...@android.com> --- Chang

Re: [PATCH 2/5] android: binder: Add allocator selftest

2017-09-10 Thread Sherry Yang
is not enabled. Thanks, Sherry On Sun, Sep 10, 2017 at 7:48 AM, Geert Uytterhoeven <ge...@linux-m68k.org> wrote: > Hi Sherry, > > On Wed, Aug 16, 2017 at 2:25 AM, Sherry Yang <sher...@android.com> wrote: >> binder_alloc_selftest tests that alloc_new_buf handles page allocation a

[PATCH] android: binder: Drop lru lock in isolate callback

2017-09-08 Thread Sherry Yang
ction called from invalid context" errors when CONFIG_DEBUG_ATOMIC_SLEEP is enabled. Fixes: f2517eb76f1f2 ("android: binder: Add global lru shrinker to binder") Reported-by: Kyle Yan <k...@codeaurora.org> Acked-by: Arve Hjønnevåg <a...@android.com> Signed-off-by:

[PATCH] android: binder: Add page usage in binder stats

2017-08-31 Thread Sherry Yang
Add the number of active, lru, and free pages for each binder process in binder stats Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder.c | 2 ++ drivers/android/binder_alloc.c | 28 drivers/android/binder_alloc.h | 2 ++ 3

Re: [PATCH v3 1/6] android: binder: Refactor prev and next buffer into a helper function

2017-08-31 Thread Sherry Yang
On Wed, Aug 30, 2017 at 9:28 PM, Greg Kroah-Hartman wrote: > Ok, exactly what git commit ids should I revert from the tree? But > really, a fix would be easier at this point :) I sent a fixup patch as a separate reply to this email. Please also apply [patch v3 6/6]

[PATCH] android: binder: fixup crash introduced by moving buffer hdr

2017-08-31 Thread Sherry Yang
Fix crash introduced by 74310e06be4d74dcf67cd108366710dee5c576d5 (android: binder: Move buffer out of area shared with user space) when close is called after open without mmap in between. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 2 +- 1 file c

Re: [PATCH v3 1/6] android: binder: Refactor prev and next buffer into a helper function

2017-08-30 Thread Sherry Yang
On Tue, Aug 29, 2017 at 11:07 PM, Greg Kroah-Hartman <gre...@linuxfoundation.org> wrote: > On Tue, Aug 29, 2017 at 05:46:57PM -0700, Sherry Yang wrote: >> Use helper functions buffer_next and buffer_prev instead >> of list_entry to get the next and previous buffers. >&g

[PATCH v3 3/6] android: binder: Move buffer out of area shared with user space

2017-08-29 Thread Sherry Yang
ers initialization from mmap to init since it's now used even when mmap failed or was not called. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 146 +++- drivers/android/binder_alloc.h | 2 +- driver

[PATCH v3 4/6] android: binder: Add global lru shrinker to binder

2017-08-29 Thread Sherry Yang
c selftest to work with the shrinker change. Test: Run memory intensive applications (Chrome and Camera) to trigger shrinker callbacks. Binder frees memory as expected. Test: Run binderThroughputTest with high memory pressure option enabled. Signed-off-by: Sherry Yang <sher...@android.com&

[PATCH v3 6/6] android: binder: Add page usage in binder stats

2017-08-29 Thread Sherry Yang
Add the number of active, lru, and free pages for each binder process in binder stats Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder.c | 2 ++ drivers/android/binder_alloc.c | 28 drivers/android/binder_alloc.h | 2 ++ 3

[PATCH v3 2/6] android: binder: Add allocator selftest

2017-08-29 Thread Sherry Yang
the device with ANDROID_BINDER_IPC_SELFTEST config option enabled. Allocator selftest passes. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/Kconfig | 10 ++ drivers/android/Makefile| 1 + drivers/android/binder.c

[PATCH v3 5/6] android: binder: Add shrinker tracepoints

2017-08-29 Thread Sherry Yang
Add tracepoints in binder transaction allocator to record lru hits and alloc/free page. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 27 +++-- drivers/android/binder_trace.h | 55 ++ 2 files c

[PATCH v3 1/6] android: binder: Refactor prev and next buffer into a helper function

2017-08-29 Thread Sherry Yang
Use helper functions buffer_next and buffer_prev instead of list_entry to get the next and previous buffers. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/d

[PATCH v2 0/5] android: binder: move allocator metadata and add shrinker

2017-08-23 Thread Sherry Yang
This patch set moves internal kernel data in the binder driver out of mmap regions that is readable by user space. A shrinker is added to the driver to dynamically manage the memory used by binder transactions and only free pages when the system is under memory pressure. This patch set also adds

[PATCH v2 4/5] android: binder: Add global lru shrinker to binder

2017-08-23 Thread Sherry Yang
c selftest to work with the shrinker change. Test: Run memory intensive applications (Chrome and Camera) to trigger shrinker callbacks. Binder frees memory as expected. Test: Run binderThroughputTest with high memory pressure option enabled. Signed-off-by: Sherry Yang <sher...@android.com&

[PATCH v2 5/5] android: binder: Add shrinker tracepoints

2017-08-23 Thread Sherry Yang
Add tracepoints in binder transaction allocator to record lru hits and alloc/free page. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 27 +++-- drivers/android/binder_trace.h | 55 ++ 2 files c

[PATCH v2 3/5] android: binder: Move buffer out of area shared with user space

2017-08-23 Thread Sherry Yang
Binder driver allocates buffer meta data in a region that is mapped in user space. These meta data contain pointers in the kernel. This patch allocates buffer meta data on the kernel heap that is not mapped in user space, and uses a pointer to refer to the data mapped. Signed-off-by: Sherry Yang

[PATCH v2 2/5] android: binder: Add allocator selftest

2017-08-23 Thread Sherry Yang
the device with ANDROID_BINDER_IPC_SELFTEST config option enabled. Allocator selftest passes. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/Kconfig | 10 ++ drivers/android/Makefile| 1 + drivers/android/binder.c

[PATCH v2 1/5] android: binder: Refactor prev and next buffer into a helper function

2017-08-23 Thread Sherry Yang
Use helper functions buffer_next and buffer_prev instead of list_entry to get the next and previous buffers. Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/d

[PATCH 1/5] android: binder: Refactor prev and next buffer into a helper function

2017-08-15 Thread Sherry Yang
Change-Id: Ie2a446ad9907f0d306fd1b8e6d79d87e48826ce2 Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_a

[PATCH 5/5] android: binder: Add shrinker tracepoints

2017-08-15 Thread Sherry Yang
Add tracepoints in binder transaction allocator to record lru hits and alloc/free page. Change-Id: I7715f943c57d6172c35bdff8298d8c5aef24a51a Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 27 +++-- drivers/android/binder_trace.

[PATCH 3/5] android: binder: Move buffer out of area shared with user space

2017-08-15 Thread Sherry Yang
: Ie19d2393a5015d9ee8bc26c41ce27e6eaa6e52fb Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder_alloc.c | 144 +++- drivers/android/binder_alloc.h | 2 +- drivers/android/binder_alloc_selftest.c | 11 ++- 3 files changed, 90 insertions(

[PATCH 2/5] android: binder: Add allocator selftest

2017-08-15 Thread Sherry Yang
the device with ANDROID_BINDER_IPC_SELFTEST config option enabled. Allocator selftest passes. Change-Id: I9064f60c85b1e0389c88e927e2b147ec92cae0d1 Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/Kconfig | 10 ++ drivers/android/Makefile

[PATCH 4/5] android: binder: Add global lru shrinker to binder

2017-08-15 Thread Sherry Yang
Signed-off-by: Sherry Yang <sher...@android.com> --- drivers/android/binder.c| 2 + drivers/android/binder_alloc.c | 172 +++- drivers/android/binder_alloc.h | 23 - drivers/android/binder_alloc_selftest.c | 68 ++---