ext4: fix ext4_end_io_dio() racing against fsync()

We need to make sure iocb->private is cleared *before* we put the
io_end structure on i_completed_io_list.  Otherwise fsync() could
potentially run on another CPU and free the iocb structure out from
under us.

Reported-by: Kent Overstreet <koverstreet@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org

commit b45c13576670e24a340c978aa470cb2e5994f937 1 parent 7ddb52a7e8
pinpong authored 8 hours ago
RWSEM_XCHGADD_ALGORITHM for ARM (R/W semaphores implemented using ARM atomic functions) by CodeAurora
+ ashmem: Fix deadlock when System is low on memory -> https://github.com/sakindia123/xxICSKernel/commit/62512d8fa9c40be1eadbcc59b86302d91599e71b
mm: implement WasActive page flag (for improving cleancache)

(Feedback welcome if there is a different/better way to do this
without using a page flag!)

Since about 2.6.27, the page replacement algorithm maintains
an "active" bit to help decide which pages are most eligible
to reclaim, see http://linux-mm.org/PageReplacementDesign

This "active' information is also useful to cleancache but is lost
by the time that cleancache has the opportunity to preserve the
pageful of data.  This patch adds a new page flag "WasActive" to
retain the state.  The flag may possibly be useful elsewhere.

It is up to each cleancache backend to utilize the bit as
it desires.  The matching patch for zcache is included here
for clarification/discussion purposes, though it will need to
go through GregKH and the staging tree.

The patch resolves issues reported with cleancache which occur
especially during streaming workloads on older processors,
see https://lkml.org/lkml/2011/8/17/351

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
ported to 3.0.34 by dorimanx
original commit by faux123
Makefile: Stable and better optimization values

Great Performances
+ testing: I/O-less dirty throttling, reduce filesystem writeback from page reclaim ... -> https://github.com/DerTeufel/samsung-kernel-aries/commit/fb003c1fb3478d8c27a86823a26f45f6aded704a
Updated DefConfig

Disabled CleanCache and Dynamic FSync
Revert "+ testing: I/O-less dirty throttling, reduce filesystem writeback from page reclaim ... -> https://github.com/DerTeufel/samsung-kernel-aries/commit/fb003c1fb3478d8c27a86823a26f45f6aded704a" (reverted from commit c78399b0883f4937264bf5e13ac4536bbbcc04c5)
+ ext4: optimize ext4_ext_convert_to_initialized() -> https://github.com/DerTeufel/samsung-kernel-aries/commit/e9450b66b4400dd2ec3dec72f2d75401472f4b3b
+ ext4: optimize memmmove lengths in extent/index insertions -> https://github.com/DerTeufel/samsung-kernel-aries/commit/cdd09c6c71bb4519c5dfa1a04924d37e7a75cda5
+ NOATIME and NODIRATIME by default -> https://github.com/DerTeufel/samsung-kernel-aries/commit/6c0c048f39c64c932cbee050bc8ec7ac54a898cf
REALTIME by default changed to NOATIME! boost to battery save and I/O speed!
locking, kprobes: Annotate the hash locks and kretprobe.lock as raw

The kprobe locks can be taken in atomic context and therefore
cannot be preempted on -rt - annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit ec484608c5885931c432e99ecfd2772288cd993c)
locking, percpu_counter: Annotate ::lock as raw

The percpu_counter::lock can be taken in atomic context and therefore
cannot be preempted on -rt - annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit f032a450812f6c7edd532772cc7c48091bca9f27)
locking, sched, cgroups: Annotate release_list_lock as raw

The release_list_lock can be taken in atomic context and therefore
cannot be preempted on -rt - annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit cdcc136ffd264849a943acb42c36ffe9b458f811)
locking, lib/proportions: Annotate prop_local_percpu::lock as raw

The prop_local_percpu::lock can be taken in atomic context and therefore
cannot be preempted on -rt - annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit 740969f91e950b64a18fdd0a25164cdee042abf0)
locking, tracing: Annotate tracing locks as raw

The tracing locks can be taken in atomic context and therefore
cannot be preempted on -rt - annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit 5389f6fad27019f2ba78f1b332f719ec05f12a42)
locking, semaphores: Annotate inner lock as raw

There is no reason to have the spin_lock protecting the semaphore
preemptible on -rt. Annotate it as a raw_spinlock.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

( On rt this also solves lockdep complaining about the
  rt_mutex.wait_lock being not initialized. )

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit 8292c9e15c3b069459794a04f5e2cf0d5665ddc4)
locking, rwsem: Annotate inner lock as raw

There is no reason to allow the lock protecting rwsems (the
ownerless variant) to be preemptible on -rt. Convert it to raw.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit ddb6c9b58a19edcfac93ac670b066c836ff729f1)
locking, timer_stats: Annotate table_lock as raw

The table_lock lock can be taken in atomic context and therefore
cannot be preempted on -rt - annotate it.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Reported-by: Andreas Sundebo <kernel@sundebo.dk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Andreas Sundebo <kernel@sundebo.dk>

Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit 2737c49f29a29f3d3645ba0778aa7a8798f32249)