Revert "lowmemorykiller: Account for highmem during kswapd reclaim"

This reverts commit ab85d9ea25a45e56a66b85c9643d2ae3cec2cf1c.
Revert LOWMEMKILL short to int
Revert "staging:android:lmk: Use for_each_thread helper"

This reverts commit 51754ab23c701858a24008ff835502cf7fd0b700.
Revert "staging: android: lmk: check TIF directly"

This reverts commit a9265b8f6e87fabcb94b911c455fc24da018ff5d.
Revert "staging: android: lmk: skip if killed by lmk"

This reverts commit 41892b2023a88b17dc41755c9d203e13be7a3e43.
Revert "trace: memkill: provide fixed zone info columns."

This reverts commit c242df261048666d92f4571cc55ac8d2a139a6ba.
Revert "trace: memkill: per-zone page state for LMK"

This reverts commit e56bc013dd9ef6c5e77ece6918271e65469ae439.
Revert "mm, oom: change type of oom_score_adj to short"

This reverts commit fdc2401212f0840626867a4f8ec8e93dfd134a9a.
LOW MEM KILLIER: restore stock array sets.
alucard_hotplug: use unidimensional array for turning on/off cores.
alucard_hotplug: syncing with @dorimanx settings.
CMA: Release reserved 16MB RAM back to Low mem pool. LMK suffer.
staging: binder: do not debug errors

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
smp.h: Use local_irq_{save,restore}() in !SMP version of on_each_cpu().

Thanks to commit ("init: scream bloody murder if interrupts
are enabled too early"), "bloody murder" is now being screamed.

With a MIPS OCTEON config, we use on_each_cpu() in our
irq_chip.irq_bus_sync_unlock() function.  This gets called in early as a
result of the time_init() call.  Because the !SMP version of
on_each_cpu() unconditionally enables irqs, we get:

    WARNING: at init/main.c:560 start_kernel+0x250/0x410()
    Interrupts were enabled early
    CPU: 0 PID: 0 Comm: swapper Not tainted 3.10.0-rc5-Cavium-Octeon+ #801
    Call Trace:
      show_stack+0x68/0x80
      warn_slowpath_common+0x78/0xb0
      warn_slowpath_fmt+0x38/0x48
      start_kernel+0x250/0x410

Suggested fix: Do what we already do in the SMP version of
on_each_cpu(), and use local_irq_save/local_irq_restore.  Because we
need a flags variable, make it a static inline to avoid name space
issues.

[ Change from v1: Convert on_each_cpu to a static inline function, add
  #include <linux/irqflags.h> to avoid build breakage on some files.

  on_each_cpu_mask() and on_each_cpu_cond() suffer the same problem as
  on_each_cpu(), but they are not causing !SMP bugs for me, so I will
  defer changing them to a less urgent patch. ]

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
mmc: core: Fix unclocked access in get_xfer_remain/stop_request

The unclocked access could happen in the following scenario -

1. mmcqd thread is waiting for previously submitted io to be done
2. before this io is done, it is woken up due to is_urgent event
3. mmcqd thread is running and is processing the is_urgent event
4. Just about the same time the previously submitted io is done and
it sets is_done_rcv flag, tries to wake up mmcqd thread and release
host clock so as to gate the clocks.

If step 3 and 4 happen at the same time, then clocks will be gated off
before is_urgent is completely handled. Hence, make sure to hold the
clock before invoking get_xfer_remain and stop_request host->op.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: validate address before dumping it in OOPS message

As a part of kernel OOPS message, kernel treats every register
as memory pointer and dumps the memory area from an offset of
0x80. Add check to see if its a valid virtual address before
dumping it.

Such addresses may be part of CMA regions and they may
be protected at times. Therefore, while dumping such addresses
violations can potentially occur.

Additionally validate the pfn first as it may belong to a
carveout region which has no associated page object.

Add check to see if they belong to CMA region and don't dump
such addresses altogether to be safe.

CRs-Fixed: 696028,737215
Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
kprobe: delay blacklist symbol lookup

The symbol lookup can take a long time and kprobes
is iniitilized very early in boot, So delay symbol
lookup until the blacklist is first used.

Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
block: Switch from BFQ-v7r5 for 3.4.0 to BFQ-v7r6 for 3.4.0

. IMPROVEMENT: Introduced a new mechanism that helps get the job done
  more quickly for services and applications that create or reactivate
  many parallel I/O-bound processes. Examples are systemd at boot, or
  commands such as git grep.
. CODE IMPROVEMENTS: Small code cleanups and improvements.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched/deadline: Don't replenish from a !SCHED_DEADLINE entity

In the deboost path, right after the dl_boosted flag has been
reset, we can currently end up replenishing using -deadline
parameters of a !SCHED_DEADLINE entity. This of course causes
a bug, as those parameters are empty.

In the case depicted above it is safe to simply bail out, as
the deboosted task is going to be back to its original scheduling
class anyway.

Reported-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Tested-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: vincent@legout.info
Cc: Dario Faggioli <raistlin@linux.it>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Fabio Checconi <fchecconi@gmail.com>
Link: http://lkml.kernel.org/r/1414142198-18552-4-git-send-email-juri.lelli@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched/dl: Simplify pick_dl_task()

1) Nobody calls pick_dl_task() with negative cpu, it's old RT leftover.

2) If p->nr_cpus_allowed is 1, than the affinity has just been changed
  in set_cpus_allowed_ptr(); we'll pick it just earlier than migration
  thread.

Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1410529340.3569.27.camel@tkhai
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>