fs/dyn_sync_cntrl: add dynamic sync control

this patch is include:
===
fs/dyn_sync_cntrl: dynamic sync control
The dynamic sync control interface uses Android kernel's unique early
suspend / lat resume interface.

While screen is on, file sync is disabled
when screen is off, a file sync is called to flush all outstanding writes
and restore file sync operation as normal.

Signed-off-by: Paul Reioux <reioux@gmail.com>

https://github.com/rmbq/android_kernel_htc_msm8960/commit/93e36fa07a6cb4ae04c2905b4d888ea58f0ea30c

===
fs/dyn_sync_cntrl: Linux 3.4 Kernel compatibility fixup
Signed-off-by: faux123 <reioux@gmail.com>

https://github.com/rmbq/android_kernel_htc_msm8960/commit/d515d798f06ebcd1fb3a23070224f6ef30a46935

===
fs/dyn_fsync: check dyn fsync control's active prior to performing fsync ops

Signed-off-by: Andrew Bartholomew <andrewb03@gmail.com>

https://github.com/rmbq/android_kernel_htc_msm8960/commit/451997e21a1dde308eff98bac48ec25749a1f982

===
dynamic filesync: add some cache optimizations and clean up file format and typos

bump version to 1.1

Signed-off-by: Paul Reioux <reioux@gmail.com>

https://github.com/rmbq/android_kernel_htc_msm8960/commit/e361fca89d469f7eea5ef5b097a3eac493a1e5c8

===
dynamic fsync: add reboot notifier to force flush outstanding data

this should further prevent data corruption from kernel panics and
forced reboots

bump version to 1.2

Signed-off-by: Paul Reioux <reioux@gmail.com>

https://github.com/rmbq/android_kernel_htc_msm8960/commit/ff2c3393215b1d7e4042a6ba58f416121168ae97

===
dynamic fsync: add kernel panic notifier to force flush outstanding data

more paranoia safety checks

Signed-off-by: Paul Reioux <reioux@gmail.com>

https://github.com/rmbq/android_kernel_htc_msm8960/commit/8862f0503cf4e603e62df01cac42879c6e8eb957

===
fs: update dynamic fsync

https://github.com/rmbq/android_kernel_htc_msm8960/commit/4845455fc3213374c6fe3a2cfa5a47bcc3d916dd

===
use powersuspend when needed

https://github.com/rmbq/android_kernel_htc_msm8960/commit/95b75887771b884cb9b7c6d59d2e6105b706f600

===
fs/sync: Make sync() satisfy many requests with one invocation
Dave Jones reported RCU stalls, overly long hrtimer interrupts, and
amazingly long NMI handlers from a trinity-induced workload involving
lots of concurrent sync() calls (https://lkml.org/lkml/2013/7/23/369).
There are any number of things that one might do to make sync() behave
better under high levels of contention, but it is also the case that
multiple concurrent sync() system calls can be satisfied by a single
sys_sync() invocation.

Given that this situation is reminiscent of rcu_barrier(), this commit
applies the rcu_barrier() approach to sys_sync().  This approach uses
a global mutex and a sequence counter.  The mutex is held across the
sync() operation, which eliminates contention between concurrent sync()
operations.  The counter is incremented at the beginning and end of
each sync() operation, so that it is odd while a sync() operation is in
progress and even otherwise, just like sequence locks.

The code that used to be in sys_sync() is now in do_sync(), and sys_sync()
now handles the concurrency.  The sys_sync() function first takes a
snapshot of the counter, then acquires the mutex, and then takes another
snapshot of the counter.  If the values of the two snapshots indicate that
a full do_sync() executed during the mutex acquisition, the sys_sync()
function releases the mutex and returns ("Our work is done!").  Otherwise,
sys_sync() increments the counter, invokes do_sync(), and increments
the counter again.

This approach allows a single call to do_sync() to satisfy an arbitrarily
large number of sync() system calls, which should eliminate issues due
to large numbers of concurrent invocations of the sync() system call.

Changes since v1 (https://lkml.org/lkml/2013/7/24/683):

o	Add a pair of memory barriers to keep the increments from
	bleeding into the do_sync() code.  (The failure probability
	is insanely low, but when you have several hundred million
	devices running Linux, you can expect several hundred instances
	of one-in-a-million failures.)

o	Actually CC some people who have experience in this area.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.cz>
Cc: Curt Wohlgemuth <curtw@google.com>
Cc: Jens Axboe <jaxboe@fusionio.com>
Cc: linux-fsdevel@vger.kernel.org

Signed-off-by: Paul Reioux <reioux@gmail.com>

https://github.com/rmbq/android_kernel_htc_msm8960/commit/bed2016f7f1a87bf9408669949ef19b10e9d35a6