]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agocleancache: Make cleancache_init use a pointer for the ops
Konrad Rzeszutek Wilk [Tue, 26 Mar 2013 23:24:19 +0000 (10:24 +1100)]
cleancache: Make cleancache_init use a pointer for the ops

Instead of using a backend_registered to determine whether a backend is
enabled.  This allows us to remove the backend_register check and just do
'if (cleancache_ops)'

[v1: Rebase on top of b97c4b430b0a (ramster->zcache move]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: cleancache: lazy initialization to allow tmem backends to build/run as modules
Dan Magenheimer [Tue, 26 Mar 2013 23:24:19 +0000 (10:24 +1100)]
mm: cleancache: lazy initialization to allow tmem backends to build/run as modules

With the goal of allowing tmem backends (zcache, ramster, Xen tmem) to be
built/loaded as modules rather than built-in and enabled by a boot
parameter, this patch provides "lazy initialization", allowing backends to
register to cleancache even after filesystems were mounted.  Calls to
init_fs and init_shared_fs are remembered as fake poolids but no real
tmem_pools created.  On backend registration the fake poolids are mapped
to real poolids and respective tmem_pools.

Signed-off-by: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Florian Schmaus <fschmaus@gmail.com>
Signed-off-by: Andor Daam <andor.daam@googlemail.com>
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
[v1: Minor fixes: used #define for some values and bools]
[v2: Removed CLEANCACHE_HAS_LAZY_INIT]
[v3: Added more comments, added a lock for [shared_|]fs_poolid_map]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofrontswap: get rid of swap_lock dependency
Minchan Kim [Tue, 26 Mar 2013 23:24:18 +0000 (10:24 +1100)]
frontswap: get rid of swap_lock dependency

Frontswap initialization routine depends on swap_lock, which want to be
atomic about frontswap's first appearance.  IOW, frontswap is not present
and will fail all calls OR frontswap is fully functional but if new
swap_info_struct isn't registered by enable_swap_info, swap subsystem
doesn't start I/O so there is no race between init procedure and page I/O
working on frontswap.

So let's remove unnecessary swap_lock dependency.

Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
[v1: Rebased on my branch, reworked to work with backends loading late]
[v2: Added a check for !map]
[v3: Made the invalidate path follow the init path]
[v4: Address comments by Wanpeng Li <liwanp@linux.vnet.ibm.com>]
Signed-off-by: Konrad Rzeszutek Wilk <konrad@darnok.org>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: frontswap: cleanup code
Bob Liu [Tue, 26 Mar 2013 23:24:18 +0000 (10:24 +1100)]
mm: frontswap: cleanup code

After allowing tmem backends to build/run as modules, frontswap_enabled
always true if defined CONFIG_FRONTSWAP.  But frontswap_test() depends on
whether backend is registered, mv it into frontswap.c using fronstswap_ops
to make the decision.

frontswap_set/clear are not used outside frontswap, so don't export them.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofrontswap: make frontswap_init use a pointer for the ops
Konrad Rzeszutek Wilk [Tue, 26 Mar 2013 23:24:18 +0000 (10:24 +1100)]
frontswap: make frontswap_init use a pointer for the ops

This simplifies the code in the frontswap - we can get rid of the
'backend_registered' test and instead check against frontswap_ops.

[v1: Rebase on top of 703ba7fe5e0 (ramster->zcache move]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: frontswap: lazy initialization to allow tmem backends to build/run as modules
Dan Magenheimer [Tue, 26 Mar 2013 23:24:18 +0000 (10:24 +1100)]
mm: frontswap: lazy initialization to allow tmem backends to build/run as modules

With the goal of allowing tmem backends (zcache, ramster, Xen tmem) to be
built/loaded as modules rather than built-in and enabled by a boot
parameter, this patch provides "lazy initialization", allowing backends to
register to frontswap even after swapon was run.  Before a backend
registers all calls to init are recorded and the creation of tmem_pools
delayed until a backend registers or until a frontswap store is attempted.

Signed-off-by: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Florian Schmaus <fschmaus@gmail.com>
Signed-off-by: Andor Daam <andor.daam@googlemail.com>
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
[v1: Fixes per Seth Jennings suggestions]
[v2: Removed FRONTSWAP_HAS_.. ]
[v3: Fix up per Bob Liu <lliubbo@gmail.com> recommendations]
[v4: Fix up per Andrew's comments]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovm: adjust ifdef for TINY_RCU
Paul E. McKenney [Tue, 26 Mar 2013 23:24:17 +0000 (10:24 +1100)]
vm: adjust ifdef for TINY_RCU

There is an ifdef in page_cache_get_speculative() that checks for !SMP and
TREE_RCU, which has been an impossible combination since the advent of
TINY_RCU.  The ifdef enables a fastpath that is valid when preemption is
disabled by rcu_read_lock() in UP systems, which is the case when TINY_RCU
is enabled.  This commit therefore adjusts the ifdef to generate the
fastpath when TINY_RCU is enabled.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm/shmem.c: remove an ifdef
Andrew Morton [Tue, 26 Mar 2013 23:24:17 +0000 (10:24 +1100)]
mm/shmem.c: remove an ifdef

Create a CONFIG_MMU=y stub for ramfs_nommu_expand_for_mapping() in the
usual fashion.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm, show_mem: suppress page counts in non-blockable contexts
David Rientjes [Tue, 26 Mar 2013 23:24:17 +0000 (10:24 +1100)]
mm, show_mem: suppress page counts in non-blockable contexts

On large systems with a lot of memory, walking all RAM to determine page
types may take a half second or even more.

In non-blockable contexts, the page allocator will emit a page allocation
failure warning unless __GFP_NOWARN is specified.  In such contexts, irqs
are typically disabled and such a lengthy delay may even result in NMI
watchdog timeouts.

To fix this, suppress the page walk in such contexts when printing the
page allocation failure warning.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm-trace-filemap-add-and-del-v2
Robert Jarzmik [Tue, 26 Mar 2013 23:24:16 +0000 (10:24 +1100)]
mm-trace-filemap-add-and-del-v2

 - took Stephen's comment into account (use FTrace templates)
 - took Andrew's comment into account (trace out of lock)

Cc: Dave Chinner <david@fromorbit.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: trace filemap add and del
Robert Jarzmik [Tue, 26 Mar 2013 23:24:16 +0000 (10:24 +1100)]
mm: trace filemap add and del

Use the events API to trace filemap loading and unloading of file pieces
into the page cache.

This patch aims at tracing the eviction reload cycle of executable and
shared libraries pages in a memory constrained environment.

The typical usage is to spot a specific device and inode (for example
/lib/libc.so) to see the eviction cycles, and find out if frequently used
code is rather spread across many pages (bad) or coallesced (good).

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoHWPOISON: check dirty flag to match against clean page
Naoya Horiguchi [Tue, 26 Mar 2013 23:24:16 +0000 (10:24 +1100)]
HWPOISON: check dirty flag to match against clean page

Currently page_action() does not check dirty flag to determine whether the
error page is "clean mlocked/unevictable LRU" page.  This doesn't cause
any misjudgement because we do matching against "dirty mlocked/unevictable
LRU" just before the check.  But in order to make code consistent and/or
to avoid potential regression, we had better check dirty flag explicitly.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Suggested-by: Chen Gong <gong.chen@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agowatchdog: trigger all-cpu backtrace when locked up and going to panic
Sasha Levin [Tue, 26 Mar 2013 23:24:15 +0000 (10:24 +1100)]
watchdog: trigger all-cpu backtrace when locked up and going to panic

Send an NMI to all CPUs when a lockup is detected and the lockup watchdog
code is configured to panic.  This gives us a fairly uptodate snapshot of
all CPUs in the system.

This lets us get stack trace of all CPUs which makes life easier trying to
debug a deadlock, and the NMI doesn't change anything since the next step
is a kernel panic.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofs: fix hang with BSD accounting on frozen filesystem
Jan Kara [Tue, 26 Mar 2013 23:24:15 +0000 (10:24 +1100)]
fs: fix hang with BSD accounting on frozen filesystem

When BSD process accounting is enabled and logs information to a
filesystem which gets frozen, system easily becomes unusable because each
attempt to account process information blocks.  Thus e.g.  every task gets
blocked in exit.

It seems better to drop accounting information (which can already happen
when filesystem is running out of space) instead of locking system up.  So
we open the accounting file with O_NONBLOCK.

Signed-off-by: Jan Kara <jack@suse.cz>
Reported-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Marco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofs/block_dev.c: no need to check inode->i_bdev in bd_forget()
Yan Hong [Tue, 26 Mar 2013 23:24:14 +0000 (10:24 +1100)]
fs/block_dev.c: no need to check inode->i_bdev in bd_forget()

Its only caller evict() has promised a non-NULL inode->i_bdev.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoblock: restore /proc/partitions to not display non-partitionable removable devices
Josh Hunt [Tue, 26 Mar 2013 23:24:14 +0000 (10:24 +1100)]
block: restore /proc/partitions to not display non-partitionable removable devices

We found with newer kernels we started seeing the cdrom device showing
up in /proc/partitions, but it was not there before.

Looking into this I found that commit d27769ec ("block: add
GENHD_FL_NO_PART_SCAN") introduces this change in behavior.  It's not
clear to me from the commit's changelog if this change was intentional or
not.  This comment still remains: /* Don't show non-partitionable
removeable devices or empty devices */ so I've decided to send a patch to
restore the behavior of not printing unpartitionable removable devices.

Signed-off-by: Josh Hunt <johunt@akamai.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/block/mg_disk.c: add CONFIG_PM_SLEEP to suspend/resume functions
Jingoo Han [Tue, 26 Mar 2013 23:24:14 +0000 (10:24 +1100)]
drivers/block/mg_disk.c: add CONFIG_PM_SLEEP to suspend/resume functions

Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build
warning when CONFIG_PM_SLEEP is not selected.  This is because sleep PM
callbacks defined by SIMPLE_DEV_PM_OPS are only used when the
CONFIG_PM_SLEEP is enabled.

drivers/block/mg_disk.c:783:12: warning: 'mg_suspend' defined but not used [-Wunused-function]
drivers/block/mg_disk.c:807:12: warning: 'mg_resume' defined but not used [-Wunused-function]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agolglock: update lockdep annotations to report recursive local locks
Michel Lespinasse [Tue, 26 Mar 2013 23:24:13 +0000 (10:24 +1100)]
lglock: update lockdep annotations to report recursive local locks

Oleg Nesterov recently noticed that the lockdep annotations in lglock.c
are not sufficient to detect some obvious deadlocks, such as
lg_local_lock(LOCK) + lg_local_lock(LOCK) or spin_lock(X) +
lg_local_lock(Y) vs lg_local_lock(Y) + spin_lock(X).

Both issues are easily fixed by indicating to lockdep that lglock's local
locks are not recursive.  We shouldn't use the rwlock acquire/release
functions here, as lglock doesn't share the same semantics.  Instead we
can base our lockdep annotations on the lock_acquire_shared (for local
lglock) and lock_acquire_exclusive (for global lglock) helpers.

I am not proposing new lglock specific helpers as I don't see the point of
the existing second level of helpers :)

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agolockdep: introduce lock_acquire_exclusive/shared helper macros
Michel Lespinasse [Tue, 26 Mar 2013 23:24:13 +0000 (10:24 +1100)]
lockdep: introduce lock_acquire_exclusive/shared helper macros

In lockdep.h, the spinlock/mutex/rwsem/rwlock/lock_map acquire macros have
different definitions based on the value of CONFIG_PROVE_LOCKING.  We have
separate ifdefs for each of these definitions, which seems redundant.

Introduce lock_acquire_{exclusive,shared,shared_recursive} helpers which
will have different definitions based on CONFIG_PROVE_LOCKING.  Then all
other helper macros can be defined based on the above ones, which reduces
the amount of ifdefined code.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodebug_locks.h: make warning more verbose
James Hogan [Tue, 26 Mar 2013 23:24:13 +0000 (10:24 +1100)]
debug_locks.h: make warning more verbose

The WARN_ON(1) in DEBUG_LOCKS_WARN_ON is surprisingly awkward to track
down when it's hit, as it's usually buried in macros, causing multiple
instances to land on the same line number.

This patch makes it more useful by switching to:

    WARN(1, "DEBUG_LOCKS_WARN_ON(%s)", #c);

so that the particular DEBUG_LOCKS_WARN_ON is more easily identified and
grep'd for.  For example:

    WARNING: at kernel/mutex.c:198 _mutex_lock_nested+0x31c/0x380()
    DEBUG_LOCKS_WARN_ON(l->magic != l)

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoocfs2: delay inode update transactions after verifying the input flags
Jeff Liu [Tue, 26 Mar 2013 23:24:12 +0000 (10:24 +1100)]
ocfs2: delay inode update transactions after verifying the input flags

There is no need to start the inode update transactions before/while
verifying the input flags.  As a refinement, this patch delay the
transactions utill the pre-check up is ok.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipvs: change type of netns_ipvs->sysctl_sync_qlen_max
Zhang Yanfei [Tue, 26 Mar 2013 23:24:12 +0000 (10:24 +1100)]
ipvs: change type of netns_ipvs->sysctl_sync_qlen_max

This member of struct netns_ipvs is calculated from nr_free_buffer_pages
so change its type to unsigned long in case of overflow.  Also, type of
its related proc var sync_qlen_max and the return type of function
sysctl_sync_qlen_max() should be changed to unsigned long, too.

Besides, the type of ipvs_master_sync_state->sync_queue_len should be
changed to unsigned long accordingly.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoscripts/decodecode: make faulting insn ptr more robust
Borislav Petkov [Tue, 26 Mar 2013 23:24:12 +0000 (10:24 +1100)]
scripts/decodecode: make faulting insn ptr more robust

It can accidentally happen that the faulting insn (the exact instruction
bytes) is repeated a little further on in the trace.  This causes that
same instruction to be tagged twice, see example below.

What we want to do, however, is to track back from the end of the whole
disassembly so many lines as the slice which starts with the faulting
instruction is long.  This leads us to the actual faulting instruction and
*then* we tag it.

While we're at it, we can drop the sed "g" flag because we address only
this one line.

Also, if we point to an instruction which changes decoding depending on
the slice being objdumped, like a Jcc insn, for example, we do not even
tag it as a faulting instruction because the instruction decode changes in
the second slice but we use that second format as a regex on the fsrst
disassembled buffer and more often than not that instruction doesn't
match.

Again, simply tag the line which is deduced from the original "<>" marking
we've received from the kernel.

This also solves the pathologic issue of multiple tagging like this:

  29:*  0f 0b                   ud2         <-- trapping instruction
  2b:*  0f 0b                   ud2         <-- trapping instruction
  2d:*  0f 0b                   ud2         <-- trapping instruction

Double tagging example:

Code: 34 dd 40 30 ad 81 48 c7 c0 80 f6 00 00 48 8b 3c 30 48 01 c6 b8 ff ff ff ff 48 8d 57 f0 48 39 f7 74 2f 49 8b 4c 24 08 48 8b 47 f0 <48> 39 48 08 75 0e eb 2a 66 90 48 8b 40 f0 48 39 48 08 74 1e 48
All code
========
   0:   34 dd                   xor    $0xdd,%al
   2:   40 30 ad 81 48 c7 c0    xor    %bpl,-0x3f38b77f(%rbp)
   9:   80 f6 00                xor    $0x0,%dh
   c:   00 48 8b                add    %cl,-0x75(%rax)
   f:   3c 30                   cmp    $0x30,%al
  11:   48 01 c6                add    %rax,%rsi
  14:   b8 ff ff ff ff          mov    $0xffffffff,%eax
  19:   48 8d 57 f0             lea    -0x10(%rdi),%rdx
  1d:   48 39 f7                cmp    %rsi,%rdi
  20:   74 2f                   je     0x51
  22:   49 8b 4c 24 08          mov    0x8(%r12),%rcx
  27:   48 8b 47 f0             mov    -0x10(%rdi),%rax
  2b:*  48 39 48 08             cmp    %rcx,0x8(%rax)     <-- trapping instruction
  2f:   75 0e                   jne    0x3f
  31:   eb 2a                   jmp    0x5d
  33:   66 90                   xchg   %ax,%ax
  35:   48 8b 40 f0             mov    -0x10(%rax),%rax
  39:*  48 39 48 08             cmp    %rcx,0x8(%rax)     <-- trapping instruction
  3d:   74 1e                   je     0x5d
  3f:   48                      rex.W

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoheaders_install.pl: convert to headers_install.sh
Rob Landley [Tue, 26 Mar 2013 23:24:11 +0000 (10:24 +1100)]
headers_install.pl: convert to headers_install.sh

Remove perl from make headers_install by replacing a perl script (doing a
simple regex search and replace) with a smaller, faster, simpler,
POSIX-2008 shell script implementation.  The new shell script is a single
for loop calling sed and piping its output through unifdef to produce the
target file.

Same as last time except for minor tweak to deal with code review from
here: http://lkml.indiana.edu/hypermail/linux/kernel/1302.3/00078.html

(Note that this drops the "arch" argument, which isn't used. Kbuild
already points to the right input files on the command line.)

Signed-off-by: Rob Landley <rob@landley.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowell@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomkcapflags.pl: convert to mkcapflags.sh
Rob Landley [Tue, 26 Mar 2013 23:24:11 +0000 (10:24 +1100)]
mkcapflags.pl: convert to mkcapflags.sh

Generate asm-x86/cpufeature.h with posix-2008 commands instead of perl.

Signed-off-by: Rob Landley <rob@landley.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowell@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoktime_add_ns() may overflow on 32bit architectures
David Engraf [Tue, 26 Mar 2013 23:24:11 +0000 (10:24 +1100)]
ktime_add_ns() may overflow on 32bit architectures

I've triggered an overflow when using ktime_add_ns() on a 32bit
architecture not supporting CONFIG_KTIME_SCALAR.

When passing a very high value for u64 nsec, e.g.  7881299347898368000 the
do_div() function converts this value to seconds (7881299347) which is
still to high to pass to the ktime_set() function as long.  The result in
my case is a negative value.

The problem on my system occurs in the tick-sched.c,
tick_nohz_stop_sched_tick() when time_delta is set to
timekeeping_max_deferment().  The check for time_delta < KTIME_MAX is
valid, thus ktime_add_ns() is called with a too large value resulting in a
negative expire value.  This leads to an endless loop in the ticker code:

time_delta: 7881299347898368000
expires = ktime_add_ns(last_update, time_delta)
expires: negative value

This error doesn't occurs on 64bit or architectures supporting
CONFIG_KTIME_SCALAR (e.g.  ARM, x86-32).  64-bit arches doesn't run into
this problem because ktime_add_ns() can directly calculate the result
without calling do_div() and ktime_set().

Signed-off-by: David Engraf <david.engraf@sysgo.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoselftests: add basic posix timers selftests
Frederic Weisbecker [Tue, 26 Mar 2013 23:24:10 +0000 (10:24 +1100)]
selftests: add basic posix timers selftests

Add some initial basic tests on a few posix timers interface such as
setitimer() and timer_settime().

These simply check that expiration happens in a reasonable timeframe after
expected elapsed clock time (user time, user + system time, real time,
...).

This is helpful for finding basic breakages while hacking
on this subsystem.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoposix_cpu_timers: consolidate expired timers check
Frederic Weisbecker [Tue, 26 Mar 2013 23:24:10 +0000 (10:24 +1100)]
posix_cpu_timers: consolidate expired timers check

Consolidate the common code amongst per thread and per process timers list
on tick time.

List traversal, expiry check and subsequent updates can be shared in a
common helper.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoposix_cpu_timers: consolidate timer list cleanups
Frederic Weisbecker [Tue, 26 Mar 2013 23:24:10 +0000 (10:24 +1100)]
posix_cpu_timers: consolidate timer list cleanups

Cleaning up the posix cpu timers on task exit shares some common code
among timer list types, most notably the list traversal and expiry time
update.

Unify this in a common helper.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoposix_cpu_timer: consolidate expiry time type
Frederic Weisbecker [Tue, 26 Mar 2013 23:24:09 +0000 (10:24 +1100)]
posix_cpu_timer: consolidate expiry time type

The posix cpu timer expiry time is stored in a union of two types: a 64
bits field if we rely on scheduler precise accounting, or a cputime_t if
we rely on jiffies.

This results in quite some duplicate code and special cases to handle the
two types.

Just unify this into a single 64 bits field.  cputime_t can always fit
into it.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list-convert-timer-list-to-be-a-proper-seq_file-v3-fix
Andrew Morton [Tue, 26 Mar 2013 23:24:09 +0000 (10:24 +1100)]
timer_list-convert-timer-list-to-be-a-proper-seq_file-v3-fix

fix comment typos, per Stephen

Cc: Dave Jones <davej@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Nathan Zimmer <nzimmer@sgi.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list-convert-timer-list-to-be-a-proper-seq_file-v3
Nathan Zimmer [Tue, 26 Mar 2013 23:24:09 +0000 (10:24 +1100)]
timer_list-convert-timer-list-to-be-a-proper-seq_file-v3

v3: Corrected the case where max_cpus != nr_cpu_ids by exiting early.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Reported-by: Dave Jones <davej@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list: convert timer list to be a proper seq_file
Nathan Zimmer [Tue, 26 Mar 2013 23:24:09 +0000 (10:24 +1100)]
timer_list: convert timer list to be a proper seq_file

When running with 4096 cores attemping to read /proc/timer_list will fail
with an ENOMEM condition.  On a sufficantly large systems the total amount
of data is more then 4mb, so it won't fit into a single buffer.  The
failure can also occur on smaller systems when memory fragmentation is
high as reported by Dave Jones.

Convert /proc/timer_list to a proper seq_file with its own iterator.  This
is a little more complex given that we have to make two passes with two
separate headers.

[akpm@linux-foundation.org: whitespace fixlet]
[akpm@linux-foundation.org: fix up comment]
[akpm@linux-foundation.org: fix gcc warnings]
[akpm@linux-foundation.org: fix typo in comment]
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Reported-by: Dave Jones <davej@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list-split-timer_list_show_tickdevices-v4
Nathan Zimmer [Tue, 26 Mar 2013 23:24:08 +0000 (10:24 +1100)]
timer_list-split-timer_list_show_tickdevices-v4

v4: correct extra whitespace

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Dave Jones <davej@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimer_list: split timer_list_show_tickdevices()
Nathan Zimmer [Tue, 26 Mar 2013 23:24:08 +0000 (10:24 +1100)]
timer_list: split timer_list_show_tickdevices()

Split timer_list_show_tickdevices() out the header and just pull the rest up
to timer_list_show.  Also tweak the location of the whitespace.  This is all
to prep for the fix.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Reported-by: Dave Jones <davej@redhat.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocyber2000fb: avoid palette corruption at higher clocks
Ondrej Zary [Tue, 26 Mar 2013 23:24:08 +0000 (10:24 +1100)]
cyber2000fb: avoid palette corruption at higher clocks

When 1280x1024@75Hz mode is set, console palette is not set properly -
sometimes the background is white, sometimes yellow and text colors are
also messed up.  This does not happen at 1280x1024@60Hz and below.

It seems that the HW needs some time before setting the palette - maybe
the PLL needs more time to lock at higher speeds.  This patch fixes the
problem but without knowing what register to check for PLL lock(?), the
delay might be excessive.

On Fri, 28 Jan 2011 18:15:37 +0000
Russell King <rmk@arm.linux.org.uk> wrote:

> On Tue, Jan 18, 2011 at 01:14:24PM -0800, Andrew Morton wrote:
> > Russell, I have an (old) note here that this is awaiting an ack from
> > yourself?
>
> Well, I can reproduce this problem on the Netwinders here.  I'm not sure
> that we should delay all mode switches by one second - and any attempt
> to reduce this value does result in the palette not being set correctly.
>
> For 1280x1024-75, the dotclock is 135MHz, which gives a PLL values of
> 0x41 and 0x06.  That's: M=0x41+1, N=0x06+1, P=0x00 (top 2 bits of 0x06)
> -> Q=1
>
>  Fpll = 14.31818MHz * M / N
>  Fout = Fpll / Q
>
> The PLL itself is formed by dividing the 14-ish MHz frequency by N and
> phase comparing the output of the VCO, divided by M, and adjusting the
> VCO until the two correlate.  As VCOs typically tend to have a limited
> range, it's normal to divide the output frequency to produce a greater
> range - and in this case that's done by Q.
>
> For the 800x600-100 copied from /etc/fb.modes, this has a dotclock of
> 67.5MHz, which is exactly half this rate.  The PLL values for this are:
> M=0x41+1, N=0x06+1, P=0x01, giving PLL values of 0x41 and 0x46.
>
> Booting with 800x600-100 does not suffer the problem.  So it's not
> related to PLL lock time.  There's something else going on.
>
> Another experiment I tried was forcing the PLL values to produce 108MHz
> instead of 135MHz.  108MHz is the dotclock for 1280x1024-60.  This too
> doesn't suffer the problem.
>
> I've also tried chosing other delay values.  100ms is too short and
> produces the problem, but 1s works.  1s for a PLL to lock is a hell of
> a time, especially for a PLL operating in the MHz range.
>
> I've tried setting the PLL to a known good freqency, and then switching
> to 135MHz - the problem persists.  It's not like 135MHz is reaching the
> limits - it'll go up to 206MHz.
>
> So, I don't think this has anything to do with PLL locking.  I think
> there's something else going on which isn't immediately obvious - maybe
> bandwidth starvation preventing us from writing properly to the palette?
> As it's a horrible VGA, where you write the same register multiple times
> I wouldn't be surprised if some writes were going missing.
>
> I'll see if I can play around with it some more this evening, but I've
> spent an awful long time on just this issue already this afternoon...
>
> I think further investigation needs to happen on this patch before it's
> acceptable.  Or maybe we should prevent the cyberpro coming up in

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/mmp: remove legacy hw definitions
Zhou Zhu [Tue, 26 Mar 2013 23:24:07 +0000 (10:24 +1100)]
drivers/video/mmp: remove legacy hw definitions

Removed legacy hw definitions in hw/mmp_ctrl.h.  These definitions are for
earlier soc versions and are not supported in this driver.

Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Lisa Du <cldu@marvell.com>
Cc: Guoqing Li <ligq@marvell.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/ep93xx-fb.c: fix section mismatch and use module_platform_driver
H Hartley Sweeten [Tue, 26 Mar 2013 23:24:07 +0000 (10:24 +1100)]
drivers/video/ep93xx-fb.c: fix section mismatch and use module_platform_driver

Remove the __init tags from the ep93xxfb_calc_fbsize() and
ep93xxfb_alloc_videomem() functions to fix the section mismatch warnings.

Use module_platform_driver() to remove the init/exit boilerplate.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/exynos/exynos_mipi_dsi.c: convert to devm_ioremap_resource()
Sachin Kamat [Tue, 26 Mar 2013 23:24:07 +0000 (10:24 +1100)]
drivers/video/exynos/exynos_mipi_dsi.c: convert to devm_ioremap_resource()

Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Donghwa Lee <dh09.lee@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: fix a type warning in hyperv_fb.c
Haiyang Zhang [Tue, 26 Mar 2013 23:24:07 +0000 (10:24 +1100)]
video: fix a type warning in hyperv_fb.c

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video: add Hyper-V Synthetic Video Frame Buffer Driver
Haiyang Zhang [Tue, 26 Mar 2013 23:24:06 +0000 (10:24 +1100)]
drivers/video: add Hyper-V Synthetic Video Frame Buffer Driver

This is the driver for the Hyper-V Synthetic Video, which supports screen
resolution up to Full HD 1920x1080 on Windows Server 2012 host, and
1600x1200 on Windows Server 2008 R2 or earlier.  It also solves the double
mouse cursor issue of the emulated video mode.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Cc: Olaf Hering <olaf@aepfle.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/console/fbcon_cw.c: fix compiler warning in cw_update_attr
Devendra Naga [Tue, 26 Mar 2013 23:24:06 +0000 (10:24 +1100)]
drivers/video/console/fbcon_cw.c: fix compiler warning in cw_update_attr

with make W=1

saw

drivers/video/console/fbcon_cw.c: In function `cw_update_attr':
drivers/video/console/fbcon_cw.c:30:8: warning: variable `t' set but not used [-Wunused-but-set-variable]

fixed by removing as since its used nowhere

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomatroxfb: convert struct i2c_msg initialization to C99 format
Shubhrajyoti Datta [Tue, 26 Mar 2013 23:24:06 +0000 (10:24 +1100)]
matroxfb: convert struct i2c_msg initialization to C99 format

Convert the struct i2c_msg initialization to C99 format.  This makes
maintaining and editing the code simpler.  Also helps once other fields
like transferred are added in future.

Thanks to Julia Lawall for automating the conversion.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Julia Lawall <julia@diku.dk>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrm/fb-helper: don't sleep for screen unblank when an oops is in progress
Daniel Vetter [Tue, 26 Mar 2013 23:24:05 +0000 (10:24 +1100)]
drm/fb-helper: don't sleep for screen unblank when an oops is in progress

Otherwise the system will burn even brighter and worse, leave the user
wondering what's going on exactly.

Since we already have a panic handler which will (try) to restore the
entire fbdev console mode, we can just bail out.  Inspired by a patch from
Konstantin Khlebnikov.  The callchain leading to this, cut&pasted from
Konstantin's original patch:

callstack:
panic()
bust_spinlocks(1)
unblank_screen()
vc->vc_sw->con_blank()
fbcon_blank()
fb_blank()
info->fbops->fb_blank()
drm_fb_helper_blank()
drm_fb_helper_dpms()
drm_modeset_lock_all()
mutex_lock(&dev->mode_config.mutex)

Note that the entire locking in the fb helper around panic/sysrq and kdbg
is ...  non-existant.  So we have a decent change of blowing up
everything.  But since reworking this ties in with funny concepts like the
fbdev notifier chain or the impressive things which happen around
console_lock while oopsing, I'll leave that as an exercise for braver
souls than me.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Dave Airlie <airlied@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: use vm_unmapped_area() on powerpc architecture
Michel Lespinasse [Tue, 26 Mar 2013 23:24:05 +0000 (10:24 +1100)]
mm: use vm_unmapped_area() on powerpc architecture

Update the powerpc slice_get_unmapped_area function to make use of
vm_unmapped_area() instead of implementing a brute force search.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Tested-by: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm: remove free_area_cache use in powerpc architecture
Michel Lespinasse [Tue, 26 Mar 2013 23:24:05 +0000 (10:24 +1100)]
mm: remove free_area_cache use in powerpc architecture

As all other architectures have been converted to use vm_unmapped_area(),
we are about to retire the free_area_cache.

This change simply removes the use of that cache in
slice_get_unmapped_area(), which will most certainly have a
performance cost. Next one will convert that function to use the
vm_unmapped_area() infrastructure and regain the performance.

Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agox86: make 'mem=' option to work for efi platform
Wen Congyang [Tue, 26 Mar 2013 23:24:04 +0000 (10:24 +1100)]
x86: make 'mem=' option to work for efi platform

Current mem boot option only can work for non efi environment.  If the
user specifies add_efi_memmap, it cannot work for efi environment.  In the
efi environment, we call e820_add_region() to add the memory map.  So we
can modify __e820_add_region() and the mem boot option can work for efi
environment.

Note: Only E820_RAM is limited, and BOOT_SERVICES_{CODE,DATA} are always
mapped(If its address >= mem_limit, the memory won't be freed in
efi_free_boot_services()).

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Rob Landley <rob@landley.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoarch/x86/mm/init_64.c: fix build warning when CONFIG_MEMORY_HOTREMOVE=n
Jianguo Wu [Tue, 26 Mar 2013 23:24:04 +0000 (10:24 +1100)]
arch/x86/mm/init_64.c: fix build warning when CONFIG_MEMORY_HOTREMOVE=n

There is a warning while building kernel with
CONFIG_MEMORY_HOTPLUG=y && CONFIG_MEMORY_HOTREMOVE=n:
arch/x86/mm/init_64.c:1024: warning:kernel_physical_mapping_remove defined but not used

So move kernel_physical_mapping_remove() into "#ifdef
CONFIG_MEMORY_HOTREMOVE" block

Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Liujiang <jiang.liu@huawei.com>
Cc: qiuxishi <qiuxishi@huawei.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agokthread: kill task_get_live_kthread()
Oleg Nesterov [Tue, 26 Mar 2013 23:24:03 +0000 (10:24 +1100)]
kthread: kill task_get_live_kthread()

task_get_live_kthread() looks confusing and unneeded.  It does
get_task_struct() but only kthread_stop() needs this, it can be called
even if the calller doesn't have a reference when we know that this
kthread can't exit until we do kthread_stop().

kthread_park() and kthread_unpark() do not need get_task_struct(), the
callers already have the reference.  And it can not help if we can race
with the exiting kthread anyway, kthread_park() can hang forever in this
case.

Change kthread_park() and kthread_unpark() to use to_live_kthread(),
change kthread_stop() to do get_task_struct() by hand and remove
task_get_live_kthread().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agokthread: introduce to_live_kthread()
Oleg Nesterov [Tue, 26 Mar 2013 23:24:03 +0000 (10:24 +1100)]
kthread: introduce to_live_kthread()

"k->vfork_done != NULL" with a barrier() after to_kthread(k) in
task_get_live_kthread(k) looks unclear, and sub-optimal because we load
->vfork_done twice.

All we need is to ensure that we do not return to_kthread(NULL).  Add a
new trivial helper which loads/checks ->vfork_done once, this also looks
more understandable.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/char/random.c: fix priming of last_data
Jarod Wilson [Tue, 26 Mar 2013 23:24:03 +0000 (10:24 +1100)]
drivers/char/random.c: fix priming of last_data

Commit ec8f02da9e ("random: prime last_data value per fips requirements")
added priming of last_data per fips requirements.  Unfortuantely, it did
so in a way that can lead to multiple threads all incrementing nbytes, but
only one actually doing anything with the extra data, which leads to some
fun random corruption and panics.

The fix is to simply do everything needed to prime last_data in a single
shot, so there's no window for multiple cpus to increment nbytes -- in
fact, we won't even increment or decrement nbytes anymore, we'll just
extract the needed EXTRACT_SIZE one time per pool and then carry on with
the normal routine.

All these changes have been tested across multiple hosts and architectures
where panics were previously encoutered.  The code changes are are
strictly limited to areas only touched when when booted in fips mode.

This change should also go into 3.8-stable, to make the myriads of fips
users on 3.8.x happy.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Tested-by: Jan Stodola <jstodola@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Matt Mackall <mpm@selenic.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomips: define KVM_USER_MEM_SLOTS
Sanjay Lal [Tue, 26 Mar 2013 23:24:02 +0000 (10:24 +1100)]
mips: define KVM_USER_MEM_SLOTS

ARCH=mips, config=fuloong2e_defconfig:

akpm3:/usr/src/25> make arch/mips/kernel/early_printk.o
...
CC      arch/mips/kernel/asm-offsets.s
In file included from arch/mips/kernel/asm-offsets.c:20:
include/linux/kvm_host.h:334: error: `KVM_USER_MEM_SLOTS' undeclared here (not in a function)

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agothinkpad-acpi: kill hotkey_thread_mutex
Oleg Nesterov [Tue, 26 Mar 2013 23:24:02 +0000 (10:24 +1100)]
thinkpad-acpi: kill hotkey_thread_mutex

hotkey_kthread() does try_to_freeze() under hotkey_thread_mutex.

We can simply kill this mutex, hotkey_poll_stop_sync() does not need to
serialize with hotkey_kthread().  When kthread_stop() returns the thread
is already dead, it called do_exit()->complete_vfork_done().

Reported-by: Artem Savkov <artem.savkov@gmail.com>
Reported-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Aaron Lu <aaron.lu@intel.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorevert "ipc: don't allocate a copy larger than max"
Andrew Morton [Tue, 26 Mar 2013 23:24:02 +0000 (10:24 +1100)]
revert "ipc: don't allocate a copy larger than max"

Revert 88b9e456b164.  Dave has confirmed that this was causing oopses
during trinity testing.

Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Reported-by: Dave Jones <davej@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoMerge remote-tracking branch 'lzo-update/lzo-update'
Stephen Rothwell [Thu, 4 Apr 2013 05:50:44 +0000 (16:50 +1100)]
Merge remote-tracking branch 'lzo-update/lzo-update'

11 years agoMerge remote-tracking branch 'clk/clk-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:49:09 +0000 (16:49 +1100)]
Merge remote-tracking branch 'clk/clk-next'

11 years agoMerge remote-tracking branch 'signal/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:41:25 +0000 (16:41 +1100)]
Merge remote-tracking branch 'signal/for-next'

Conflicts:
arch/mips/kernel/linux32.c
arch/tile/Kconfig
arch/tile/kernel/compat.c
fs/compat.c
fs/read_write.c
fs/read_write.h
fs/splice.c
include/asm-generic/unistd.h

11 years agoMerge remote-tracking branch 'userns/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:25:43 +0000 (16:25 +1100)]
Merge remote-tracking branch 'userns/for-next'

11 years agoMerge remote-tracking branch 'pwm/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:24:10 +0000 (16:24 +1100)]
Merge remote-tracking branch 'pwm/for-next'

11 years agoMerge remote-tracking branch 'tegra/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:22:35 +0000 (16:22 +1100)]
Merge remote-tracking branch 'tegra/for-next'

Conflicts:
arch/arm/mach-tegra/tegra.c
drivers/clocksource/tegra20_timer.c

11 years agoMerge remote-tracking branch 'samsung/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:20:58 +0000 (16:20 +1100)]
Merge remote-tracking branch 'samsung/for-next'

11 years agoMerge remote-tracking branch 'renesas/next'
Stephen Rothwell [Thu, 4 Apr 2013 05:20:50 +0000 (16:20 +1100)]
Merge remote-tracking branch 'renesas/next'

11 years agoMerge remote-tracking branch 'msm/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:19:19 +0000 (16:19 +1100)]
Merge remote-tracking branch 'msm/for-next'

11 years agoMerge remote-tracking branch 'imx-mxs/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:17:41 +0000 (16:17 +1100)]
Merge remote-tracking branch 'imx-mxs/for-next'

Conflicts:
arch/arm/Kconfig.debug
arch/arm/mach-imx/cpufreq.c
drivers/clocksource/Makefile

11 years agoMerge remote-tracking branch 'ep93xx/ep93xx-for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:11:09 +0000 (16:11 +1100)]
Merge remote-tracking branch 'ep93xx/ep93xx-for-next'

11 years agoMerge remote-tracking branch 'bcm2835/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:09:34 +0000 (16:09 +1100)]
Merge remote-tracking branch 'bcm2835/for-next'

Conflicts:
arch/arm/Kconfig
arch/arm/Kconfig.debug

11 years agoMerge remote-tracking branch 'arm-soc/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 05:03:01 +0000 (16:03 +1100)]
Merge remote-tracking branch 'arm-soc/for-next'

11 years agoMerge remote-tracking branch 'mailbox/dbx500-prcmu-mailbox'
Stephen Rothwell [Thu, 4 Apr 2013 05:01:31 +0000 (16:01 +1100)]
Merge remote-tracking branch 'mailbox/dbx500-prcmu-mailbox'

11 years agoMerge remote-tracking branch 'gen-gpio/for_next'
Stephen Rothwell [Thu, 4 Apr 2013 04:59:58 +0000 (15:59 +1100)]
Merge remote-tracking branch 'gen-gpio/for_next'

Conflicts:
arch/sh/kernel/cpu/sh2a/Makefile

11 years agoMerge remote-tracking branch 'gpio-lw/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 04:58:26 +0000 (15:58 +1100)]
Merge remote-tracking branch 'gpio-lw/for-next'

11 years agoMerge remote-tracking branch 'gpio/gpio/next'
Stephen Rothwell [Thu, 4 Apr 2013 04:56:56 +0000 (15:56 +1100)]
Merge remote-tracking branch 'gpio/gpio/next'

11 years agoMerge remote-tracking branch 'irqdomain/irqdomain/next'
Stephen Rothwell [Thu, 4 Apr 2013 04:55:25 +0000 (15:55 +1100)]
Merge remote-tracking branch 'irqdomain/irqdomain/next'

11 years agoMerge remote-tracking branch 'vhost/linux-next'
Stephen Rothwell [Thu, 4 Apr 2013 04:53:46 +0000 (15:53 +1100)]
Merge remote-tracking branch 'vhost/linux-next'

Conflicts:
drivers/vhost/Makefile

11 years agoMerge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 04:52:02 +0000 (15:52 +1100)]
Merge remote-tracking branch 'pinctrl/for-next'

11 years agoMerge remote-tracking branch 'bcon/master'
Stephen Rothwell [Thu, 4 Apr 2013 04:49:50 +0000 (15:49 +1100)]
Merge remote-tracking branch 'bcon/master'

Conflicts:
drivers/block/Kconfig

11 years agoMerge remote-tracking branch 'char-misc/char-misc-next'
Stephen Rothwell [Thu, 4 Apr 2013 04:45:09 +0000 (15:45 +1100)]
Merge remote-tracking branch 'char-misc/char-misc-next'

11 years agoMerge remote-tracking branch 'staging/staging-next'
Stephen Rothwell [Thu, 4 Apr 2013 04:43:21 +0000 (15:43 +1100)]
Merge remote-tracking branch 'staging/staging-next'

Conflicts:
drivers/staging/ccg/f_fs.c
drivers/staging/ccg/rndis.c
drivers/staging/dgrp/dgrp_dpa_ops.c
drivers/staging/dgrp/dgrp_mon_ops.c
drivers/staging/dgrp/dgrp_net_ops.c
drivers/staging/dgrp/dgrp_ports_ops.c
drivers/staging/dgrp/dgrp_specproc.c

11 years agoMerge remote-tracking branch 'usb-gadget/next'
Stephen Rothwell [Thu, 4 Apr 2013 04:18:23 +0000 (15:18 +1100)]
Merge remote-tracking branch 'usb-gadget/next'

Conflicts:
drivers/usb/chipidea/udc.c
drivers/usb/gadget/net2272.c
drivers/usb/gadget/net2280.c
drivers/usb/host/ehci-tegra.c

11 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:53:45 +0000 (14:53 +1100)]
Merge remote-tracking branch 'usb/usb-next'

Conflicts:
drivers/usb/serial/usb-serial.c

11 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:52:00 +0000 (14:52 +1100)]
Merge remote-tracking branch 'tty/tty-next'

11 years agoMerge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:45:07 +0000 (14:45 +1100)]
Merge remote-tracking branch 'driver-core/driver-core-next'

11 years agoMerge remote-tracking branch 'leds/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:43:18 +0000 (14:43 +1100)]
Merge remote-tracking branch 'leds/for-next'

11 years agoMerge remote-tracking branch 'regmap/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:41:34 +0000 (14:41 +1100)]
Merge remote-tracking branch 'regmap/for-next'

11 years agoMerge remote-tracking branch 'drivers-x86/linux-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:41:21 +0000 (14:41 +1100)]
Merge remote-tracking branch 'drivers-x86/linux-next'

Conflicts:
drivers/platform/x86/chromeos_laptop.c

11 years agoMerge remote-tracking branch 'workqueues/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:39:47 +0000 (14:39 +1100)]
Merge remote-tracking branch 'workqueues/for-next'

11 years agoMerge remote-tracking branch 'percpu/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:38:18 +0000 (14:38 +1100)]
Merge remote-tracking branch 'percpu/for-next'

11 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:31:51 +0000 (14:31 +1100)]
Merge remote-tracking branch 'xen-two/linux-next'

11 years agoMerge remote-tracking branch 'kvm-ppc/kvm-ppc-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:30:12 +0000 (14:30 +1100)]
Merge remote-tracking branch 'kvm-ppc/kvm-ppc-next'

11 years agoMerge remote-tracking branch 'kvm/linux-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:28:35 +0000 (14:28 +1100)]
Merge remote-tracking branch 'kvm/linux-next'

Conflicts:
drivers/s390/kvm/virtio_ccw.c

11 years agoMerge remote-tracking branch 'rcu/rcu/next'
Stephen Rothwell [Thu, 4 Apr 2013 03:21:00 +0000 (14:21 +1100)]
Merge remote-tracking branch 'rcu/rcu/next'

11 years agoMerge remote-tracking branch 'ftrace/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:13:29 +0000 (14:13 +1100)]
Merge remote-tracking branch 'ftrace/for-next'

Conflicts:
kernel/trace/ftrace.c

11 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Thu, 4 Apr 2013 03:06:13 +0000 (14:06 +1100)]
Merge remote-tracking branch 'tip/auto-latest'

11 years agoMerge remote-tracking branch 'spi-mb/spi-next'
Stephen Rothwell [Thu, 4 Apr 2013 03:04:27 +0000 (14:04 +1100)]
Merge remote-tracking branch 'spi-mb/spi-next'

11 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 02:55:36 +0000 (13:55 +1100)]
Merge remote-tracking branch 'trivial/for-next'

Conflicts:
Documentation/virtual/virtio-spec.txt

11 years agoMerge remote-tracking branch 'vfio/next'
Stephen Rothwell [Thu, 4 Apr 2013 02:50:15 +0000 (13:50 +1100)]
Merge remote-tracking branch 'vfio/next'

11 years agoMerge remote-tracking branch 'iommu/next'
Stephen Rothwell [Thu, 4 Apr 2013 02:48:45 +0000 (13:48 +1100)]
Merge remote-tracking branch 'iommu/next'

11 years agoMerge remote-tracking branch 'watchdog/master'
Stephen Rothwell [Thu, 4 Apr 2013 02:47:11 +0000 (13:47 +1100)]
Merge remote-tracking branch 'watchdog/master'

11 years agoMerge remote-tracking branch 'selinux/master'
Stephen Rothwell [Thu, 4 Apr 2013 02:47:03 +0000 (13:47 +1100)]
Merge remote-tracking branch 'selinux/master'

11 years agoMerge remote-tracking branch 'security/next'
Stephen Rothwell [Thu, 4 Apr 2013 02:42:09 +0000 (13:42 +1100)]
Merge remote-tracking branch 'security/next'

11 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Thu, 4 Apr 2013 02:40:34 +0000 (13:40 +1100)]
Merge remote-tracking branch 'regulator/for-next'