mm, oom: fix potential killing of thread that is disabled from oom killing

/proc/sys/vm/oom_kill_allocating_task will immediately kill current when
the oom killer is called to avoid a potentially expensive tasklist scan
for large systems.

Currently, however, it is not checking current's oom_score_adj value
which may be OOM_SCORE_ADJ_MIN, meaning that it has been disabled from
oom killing.

This patch avoids killing current in such a condition and simply falls
back to the tasklist scan since memory still needs to be freed.

Signed-off-by: David Rientjes <rientjes@google.com>
modified for TUNA kernel from Linux 3.5+ by faux123
sched: clock wrap bug in 2.6.35-stable kills scheduling

On Mon, 2012-06-25 at 11:45 +0200, Peter Zijlstra wrote:
> On Sun, 2012-06-24 at 19:32 +0200, Thomas Lange wrote:
> > Bug was introduced in 2.6.35.12 and is still present in linux-2.6.35.y HEAD.
>
> Ok, so nobody cares about that.. what does something recent like 3.5-rc4
> do?
>
> If that's fixed, find the patch that fixes it. If not, we'll have a
> look.

If anything, I think something like the below ought to cure things.
USB: gadget: f_mtp: fix send ZLP packet algorithm.

USB: gadget: f_mtp: fix send ZLP packet algorithm.

If size of the data that sent from MTP-device to computer is a multiple of
wMaxPacketSize (usb endpoint) then at the end of transfer device must
send ZLP packet. Previously in f_mtp module a variable 'maxpacket' that
used to send ZLP packet was always equal to 512. For USB2.0 wMaxPacketSize
equals 512 but for USB1.1 wMaxPacketSize can be 64, 32, 16 or 8. Now variable
'maxpacket' contains real value of wMaxPacketSize in all USB modes and ZLP
packet is sent correctly for USB1.1.

Change-Id: I75606c954119dea2a76d955849a47208df0d2db0
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Revert "usb: gadget: rndis: don't use dev_get_stats"

This reverts commit ffdab0c0c40bab6de78b1952bb07aed221994b73.

Not needed anymore in 2.6.39 and 3.0, dev_get_stats has been fixed
and may be called from atomic context. See:
1ac9ad1 net: remove dev_txq_stats_fold()
Input: evdev - Add ioctl to block suspend while event queue is not empty.

Add an ioctl, EVIOCSSUSPENDBLOCK, to enable a wakelock that will block
suspend while the event queue is not empty. This allows userspace code to
process input events while the device appears to be asleep.

The current code holds the wakelock for up 5 seconds for every input
device and client. This can prevent suspend if sensor with a high data
rate is active, even when that sensor is not capable of waking the
device once it is suspended.

Change-Id: I624d66ef30a0b3abb543685c343382b8419b42b9
Signed-off-by: Arve Hjønnevåg <arve@android.com>
switch: add timestamps to switch driver

Change-Id: Iac5b5279f45fcc6e506d801cb5e9d6d2f6f6f9fa
Signed-off-by: Erik Gilling <konkers@android.com>
xt_IDLETIMER:
Add new netlink msg type for IDLETIMER.

Send notifications when the label becomes active after an idle period.
Send netlink message notifications in addition to sysfs notifications.

Change-Id: I31677ef00c94b5f82c8457e5bf9e5e584c23c523
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
netfilter: xt_IDLETIMER: Use uevent instead of new netlink msg type

Send netlink message notifications using a uevent with
  subsystem=xt_idletimer
  INTERFACE=...
  STATE={active,inactive}
instead of needing a new netlink message type.
Revert the netlink.h change added by commit
  beb914e987cbbd368988d2b94a6661cb907c4d5a

Change-Id: I6881936bf754f3367ff3c8f6c1e9661cec0357d4
Signed-off-by: JP Abgrall <jpa@google.com>
netfilter: xt_qtaguid: start tracking iface rx/tx at low level

qtaguid tracks the device stats by monitoring when it goes up and down,
then it gets the dev_stats().
But devs don't correctly report stats (either they don't count headers
symmetrically between rx/tx, or they count internal control messages).

Now qtaguid counts the rx/tx bytes/packets during raw:prerouting and
mangle:postrouting (nat is not available in ipv6).

The results are in
  /proc/net/xt_qtaguid/iface_stat_fmt
which outputs a format line (bash expansion):
  ifname  total_skb_{rx,tx}_{bytes,packets}

Added event counters for pre/post handling.
Added extra ctrl_*() pid/uid debugging.

Change-Id: Id84345d544ad1dd5f63e3842cab229e71d339297
Signed-off-by: JP Abgrall <jpa@google.com>
Revert "ext4: add support for read_iter, write_iter, and direct_IO_bvec"

This reverts commit 5708446ecedb40599c2c9e146ead5a9f668abc47.
block: Adding ROW scheduling algorithm

This patch adds the implementation of a new scheduling algorithm - ROW.
The policy of this algorithm is to prioritize READ requests over WRITE
as much as possible without starving the WRITE requests.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
backported from Linux 3.5+ to Linux 3.0.x by faux123
block/row: fix compatiblity with hybrid linux-3.0.x
switch do_fsync() to fget_light()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fuse: add basic support of iovec[] to fuse_req

The patch allows fuse_req to refer to array of iovec-s describing
layout of user-data over req->pages. fuse_copy_pages() is re-worked to
support both cased: former layout where pages[] corresponded to <buf, len>
and newer one where pages[] corresponds to iovec[].

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
fuse: re-work fuse_get_user_pages() to operate on iovec[]

Now fuse_get_user_pages() takes iovec[] as argument and packs so much data
from it to req->pages[] as possible.

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
fuse: re-work fuse_direct_io() to operate on iovec[]

The patch transparently passes iovec[] argument from fuse_direct_io()
to fuse_get_user_pages() hoping that the latter would fill req with
some part of iovec[].

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
writeback: disable tracing for writeback_queue_io

this caused a compilation error due to incompatibility between 3.0 block
device and 3.3+ block device
Revert "mm: fix compilation error introduced by "mm: rearrange putback_inactive_pages""

This reverts commit a34b6149f700d9e58838a3cfee12c8592a1b4a16.
Revert "mm/vmscan: Add #ifdef around "WasActive page flag""

This reverts commit c09c96fa47d47335ef102415fa39b5ce04f55bc8.

Conflicts:

	mm/vmscan.c
Revert "mm: implement WasActive page flag (for improving cleancache)"

This reverts commit 8cfb32ad8653b0afbffefb1018788e2ecdbc0466.

Conflicts:

	include/linux/page-flags.h
	mm/vmscan.c