ext4: speed up truncate/unlink by not using bforget() unless needed

Do not iterate over data blocks scanning for bh's to forget as they're
never exist. This improves time taken by unlink / truncate syscall.
Tested by continuously truncating file that is being written by dd.
Another test is rm -rf of linux tree while tar unpacks it. With
ordered data mode condition unlikely(!tbh) was always met in
ext4_free_blocks. With journal data mode tbh was found only few times,
so optimisation is also possible.

Unlinking fallocated 60G file after doing sync && echo 3 >
/proc/sys/vm/drop_caches && time rm --help

X86 before (linux 3.6-rc4):
# time rm -f test1
real    0m2.710s
user    0m0.000s
sys     0m1.530s

X86 after:
# time rm -f test1
real    0m0.644s
user    0m0.003s
sys     0m0.060s

MIPS before (linux 2.6.37):
# time rm -f test1
real    0m 4.93s
user    0m 0.00s
sys     0m 4.61s

MIPS after:
# time rm -f test1
real    0m 0.16s
user    0m 0.00s
sys     0m 0.06s

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrey Sidorov <qrxd43@motorola.com>
softirq: reduce latencies

In various network workloads, __do_softirq() latencies can be up
to 20 ms if HZ=1000, and 200 ms if HZ=100.

This is because we iterate 10 times in the softirq dispatcher,
and some actions can consume a lot of cycles.

This patch changes the fallback to ksoftirqd condition to :

- A time limit of 2 ms.
- need_resched() being set on current task

When one of this condition is met, we wakeup ksoftirqd for further
softirq processing if we still have pending softirqs.

Using need_resched() as the only condition can trigger RCU stalls,
as we can keep BH disabled for too long.

I ran several benchmarks and got no significant difference in
throughput, but a very significant reduction of latencies (one order
of magnitude) :

In following bench, 200 antagonist "netperf -t TCP_RR" are started in
background, using all available cpus.

Then we start one "netperf -t TCP_RR", bound to the cpu handling the NIC
IRQ (hard+soft)

Before patch :

RT_LATENCY,MIN_LATENCY,MAX_LATENCY,P50_LATENCY,P90_LATENCY,P99_LATENCY,MEAN_LATENCY,STDDEV_LATENCY
MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET
to 7.7.7.84 () port 0 AF_INET : first burst 0 : cpu bind
RT_LATENCY=550110.424
MIN_LATENCY=146858
MAX_LATENCY=997109
P50_LATENCY=305000
P90_LATENCY=550000
P99_LATENCY=710000
MEAN_LATENCY=376989.12
STDDEV_LATENCY=184046.92

After patch :

RT_LATENCY,MIN_LATENCY,MAX_LATENCY,P50_LATENCY,P90_LATENCY,P99_LATENCY,MEAN_LATENCY,STDDEV_LATENCY
MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET
to 7.7.7.84 () port 0 AF_INET : first burst 0 : cpu bind
RT_LATENCY=40545.492
MIN_LATENCY=9834
MAX_LATENCY=78366
P50_LATENCY=33583
P90_LATENCY=59000
P99_LATENCY=69000
MEAN_LATENCY=38364.67
STDDEV_LATENCY=12865.26

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: David Miller <davem@davemloft.net>
Cc: Tom Herbert <therbert@google.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
mach-msm: subsystem_restart: Fix CPU detection

Initialization function could not detect the correct CPU type
(apq8064). Therefore it could not register correctly subsystem
restart order for the panic_handler.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
jbd2: optimize jbd2_journal_force_commit

Current implementation of jbd2_journal_force_commit() is suboptimal because
result in empty and useless commits. But callers just want to force and wait
any unfinished commits. We already have jbd2_journal_force_commit_nested()
which does exactly what we want, except we are guaranteed that we do not hold
journal transaction open.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
random: backport updates from Linux master (3.13-rc4)

lib, net: make isodigit() public and use it	Andy Shevchenko
random: add debugging code to detect early use of get_random_bytes()	Theodore Ts'o
random: initialize the last_time field in struct timer_rand_state	Theodore Ts'o
random: don't zap entropy count in rand_initialize()	Theodore Ts'o
random: printk notifications for urandom pool initialization	Theodore Ts'o
random: make add_timer_randomness() fill the nonblocking pool first	Theodore Ts'o
random: convert DEBUG_ENT to tracepoints	Theodore Ts'o
random: push extra entropy to the output pools	Theodore Ts'o
random: drop trickle mode	Theodore Ts'o
random: adjust the generator polynomials in the mixing function slightly	Theodore Ts'o
random: speed up the fast_mix function by a factor of four	Theodore Ts'o
random: cap the rate which the /dev/urandom pool gets reseeded	Theodore Ts'o
random: optimize the entropy_store structure	Theodore Ts'o
random: optimize spinlock use in add_device_randomness()	Theodore Ts'o
random: fix the tracepoint for get_random_bytes(_arch)	Theodore Ts'o
random: account for entropy loss due to overwrites	H. Peter Anvin
random: allow fractional bits to be tracked	H. Peter Anvin
random: statically compute poolbitshift, poolbytes, poolbits	H. Peter Anvin
random: mix in architectural randomness earlier in extract_buf()	Theodore Ts'o
random: allow architectures to optionally define random_get_entropy()	Theodore Ts'o
random: run random_int_secret_init() run after all late_initcalls	Theodore Ts'o
char: Convert use of typedef ctl_table to struct ctl_table	Joe Perches	1
random: fix accounting race condition with lockless irq entropy_count update	Jiri Kosina
drivers/char/random.c: fix priming of last_data	Jarod Wilson
lib/string_helpers: introduce generic string_unescape	Andy Shevchenko
random: fix locking dependency with the tasklist_lock	Theodore Ts'o
locking: Various static lock initializer fixes	Thomas Gleixner
random: prime last_data value per fips requirements	Jarod Wilson
random: fix debug format strings	Jiri Kosina
random: make it possible to enable debugging without rebuild	Jiri Kosina
random: mix in architectural randomness in extract_buf()	H. Peter Anvin
random: Add comment to random_initialize()	Tony Luck
random: add tracepoints for easier debugging and verification	Theodore Ts'o

Conflicts:
	include/trace/events/random.h