vmscan: add customisable shrinker batch size

For shrinkers that have their own cond_resched* calls, having
shrink_slab break the work down into small batches is not
paticularly efficient. Add a custom batchsize field to the struct
shrinker so that shrinkers can use a larger batch size if they
desire.

A value of zero (uninitialised) means "use the default", so
behaviour is unchanged by this patch.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Conflicts:
	mm/vmscan.c
perf: Clean up 'ctx' reference counting

Small cleanup to how we refcount in find_get_context(), this also
allows us to use put_ctx() to free things instead of using kfree().

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110409192141.719340481@chello.nl
Signed-off-by: Ingo Molnar <mingo@elte.hu>
oom: thaw threads if oom killed thread is frozen before deferring

If a thread has been oom killed and is frozen, thaw it before returning to
the page allocator.  Otherwise, it can stay frozen indefinitely and no
memory will be freed.

Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
oom: avoid killing kthreads if they assume the oom killed thread's mm

After selecting a task to kill, the oom killer iterates all processes and
kills all other threads that share the same mm_struct in different thread
groups.  It would not otherwise be helpful to kill a thread if its memory
would not be subsequently freed.

A kernel thread, however, may assume a user thread's mm by using
use_mm().  This is only temporary and should not result in sending a
SIGKILL to that kthread.

This patch ensures that only user threads and not kthreads are sent a
SIGKILL if they share the same mm_struct as the oom killed task.

Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
oom: remove oom_disable_count

This removes mm->oom_disable_count entirely since it's unnecessary and
currently buggy.  The counter was intended to be per-process but it's
currently decremented in the exit path for each thread that exits, causing
it to underflow.

The count was originally intended to prevent oom killing threads that
share memory with threads that cannot be killed since it doesn't lead to
future memory freeing.  The counter could be fixed to represent all
threads sharing the same mm, but it's better to remove the count since:

 - it is possible that the OOM_DISABLE thread sharing memory with the
   victim is waiting on that thread to exit and will actually cause
   future memory freeing, and

 - there is no guarantee that a thread is disabled from oom killing just
   because another thread sharing its mm is oom disabled.

Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Ying Han <yinghan@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+ update "BFQ-v6-I-O-sched" (for-3.4) -> http://algo.ing.unimo.it/people/paolo/disk_sched/

only thing that I have changed, for compiling ... ->

-------------------
block/bfq-iosched.c
-------------------
        /* handle changed prio notifications; cgroup change is handled separately */
-       if (unlikely(bic->icq.changed))
-               if (test_and_clear_bit(ICQ_IOPRIO_CHANGED, &bic->icq.changed))
-                       bfq_changed_ioprio(bic->icq.ioc, bic);
+       if (unlikely(icq_get_changed(&bic->icq) & ICQ_IOPRIO_CHANGED))
+               bfq_changed_ioprio(bic->icq.ioc, bic);
+ "block, bfq: attempt to fix use-after-free which affects SLUB behavior (3.3.0 to 3.8.0)" - https://github.com/damentz/zen-kernel/commit/975bb74bfcf1c022ea49198dcd74efe14fe58d34
FIX BFQ I/O sched after update. by voku.
afsync: replace fput() with fput_light() accordingly

as we have committed 'switch do_fsync() to fget_light()' before

Change-Id: Ib759e00bfe7f01e1d834988c316b840370841686
bye bfq... will again later

Signed-off-by: k2wl <kar2wlan@gmail.com>
block: introduce the BFQ-v6r2 I/O sched for 3.3
block, bfq: add Early Queue Merge (EQM) to BFQ-v6r2 for 3.3.0
block: bfq, blk: fix compilation error
block: strip out locking optimization in put_io_context()

put_io_context() performed a complex trylock dancing to avoid
deferring ioc release to workqueue.  It was also broken on UP because
trylock was always assumed to succeed which resulted in unbalanced
preemption count.

While there are ways to fix the UP breakage, even the most
pathological microbench (forced ioc allocation and tight fork/exit
loop) fails to show any appreciable performance benefit of the
optimization.  Strip it out.  If there turns out to be workloads which
are affected by this change, simpler optimization from the discussion
thread can be applied later.

Signed-off-by: Tejun Heo <tj@kernel.org>
LKML-Reference: <1328514611.21268.66.camel@sli10-conroe>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Conflicts:
	block/blk-cgroup.c

Change-Id: I67545bea04b754f344e0b5e2f1f7d4dd52aee55d

Conflicts:
	drivers/mmc/card/queue.c
btrfs: kill magical embedded struct superblock

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Revert " android: lowmemorykiller: add lmk parameters tunning code."

This reverts commit 42dfbbbd33929f537df5431c1c256d10ce4c84e8.
Revert " ext4: speed up truncate/unlink by not using bforget() unless needed"

This reverts commit cf0c863c1c2dc038b064e01cef6a59cfda688bc0.
Revert "exFAT v1.2.4 [Samsung-OSRC]"

This reverts commit 2eacd1f914231975af551aea724ea4a14f0ff5a9.
Added Samsung exfat source, modded by @rxrz @lqs and me :)

This driver can replace FAT16/32 driver!

This driver can be built on 3.0.y up to 3.10.y :)

source came from here!
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=exfat

then tuned in here
https://github.com/rxrz/exfat-nofuse/commits/master

and then update be me :)
https://github.com/dorimanx/exfat-nofuse

Mazal tov :)

Conflicts:
	fs/Makefile
EXFAT some ports and corrections to fix small bugs