<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/android/binder_alloc.c, branch v4.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-10-21T08:14:20Z</updated>
<entry>
<title>android: binder: Fix null ptr dereference in debug msg</title>
<updated>2017-10-21T08:14:20Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-10-21T00:58:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ae65c8510f3319dfb2114cc48d476b81232e27b3'/>
<id>urn:sha1:ae65c8510f3319dfb2114cc48d476b81232e27b3</id>
<content type='text'>
Don't access next-&gt;data in kernel debug message when the
next buffer is null.

Acked-by: Arve Hjønnevåg &lt;arve@android.com&gt;
Signed-off-by: Sherry Yang &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: Don't get mm from task</title>
<updated>2017-10-21T08:14:20Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-10-21T00:58:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0c2baaf81bd53dc76fccdddc721ba7dbb62be21'/>
<id>urn:sha1:a0c2baaf81bd53dc76fccdddc721ba7dbb62be21</id>
<content type='text'>
Use binder_alloc struct's mm_struct rather than getting
a reference to the mm struct through get_task_mm to
avoid a potential deadlock between lru lock, task lock and
dentry lock, since a thread can be holding the task lock
and the dentry lock while trying to acquire the lru lock.

Acked-by: Arve Hjønnevåg &lt;arve@android.com&gt;
Signed-off-by: Sherry Yang &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: drop lru lock in isolate callback</title>
<updated>2017-10-04T00:54:24Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-10-03T23:15:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a1b2289cef92ef0e9a92afcd2e1ea71d5bcaaf64'/>
<id>urn:sha1:a1b2289cef92ef0e9a92afcd2e1ea71d5bcaaf64</id>
<content type='text'>
Drop the global lru lock in isolate callback before calling
zap_page_range which calls cond_resched, and re-acquire the global lru
lock before returning.  Also change return code to LRU_REMOVED_RETRY.

Use mmput_async when fail to acquire mmap sem in an atomic context.

Fix "BUG: sleeping function called from invalid context"
errors when CONFIG_DEBUG_ATOMIC_SLEEP is enabled.

Also restore mmput_async, which was initially introduced in commit
ec8d7c14ea14 ("mm, oom_reaper: do not mmput synchronously from the oom
reaper context"), and was removed in commit 212925802454 ("mm: oom: let
oom_reap_task and exit_mmap run concurrently").

Link: http://lkml.kernel.org/r/20170914182231.90908-1-sherryy@android.com
Fixes: f2517eb76f1f2 ("android: binder: Add global lru shrinker to binder")
Signed-off-by: Sherry Yang &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reported-by: Kyle Yan &lt;kyan@codeaurora.org&gt;
Acked-by: Arve Hjønnevåg &lt;arve@android.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Martijn Coenen &lt;maco@google.com&gt;
Cc: Todd Kjos &lt;tkjos@google.com&gt;
Cc: Riley Andrews &lt;riandrews@android.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Hillf Danton &lt;hdanton@sina.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Hoeun Ryu &lt;hoeun.ryu@gmail.com&gt;
Cc: Christopher Lameter &lt;cl@linux.com&gt;
Cc: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: Add page usage in binder stats</title>
<updated>2017-09-01T06:53:32Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-08-31T18:56:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ef4665aa129a14f3733efc651c53a3c6c47b500'/>
<id>urn:sha1:8ef4665aa129a14f3733efc651c53a3c6c47b500</id>
<content type='text'>
Add the number of active, lru, and free pages for
each binder process in binder stats

Signed-off-by: Sherry Yang &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: fixup crash introduced by moving buffer hdr</title>
<updated>2017-09-01T06:53:32Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-08-31T17:26:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=957ccc2bc8f9ebfe8b19112cdc6c2bb20fd7bcf8'/>
<id>urn:sha1:957ccc2bc8f9ebfe8b19112cdc6c2bb20fd7bcf8</id>
<content type='text'>
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.

Reported-by: kernel test robot &lt;fengguang.wu@intel.com&gt;
Fixes: 74310e06be4d ("android: binder: Move buffer out of area shared with user space")
Signed-off-by: Sherry Yang &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: Add shrinker tracepoints</title>
<updated>2017-08-28T14:47:17Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-08-23T15:46:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e41e164c3cdff632f7e4372d1d5a0df35338c370'/>
<id>urn:sha1:e41e164c3cdff632f7e4372d1d5a0df35338c370</id>
<content type='text'>
Add tracepoints in binder transaction allocator to
record lru hits and alloc/free page.

Signed-off-by: Sherry Yang &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: Add global lru shrinker to binder</title>
<updated>2017-08-28T14:47:17Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-08-23T15:46:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f2517eb76f1f2f7f89761f9db2b202e89931738c'/>
<id>urn:sha1:f2517eb76f1f2f7f89761f9db2b202e89931738c</id>
<content type='text'>
Hold on to the pages allocated and mapped for transaction
buffers until the system is under memory pressure. When
that happens, use linux shrinker to free pages. Without
using shrinker, patch "android: binder: Move buffer out
of area shared with user space" will cause a significant
slow down for small transactions that fit into the first
page because free list buffer header used to be inlined
with buffer data.

In addition to prevent the performance regression for
small transactions, this patch improves the performance
for transactions that take up more than one page.

Modify alloc 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 &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: Move buffer out of area shared with user space</title>
<updated>2017-08-28T14:47:17Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-08-23T15:46:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74310e06be4d74dcf67cd108366710dee5c576d5'/>
<id>urn:sha1:74310e06be4d74dcf67cd108366710dee5c576d5</id>
<content type='text'>
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 &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>android: binder: Refactor prev and next buffer into a helper function</title>
<updated>2017-08-28T14:47:17Z</updated>
<author>
<name>Sherry Yang</name>
<email>sherryy@android.com</email>
</author>
<published>2017-08-23T15:46:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e21762196118c272321532fe64c512efaa088b7e'/>
<id>urn:sha1:e21762196118c272321532fe64c512efaa088b7e</id>
<content type='text'>
Use helper functions buffer_next and buffer_prev instead
of list_entry to get the next and previous buffers.

Signed-off-by: Sherry Yang &lt;sherryy@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>binder: add more debug info when allocation fails.</title>
<updated>2017-07-17T12:47:29Z</updated>
<author>
<name>Martijn Coenen</name>
<email>maco@android.com</email>
</author>
<published>2017-06-29T19:01:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b05a68e94b97eae2ae671ed703416f8dd21e4257'/>
<id>urn:sha1:b05a68e94b97eae2ae671ed703416f8dd21e4257</id>
<content type='text'>
Display information about allocated/free space whenever
binder buffer allocation fails on synchronous
transactions.

Signed-off-by: Martijn Coenen &lt;maco@android.com&gt;
Signed-off-by: Siqi Lin &lt;siqilin@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
