<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel_samsung_smdk4412/kernel, branch replicant-6.0</title>
<subtitle>kernel/samsung/smdk4412
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/'/>
<entry>
<title>perf: protect group_leader from races that cause ctx double-free</title>
<updated>2016-12-12T13:14:53+00:00</updated>
<author>
<name>John Dias</name>
<email>joaodias@google.com</email>
</author>
<published>2016-10-10T21:44:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=12bf2ab391d33a49d74b123b66ef87c4ffa14e2e'/>
<id>12bf2ab391d33a49d74b123b66ef87c4ffa14e2e</id>
<content type='text'>
When moving a group_leader perf event from a software-context
to a hardware-context, there's a race in checking and
updating that context. The existing locking solution
doesn't work; note that it tries to grab a lock inside
the group_leader's context object, which you can only
get at by going through a pointer that should be protected
from these races. To avoid that problem, and to produce
a simple solution, we can just use a lock per group_leader
to protect all checks on the group_leader's context.
The new lock is grabbed and released when no context locks
are held.

RM-290

Bug: 30955111
Bug: 31095224
Change-Id: If37124c100ca6f4aa962559fba3bd5dbbec8e052
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When moving a group_leader perf event from a software-context
to a hardware-context, there's a race in checking and
updating that context. The existing locking solution
doesn't work; note that it tries to grab a lock inside
the group_leader's context object, which you can only
get at by going through a pointer that should be protected
from these races. To avoid that problem, and to produce
a simple solution, we can just use a lock per group_leader
to protect all checks on the group_leader's context.
The new lock is grabbed and released when no context locks
are held.

RM-290

Bug: 30955111
Bug: 31095224
Change-Id: If37124c100ca6f4aa962559fba3bd5dbbec8e052
</pre>
</div>
</content>
</entry>
<entry>
<title>BACKPORT: perf: Fix event-&gt;ctx locking</title>
<updated>2016-12-12T13:14:53+00:00</updated>
<author>
<name>Ariel Yin</name>
<email>ayin@google.com</email>
</author>
<published>2016-10-13T00:48:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=89634e6f964064a223fb81ddbce9a053a4f16686'/>
<id>89634e6f964064a223fb81ddbce9a053a4f16686</id>
<content type='text'>
There have been a few reported issues wrt. the lack of locking around
changing event-&gt;ctx. This patch tries to address those.

It avoids the whole rwsem thing; and while it appears to work, please
give it some thought in review.

What I did fail at is sensible runtime checks on the use of
event-&gt;ctx, the RCU use makes it very hard.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20150123125834.209535886@infradead.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;

(cherry picked from commit f63a8daa5812afef4f06c962351687e1ff9ccb2b)
Bug: 30955111
Bug: 31095224

Change-Id: I5bab713034e960fad467637e98e914440de5666d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There have been a few reported issues wrt. the lack of locking around
changing event-&gt;ctx. This patch tries to address those.

It avoids the whole rwsem thing; and while it appears to work, please
give it some thought in review.

What I did fail at is sensible runtime checks on the use of
event-&gt;ctx, the RCU use makes it very hard.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20150123125834.209535886@infradead.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;

(cherry picked from commit f63a8daa5812afef4f06c962351687e1ff9ccb2b)
Bug: 30955111
Bug: 31095224

Change-Id: I5bab713034e960fad467637e98e914440de5666d
</pre>
</div>
</content>
</entry>
<entry>
<title>BACKPORT: perf: Introduce perf_pmu_migrate_context()</title>
<updated>2016-12-12T13:14:52+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zheng.z.yan@intel.com</email>
</author>
<published>2012-06-15T06:31:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=ab5cf14fb4432d2550896d37e77aa88c335ce9b8'/>
<id>ab5cf14fb4432d2550896d37e77aa88c335ce9b8</id>
<content type='text'>
Originally from Peter Zijlstra. The helper migrates perf events
from one cpu to another cpu.

Conflicts (perf: Fix race in removing an event):
    kernel/events/core.c

Change-Id: I7885fe36c9e2803b10477d556163197085be3d19
Signed-off-by: Zheng Yan &lt;zheng.z.yan@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1339741902-8449-5-git-send-email-zheng.z.yan@intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Originally from Peter Zijlstra. The helper migrates perf events
from one cpu to another cpu.

Conflicts (perf: Fix race in removing an event):
    kernel/events/core.c

Change-Id: I7885fe36c9e2803b10477d556163197085be3d19
Signed-off-by: Zheng Yan &lt;zheng.z.yan@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1339741902-8449-5-git-send-email-zheng.z.yan@intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>BACKPORT: perf: Allow the PMU driver to choose the CPU on which to install events</title>
<updated>2016-12-12T13:14:52+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zheng.z.yan@intel.com</email>
</author>
<published>2012-06-15T06:31:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=55306f62c769cba0a97465b04790b8b9fbdce907'/>
<id>55306f62c769cba0a97465b04790b8b9fbdce907</id>
<content type='text'>
Allow the pmu-&gt;event_init callback to change event-&gt;cpu, so the PMU driver
can choose the CPU on which to install events.

Change-Id: I0f8b4310d306f4c87bc961f0359c2bdf65c129b6
Signed-off-by: Zheng Yan &lt;zheng.z.yan@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1339741902-8449-4-git-send-email-zheng.z.yan@intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow the pmu-&gt;event_init callback to change event-&gt;cpu, so the PMU driver
can choose the CPU on which to install events.

Change-Id: I0f8b4310d306f4c87bc961f0359c2bdf65c129b6
Signed-off-by: Zheng Yan &lt;zheng.z.yan@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1339741902-8449-4-git-send-email-zheng.z.yan@intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf: Fix race in swevent hash</title>
<updated>2016-11-11T02:26:51+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2015-12-15T12:49:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=b794ccaf33cd5ac7afa88df3bccaf11b4f1a0d55'/>
<id>b794ccaf33cd5ac7afa88df3bccaf11b4f1a0d55</id>
<content type='text'>
There's a race on CPU unplug where we free the swevent hash array
while it can still have events on. This will result in a
use-after-free which is BAD.

Simply do not free the hash array on unplug. This leaves the thing
around and no use-after-free takes place.

When the last swevent dies, we do a for_each_possible_cpu() iteration
anyway to clean these up, at which time we'll free it, so no leakage
will occur.

Change-Id: I751faf3215bbdaa6b6358f3a752bdd24126cfa0b
Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Tested-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's a race on CPU unplug where we free the swevent hash array
while it can still have events on. This will result in a
use-after-free which is BAD.

Simply do not free the hash array on unplug. This leaves the thing
around and no use-after-free takes place.

When the last swevent dies, we do a for_each_possible_cpu() iteration
anyway to clean these up, at which time we'll free it, so no leakage
will occur.

Change-Id: I751faf3215bbdaa6b6358f3a752bdd24126cfa0b
Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Tested-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smdk4412 : fix build</title>
<updated>2016-10-20T19:14:37+00:00</updated>
<author>
<name>RGIB</name>
<email>gibellini.roberto@gmail.com</email>
</author>
<published>2016-10-20T19:13:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=a20c4e114c47ab6c34025110cd44775df36079b0'/>
<id>a20c4e114c47ab6c34025110cd44775df36079b0</id>
<content type='text'>
Change-Id: I0e5b9979850042d790cb89996163bdc69a4c7879
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I0e5b9979850042d790cb89996163bdc69a4c7879
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Fix use after free in the recvmmsg exit path</title>
<updated>2016-10-18T13:33:04+00:00</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2016-03-14T12:56:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=8849894bfafa295d6a1acab288b6deec4dc26ca8'/>
<id>8849894bfafa295d6a1acab288b6deec4dc26ca8</id>
<content type='text'>
The syzkaller fuzzer hit the following use-after-free:

  Call Trace:
   [&lt;ffffffff8175ea0e&gt;] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:295
   [&lt;ffffffff851cc31a&gt;] __sys_recvmmsg+0x6fa/0x7f0 net/socket.c:2261
   [&lt;     inline     &gt;] SYSC_recvmmsg net/socket.c:2281
   [&lt;ffffffff851cc57f&gt;] SyS_recvmmsg+0x16f/0x180 net/socket.c:2270
   [&lt;ffffffff86332bb6&gt;] entry_SYSCALL_64_fastpath+0x16/0x7a
  arch/x86/entry/entry_64.S:185

And, as Dmitry rightly assessed, that is because we can drop the
reference and then touch it when the underlying recvmsg calls return
some packets and then hit an error, which will make recvmmsg to set
sock-&gt;sk-&gt;sk_err, oops, fix it.

Reported-and-Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Kostya Serebryany &lt;kcc@google.com&gt;
Cc: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Fixes: a2e2725541fa ("net: Introduce recvmmsg socket syscall")
http://lkml.kernel.org/r/20160122211644.GC2470@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Change-Id: Ie3b6ee89ad3e8cd3a0fe8f50f74aaa4834d0b4ca
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The syzkaller fuzzer hit the following use-after-free:

  Call Trace:
   [&lt;ffffffff8175ea0e&gt;] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:295
   [&lt;ffffffff851cc31a&gt;] __sys_recvmmsg+0x6fa/0x7f0 net/socket.c:2261
   [&lt;     inline     &gt;] SYSC_recvmmsg net/socket.c:2281
   [&lt;ffffffff851cc57f&gt;] SyS_recvmmsg+0x16f/0x180 net/socket.c:2270
   [&lt;ffffffff86332bb6&gt;] entry_SYSCALL_64_fastpath+0x16/0x7a
  arch/x86/entry/entry_64.S:185

And, as Dmitry rightly assessed, that is because we can drop the
reference and then touch it when the underlying recvmsg calls return
some packets and then hit an error, which will make recvmmsg to set
sock-&gt;sk-&gt;sk_err, oops, fix it.

Reported-and-Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Kostya Serebryany &lt;kcc@google.com&gt;
Cc: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Fixes: a2e2725541fa ("net: Introduce recvmmsg socket syscall")
http://lkml.kernel.org/r/20160122211644.GC2470@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

Change-Id: Ie3b6ee89ad3e8cd3a0fe8f50f74aaa4834d0b4ca
</pre>
</div>
</content>
</entry>
<entry>
<title>mm: add a field to store names for private anonymous memory</title>
<updated>2016-08-23T11:55:14+00:00</updated>
<author>
<name>Colin Cross</name>
<email>ccross@android.com</email>
</author>
<published>2015-10-05T14:13:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=8aa6fa75955db416644e6c9367b350c25cb6745c'/>
<id>8aa6fa75955db416644e6c9367b350c25cb6745c</id>
<content type='text'>
Userspace processes often have multiple allocators that each do
anonymous mmaps to get memory.  When examining memory usage of
individual processes or systems as a whole, it is useful to be
able to break down the various heaps that were allocated by
each layer and examine their size, RSS, and physical memory
usage.

This patch adds a user pointer to the shared union in
vm_area_struct that points to a null terminated string inside
the user process containing a name for the vma.  vmas that
point to the same address will be merged, but vmas that
point to equivalent strings at different addresses will
not be merged.

Userspace can set the name for a region of memory by calling
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, start, len, (unsigned long)name);
Setting the name to NULL clears it.

The names of named anonymous vmas are shown in /proc/pid/maps
as [anon:&lt;name&gt;] and in /proc/pid/smaps in a new "Name" field
that is only present for named vmas.  If the userspace pointer
is no longer valid all or part of the name will be replaced
with "&lt;fault&gt;".

The idea to store a userspace pointer to reduce the complexity
within mm (at the expense of the complexity of reading
/proc/pid/mem) came from Dave Hansen.  This results in no
runtime overhead in the mm subsystem other than comparing
the anon_name pointers when considering vma merging.  The pointer
is stored in a union with fieds that are only used on file-backed
mappings, so it does not increase memory usage.

Change-Id: I53b093d98dc24f41377824f34e076edced4a6f07
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Userspace processes often have multiple allocators that each do
anonymous mmaps to get memory.  When examining memory usage of
individual processes or systems as a whole, it is useful to be
able to break down the various heaps that were allocated by
each layer and examine their size, RSS, and physical memory
usage.

This patch adds a user pointer to the shared union in
vm_area_struct that points to a null terminated string inside
the user process containing a name for the vma.  vmas that
point to the same address will be merged, but vmas that
point to equivalent strings at different addresses will
not be merged.

Userspace can set the name for a region of memory by calling
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, start, len, (unsigned long)name);
Setting the name to NULL clears it.

The names of named anonymous vmas are shown in /proc/pid/maps
as [anon:&lt;name&gt;] and in /proc/pid/smaps in a new "Name" field
that is only present for named vmas.  If the userspace pointer
is no longer valid all or part of the name will be replaced
with "&lt;fault&gt;".

The idea to store a userspace pointer to reduce the complexity
within mm (at the expense of the complexity of reading
/proc/pid/mem) came from Dave Hansen.  This results in no
runtime overhead in the mm subsystem other than comparing
the anon_name pointers when considering vma merging.  The pointer
is stored in a union with fieds that are only used on file-backed
mappings, so it does not increase memory usage.

Change-Id: I53b093d98dc24f41377824f34e076edced4a6f07
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers:lmk: Fix double delete issue</title>
<updated>2016-06-13T04:47:40+00:00</updated>
<author>
<name>Hong-Mei Li</name>
<email>a21834@motorola.com</email>
</author>
<published>2015-03-13T02:14:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=ca7c9fad094f4413dcb2ce65d6d4983201295536'/>
<id>ca7c9fad094f4413dcb2ce65d6d4983201295536</id>
<content type='text'>
someone may change a process's oom_score_adj by proc fs, even though the
process has exited. In that case, the task was deleted from the rb tree
already, and the redundant deleting would trigger rb_erase panic finally.

In this patch, we make sure to clear the node after deteting and check
its empty status before rb_erase.

Change-Id: I7628c7d21011099e796b7d366cbc142f96bb8aab
Signed-off-by: Hong-Mei Li &lt;a21834@motorola.com&gt;
Reviewed-on: http://gerrit.mot.com/725306
SLTApproved: Slta Waiver &lt;sltawvr@motorola.com&gt;
SME-Granted: SME Approvals Granted
Tested-by: Jira Key &lt;jirakey@motorola.com&gt;
Reviewed-by: Sheng-Zhe Zhao &lt;a18689@motorola.com&gt;
Submit-Approved: Jira Key &lt;jirakey@motorola.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
someone may change a process's oom_score_adj by proc fs, even though the
process has exited. In that case, the task was deleted from the rb tree
already, and the redundant deleting would trigger rb_erase panic finally.

In this patch, we make sure to clear the node after deteting and check
its empty status before rb_erase.

Change-Id: I7628c7d21011099e796b7d366cbc142f96bb8aab
Signed-off-by: Hong-Mei Li &lt;a21834@motorola.com&gt;
Reviewed-on: http://gerrit.mot.com/725306
SLTApproved: Slta Waiver &lt;sltawvr@motorola.com&gt;
SME-Granted: SME Approvals Granted
Tested-by: Jira Key &lt;jirakey@motorola.com&gt;
Reviewed-by: Sheng-Zhe Zhao &lt;a18689@motorola.com&gt;
Submit-Approved: Jira Key &lt;jirakey@motorola.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: android: lowmemorykiller: implement task's adj rbtree</title>
<updated>2016-06-13T04:47:39+00:00</updated>
<author>
<name>Hong-Mei Li</name>
<email>a21834@motorola.com</email>
</author>
<published>2013-06-28T11:26:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=6f04da23b1e3aa60626bfef868ee89a77cebd637'/>
<id>6f04da23b1e3aa60626bfef868ee89a77cebd637</id>
<content type='text'>
Based on the current LMK implementation, LMK has to scan all processes to
select the correct task to kill during low memory.
The basic idea for the optimization is to :
queue all tasks with oom_score_adj priority, and then LMK just selects the
proper task from the queue(rbtree) to kill.

performance improvement:
the current implementation: average time to find a task to kill : 1004us
the optimized implementation: average time to find a task to kill: 43us

Change-Id: I4dbbdd5673314dbbdabb71c3eff0dc229ce4ea91
Signed-off-by: Hong-Mei Li &lt;a21834@motorola.com&gt;
Reviewed-on: http://gerrit.pcs.mot.com/548917
SLT-Approved: Slta Waiver &lt;sltawvr@motorola.com&gt;
Tested-by: Jira Key &lt;jirakey@motorola.com&gt;
Reviewed-by: Yi-Wei Zhao &lt;gbjc64@motorola.com&gt;
Submit-Approved: Jira Key &lt;jirakey@motorola.com&gt;
Signed-off-by: D. Andrei Măceș &lt;dmaces@nd.edu&gt;

Conflicts:
	drivers/staging/android/Kconfig
	drivers/staging/android/lowmemorykiller.c
	fs/proc/base.c
	mm/oom_kill.c

Conflicts:
	drivers/staging/android/lowmemorykiller.c
	mm/oom_kill.c

Conflicts:
	mm/oom_kill.c

Conflicts:
	drivers/staging/android/lowmemorykiller.c
	mm/oom_kill.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Based on the current LMK implementation, LMK has to scan all processes to
select the correct task to kill during low memory.
The basic idea for the optimization is to :
queue all tasks with oom_score_adj priority, and then LMK just selects the
proper task from the queue(rbtree) to kill.

performance improvement:
the current implementation: average time to find a task to kill : 1004us
the optimized implementation: average time to find a task to kill: 43us

Change-Id: I4dbbdd5673314dbbdabb71c3eff0dc229ce4ea91
Signed-off-by: Hong-Mei Li &lt;a21834@motorola.com&gt;
Reviewed-on: http://gerrit.pcs.mot.com/548917
SLT-Approved: Slta Waiver &lt;sltawvr@motorola.com&gt;
Tested-by: Jira Key &lt;jirakey@motorola.com&gt;
Reviewed-by: Yi-Wei Zhao &lt;gbjc64@motorola.com&gt;
Submit-Approved: Jira Key &lt;jirakey@motorola.com&gt;
Signed-off-by: D. Andrei Măceș &lt;dmaces@nd.edu&gt;

Conflicts:
	drivers/staging/android/Kconfig
	drivers/staging/android/lowmemorykiller.c
	fs/proc/base.c
	mm/oom_kill.c

Conflicts:
	drivers/staging/android/lowmemorykiller.c
	mm/oom_kill.c

Conflicts:
	mm/oom_kill.c

Conflicts:
	drivers/staging/android/lowmemorykiller.c
	mm/oom_kill.c
</pre>
</div>
</content>
</entry>
</feed>
