]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoAdd linux-next specific files for 20120803 next-20120803
Stephen Rothwell [Fri, 3 Aug 2012 03:47:44 +0000 (13:47 +1000)]
Add linux-next specific files for 20120803

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
11 years agoMerge branch 'quilt/akpm'
Stephen Rothwell [Fri, 3 Aug 2012 03:25:55 +0000 (13:25 +1000)]
Merge branch 'quilt/akpm'

11 years agoipc/sem.c: alternatives to preempt_disable()
Manfred Spraul [Sat, 21 Jul 2012 00:55:14 +0000 (10:55 +1000)]
ipc/sem.c: alternatives to preempt_disable()

ipc/sem.c uses a custom wakeup scheme that relies on preempt_disable().
On -RT, this causes increased latencies and debug warnings.

The patch adds two additional schemes:
- one built around a completion - could be better for -RT kernels
- one built around a spinlock - unfortunately it's broken
- and the current one

My preferred solution would be the spinlock implementation: RT would use
premptible spinlocks, mainline normal spinlocks.  Thus both get the
optimal implementation without any special code in ipc/sem.c.
Unfortunately, I don't see how it could be fixed.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofat (exportfs): fix dentry reconnection
Steven J. Magnani [Sat, 21 Jul 2012 00:55:10 +0000 (10:55 +1000)]
fat (exportfs): fix dentry reconnection

Maintain an index of directory inodes by starting cluster, so that
fat_get_parent() can return the proper cached inode rather than inventing
one that cannot be traced back to the filesystem root.

Add a new msdos/vfat binary mount option "nfs" so that FAT filesystems
that are _not_ exported via NFS are not saddled with maintenance of an
index they will never use.

Finally, simplify NFS file handle generation and lookups.  An
ext2-congruent implementation is adequate for FAT needs.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofat (exportfs): move NFS support code
Steven J. Magnani [Sat, 21 Jul 2012 00:55:09 +0000 (10:55 +1000)]
fat (exportfs): move NFS support code

Under memory pressure, the system may evict dentries from cache.  When the
FAT driver receives a NFS request involving an evicted dentry, it is
unable to reconnect it to the filesystem root.  This causes the request to
fail, often with ENOENT.

This is partially due to ineffectiveness of the current FAT NFS
implementation, and partially due to an unimplemented fh_to_parent method.
 The latter can cause file accesses to fail on shares exported with
subtree_check.

This patch set provides the FAT driver with the ability to
reconnect dentries.  NFS file handle generation and lookups are simplified
and made congruent with ext2.

Testing has involved a memory-starved virtual machine running 3.5-rc5 that
exports a ~2 GB vfat filesystem containing a kernel tree (~770 MB, ~40000
files, 9 levels).  Both 'cp -r' and 'ls -lR' operations were performed
from a client, some overlapping, some consecutive.  Exports with
'subtree_check' and 'no_subtree_check' have been tested.

Note that while this patch set improves FAT's NFS support, it does not
eliminate ESTALE errors completely.

The following should be considered for NFS clients who are sensitive to ESTALE:

* Mounting with lookupcache=none
  Unfortunately this can degrade performance severely, particularly for deep
  filesystems.

* Incorporating VFS patches to retry ESTALE failures on the client-side,
  such as https://lkml.org/lkml/2012/6/29/381

* Handling ESTALE errors in client application code

This patch:

Move NFS-related code into its own C file.  No functional changes.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agonsproxy: move free_nsproxy() out of do_exit() path
Kirill A. Shutemov [Sat, 21 Jul 2012 00:55:01 +0000 (10:55 +1000)]
nsproxy: move free_nsproxy() out of do_exit() path

free_nsproxy() is too heavy to be on the exit path.  Let's free namespaces
asynchronously to not block exit_group() syscall.

Microbenchmark:

: #define _GNU_SOURCE
: #include <unistd.h>
: #include <sched.h>
: #include <stdlib.h>
: #include <sys/wait.h>
:
: int
: main(void)
: {
:       int i;
:       for (i = 0; i < 1024; i++) {
:               if (fork()) {
:                       wait(NULL);
:                       continue;
:               }
:               unshare(CLONE_NEWIPC);
:               exit(0);
:       }
:       return 0;
: }

Before the patch:

real    0m8.335s
user    0m0.000s
sys     0m0.265s

After:

real    0m0.569s
user    0m0.001s
sys     0m0.154s

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Doug Ledford <dledford@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: optimize fetching of sibling node
Michel Lespinasse [Sat, 21 Jul 2012 00:54:59 +0000 (10:54 +1000)]
rbtree: optimize fetching of sibling node

When looking to fetch a node's sibling, we went through a sequence of:
- check if node is the parent's left child
- if it is, then fetch the parent's right child

This can be replaced with:
- fetch the parent's right child as an assumed sibling
- check that node is NOT the fetched child

This avoids fetching the parent's left child when node is actually
that child. Saves a bit on code size, though it doesn't seem to make
a large difference in speed.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: rb_erase updates and comments
Michel Lespinasse [Sat, 21 Jul 2012 00:54:58 +0000 (10:54 +1000)]
rbtree: rb_erase updates and comments

Minor updates to the rb_erase() function:
- Reorder code to put simplest / common case (no more than 1 child) first.
- Fetch the parent first, since it ends up being required in all 3 cases.
- Add a few comments to illustrate case 2 (node to remove has 2 childs,
  but one of them is the successor) and case 3 (node to remove has 2 childs,
  successor is a left-descendant of the right child).

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: coding style adjustments
Michel Lespinasse [Sat, 21 Jul 2012 00:54:58 +0000 (10:54 +1000)]
rbtree: coding style adjustments

Set comment and indentation style to be consistent with linux coding style
and the rest of the file, as suggested by Peter Zijlstra

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: low level optimizations in __rb_erase_color()
Michel Lespinasse [Sat, 21 Jul 2012 00:54:58 +0000 (10:54 +1000)]
rbtree: low level optimizations in __rb_erase_color()

In __rb_erase_color(), we often already have pointers to the nodes being
rotated and/or know what their colors must be, so we can generate more
efficient code than the generic __rb_rotate_left() and __rb_rotate_right()
functions.

Also when the current node is red or when flipping the sibling's color,
the parent is already known so we can use the more efficient
rb_set_parent_color() function to set the desired color.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: optimize case selection logic in __rb_erase_color()
Michel Lespinasse [Sat, 21 Jul 2012 00:54:57 +0000 (10:54 +1000)]
rbtree: optimize case selection logic in __rb_erase_color()

In __rb_erase_color(), we have to select one of 3 cases depending on the
color on the 'other' node children.  If both children are black, we flip a
few node colors and iterate.  Otherwise, we do either one or two tree
rotations, depending on the color of the 'other' child opposite to 'node',
and then we are done.

The corresponding logic had duplicate checks for the color of the 'other'
child opposite to 'node'.  It was checking it first to determine if both
children are black, and then to determine how many tree rotations are
required.  Rearrange the logic to avoid that extra check.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: adjust node color in __rb_erase_color() only when necessary
Michel Lespinasse [Sat, 21 Jul 2012 00:54:57 +0000 (10:54 +1000)]
rbtree: adjust node color in __rb_erase_color() only when necessary

In __rb_erase_color(), we were always setting a node to black after
exiting the main loop.  And in one case, after fixing up the tree to
satisfy all rbtree invariants, we were setting the current node to root
just to guarantee a loop exit, at which point the root would be set to
black.  However this is not necessary, as the root of an rbtree is already
known to be black.  The only case where the color flip is required is when
we exit the loop due to the current node being red, and it's easiest to
just do the flip at that point instead of doing it after the loop.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: low level optimizations in rb_insert_color()
Michel Lespinasse [Sat, 21 Jul 2012 00:54:57 +0000 (10:54 +1000)]
rbtree: low level optimizations in rb_insert_color()

- Use the newly introduced rb_set_parent_color() function to flip the color
  of nodes whose parent is already known.
- Optimize rb_parent() when the node is known to be red - there is no need
  to mask out the color in that case.
- Flipping gparent's color to red requires us to fetch its rb_parent_color
  field, so we can reuse it as the parent value for the next loop iteration.
- Do not use __rb_rotate_left() and __rb_rotate_right() to handle tree
  rotations: we already have pointers to all relevant nodes, and know their
  colors (either because we want to adjust it, or because we've tested it,
  or we can deduce it as black due to the node proximity to a known red node).
  So we can generate more efficient code by making use of the node pointers
  we already have, and setting both the parent and color attributes for
  nodes all at once. Also in Case 2, some node attributes don't have to
  be set because we know another tree rotation (Case 3) will always follow
  and override them.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: adjust root color in rb_insert_color() only when necessary
Michel Lespinasse [Sat, 21 Jul 2012 00:54:56 +0000 (10:54 +1000)]
rbtree: adjust root color in rb_insert_color() only when necessary

The root node of an rbtree must always be black.  However,
rb_insert_color() only needs to maintain this invariant when it has been
broken - that is, when it exits the loop due to the current (red) node
being the root.  In all other cases (exiting after tree rotations, or
exiting due to an existing black parent) the invariant is already
satisfied, so there is no need to adjust the root node color.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: break out of rb_insert_color loop after tree rotation
Michel Lespinasse [Sat, 21 Jul 2012 00:54:56 +0000 (10:54 +1000)]
rbtree: break out of rb_insert_color loop after tree rotation

It is a well known property of rbtrees that insertion never requires more
than two tree rotations.  In our implementation, after one loop iteration
identified one or two necessary tree rotations, we would iterate and look
for more.  However at that point the node's parent would always be black,
which would cause us to exit the loop.

We can make the code flow more obvious by just adding a break statement
after the tree rotations, where we know we are done.  Additionally, in the
cases where two tree rotations are necessary, we don't have to update the
'node' pointer as it wouldn't be used until the next loop iteration, which
we now avoid due to this break statement.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: performance and correctness test
Michel Lespinasse [Sat, 21 Jul 2012 00:54:56 +0000 (10:54 +1000)]
rbtree: performance and correctness test

This small module helps measure the performance of rbtree insert and
erase.

Additionally, we run a few correctness tests to check that the rbtrees
have all desired properties:

- contains the right number of nodes in the order desired,
- never two consecutive red nodes on any path,
- all paths to leaf nodes have the same number of black nodes,
- root node is black

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: fix jffs2 build issue due to renamed __rb_parent_color field
David Woodhouse [Sat, 21 Jul 2012 00:54:55 +0000 (10:54 +1000)]
rbtree: fix jffs2 build issue due to renamed __rb_parent_color field

... and clean up the comments to better explain why it's acceptable to
do it this way instead of using rb_erase() "properly".

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: move some implementation details from rbtree.h to rbtree.c
Michel Lespinasse [Sat, 21 Jul 2012 00:54:55 +0000 (10:54 +1000)]
rbtree: move some implementation details from rbtree.h to rbtree.c

rbtree users must use the documented APIs to manipulate the tree
structure.  Low-level helpers to manipulate node colors and parenthood are
not part of that API, so move them to lib/rbtree.c

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: fix incorrect rbtree node insertion in fs/proc/proc_sysctl.c
Michel Lespinasse [Sat, 21 Jul 2012 00:54:55 +0000 (10:54 +1000)]
rbtree: fix incorrect rbtree node insertion in fs/proc/proc_sysctl.c

The recently added code to use rbtrees in sysctl did not follow the proper
rbtree interface on insertion - it was calling rb_link_node() which
inserts a new node into the binary tree, but missed the call to
rb_insert_color() which properly balances the rbtree and establishes all
expected rbtree invariants.

I found out about this only because faulty commit also used
rb_init_node(), which I am removing within this patchset.  But I think
it's an easy mistake to make, and it makes me wonder if we should change
the rbtree API so that insertions would be done with a single rb_insert()
call (even if its implementation could still inline the rb_link_node()
part and call a private __rb_insert_color function to do the rebalancing).

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: empty nodes have no color
Michel Lespinasse [Sat, 21 Jul 2012 00:54:54 +0000 (10:54 +1000)]
rbtree: empty nodes have no color

Empty nodes have no color.  We can make use of this property to simplify
the code emitted by the RB_EMPTY_NODE and RB_CLEAR_NODE macros.  Also, we
can get rid of the rb_init_node function which had been introduced by
88d19cf37952 ("timers: Add rb_init_node() to allow for stack allocated rb
nodes") to avoid some issue with the empty node's color not being
initialized.

I'm not sure what the RB_EMPTY_NODE checks in rb_prev() / rb_next() are
doing there, though.  axboe introduced them in 10fd48f2376d ("rbtree:
fixed reversed RB_EMPTY_NODE and rb_next/prev").  The way I see it, the
'empty node' abstraction is only used by rbtree users to flag nodes that
they haven't inserted in any rbtree, so asking the predecessor or
successor of such nodes doesn't make any sense.

One final rb_init_node() caller was recently added in sysctl code to
implement faster sysctl name lookups.  This code doesn't make use of
RB_EMPTY_NODE at all, and from what I could see it only called
rb_init_node() under the mistaken assumption that such initialization was
required before node insertion.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorbtree: reference Documentation/rbtree.txt for usage instructions
Michel Lespinasse [Sat, 21 Jul 2012 00:54:54 +0000 (10:54 +1000)]
rbtree: reference Documentation/rbtree.txt for usage instructions

I recently started looking at the rbtree code (with an eye towards
improving the augmented rbtree support, but I haven't gotten there yet).
I noticed a lot of possible speed improvements, which I am now proposing
in this patch set.

Patches 1-4 are preparatory: remove internal functions from rbtree.h so
that users won't be tempted to use them instead of the documented APIs,
clean up some incorrect usages I've noticed (in particular, with the
recently added fs/proc/proc_sysctl.c rbtree usage), reference the
documentation so that people have one less excuse to miss it, etc.

Patch 5 is a small module I wrote to check the rbtree performance.  It
creates 100 nodes with random keys and repeatedly inserts and erases them
from an rbtree.  Additionally, it has code to check for rbtree invariants
after each insert or erase operation.

Patches 6-12 is where the rbtree optimizations are done, and they touch
only that one file, lib/rbtree.c .  I am getting good results out of these
- in my small benchmark doing rbtree insertion (including search) and
erase, I'm seeing a 30% runtime reduction on Sandybridge E5, which is more
than I initially thought would be possible.  (the results aren't as
impressive on my two other test hosts though, AMD barcelona and Intel
Westmere, where I am seeing 14% runtime reduction only).  The code size -
both source (ommiting comments) and compiled - is also shorter after these
changes.  However, I do admit that the updated code is more arduous to
read - one big reason for that is the removal of the tree rotation
helpers, which added some overhead but also made it easier to reason about
things locally.  Overall, I believe this is an acceptable compromise,
given that this code doesn't get modified very often, and that I have good
tests for it.

Upon Peter's suggestion, I added comments showing the rtree configuration
before every rotation.  I think they help; however it's still best to have
a copy of the cormen/leiserson/rivest book when digging into this code.

This patch: reference Documentation/rbtree.txt for usage instructions

include/linux/rbtree.h included some basic usage instructions, while
Documentation/rbtree.txt had some more complete and easier to follow
instructions.  Replacing the former with a reference to the latter.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc/mqueue: remove unnecessary rb_init_node() calls
Michel Lespinasse [Sat, 21 Jul 2012 00:54:54 +0000 (10:54 +1000)]
ipc/mqueue: remove unnecessary rb_init_node() calls

d6629859 ("ipc/mqueue: improve performance of send/recv") and ce2d52cc
("ipc/mqueue: add rbtree node caching support") introduced an rbtree of
message priorities, and usage of rb_init_node() to initialize the
corresponding nodes.  As it turns out, rb_init_node() is unnecessary here,
as the nodes are fully initialized on insertion by rb_link_node() and the
code doesn't access nodes that aren't inserted on the rbtree.

Removing the rb_init_node() calls as I removed that function during
rbtree API cleanups (the only other use of it was in a place that similarly
didn't require it).

Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofrv: kill used but uninitialized variable
Geert Uytterhoeven [Sat, 21 Jul 2012 00:54:35 +0000 (10:54 +1000)]
frv: kill used but uninitialized variable

Commit 6afe1a1fe8ff83f6a ("PM: Remove legacy PM") removed the
initialization of retval, causing:

arch/frv/kernel/pm.c: In function 'sysctl_pm_do_suspend':
arch/frv/kernel/pm.c:165:5: warning: 'retval' may be used uninitialized in this function [-Wuninitialized]

Remove the variable completely to fix this, and convert to a proper
switch (...) { ... } construct to improve readability.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotmpfs: interleave the starting node of /dev/shmem
Nathan Zimmer [Sat, 21 Jul 2012 00:54:35 +0000 (10:54 +1000)]
tmpfs: interleave the starting node of /dev/shmem

The tmpfs superblock grants an offset for each inode as they are created.
Each inode then uses that offset to provide a preferred first node for its
interleave in the newly provided shmem_interleave.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoshmem: provide vm_ops when also providing a mem policy
Nathan Zimmer [Sat, 21 Jul 2012 00:54:35 +0000 (10:54 +1000)]
shmem: provide vm_ops when also providing a mem policy

When tmpfs has the memory policy interleaved it always starts allocating
for each file at node 0.  When there are many small files the lower nodes
fill up disproportionately.

This patchset spreads out node usage by starting files at nodes other then
0.  The tmpfs superblock grants an offset for each inode as they are
created.  Each then uses that offset to proved a prefered first node for
its interleave in the shmem_interleave.

This patch:

Update shmem_get_policy() to use the vma_policy if provided.  This is to
allows us to safely provide shmem_vm_ops to the vma when the vm_file has
not been setup which is the case on the pseudo vmas.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agohugetlb: avoid taking i_mmap_mutex in unmap_single_vma() for hugetlb
Aneesh Kumar K.V [Sat, 21 Jul 2012 00:53:58 +0000 (10:53 +1000)]
hugetlb: avoid taking i_mmap_mutex in unmap_single_vma() for hugetlb

i_mmap_mutex lock was added in unmap_single_vma by 502717f4e ("hugetlb:
fix linked list corruption in unmap_hugepage_range()") but we don't use
page->lru in unmap_hugepage_range any more.  Also the lock was taken
higher up in the stack in some code path.  That would result in deadlock.

unmap_mapping_range (i_mmap_mutex)
 -> unmap_mapping_range_tree
    -> unmap_mapping_range_vma
       -> zap_page_range_single
         -> unmap_single_vma
      -> unmap_hugepage_range (i_mmap_mutex)

For shared pagetable support for huge pages, since pagetable pages are ref
counted we don't need any lock during huge_pmd_unshare.  We do take
i_mmap_mutex in huge_pmd_share while walking the vma_prio_tree in mapping.
(39dde65c9940c97f ("shared page table for hugetlb page")).

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoslab: do not call compound_head() in page_get_cache()
Michel Lespinasse [Sat, 21 Jul 2012 00:53:53 +0000 (10:53 +1000)]
slab: do not call compound_head() in page_get_cache()

page_get_cache() does not need to call compound_head(), as its unique
caller virt_to_slab() already makes sure to return a head page.

Additionally, removing the compound_head() call makes page_get_cache()
consistent with page_get_slab().

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomm/slab: remove duplicate check
Gavin Shan [Sat, 21 Jul 2012 00:53:53 +0000 (10:53 +1000)]
mm/slab: remove duplicate check

While allocating pages using buddy allocator, the compound page is
probably split up to free pages.  Under these circumstances, the compound
page should be destroyed by destroy_compound_page().  However, there is a
duplicate check to judge if the page is compound.

Remove the duplicate check since the compound_order() returns 0 when the
page doesn't have PG_head set in destroy_compound_page().  That is to say,
destroy_compound_page() needn't check PageHead().

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofs: push rcu_barrier() from deactivate_locked_super() to filesystems
Kirill A. Shutemov [Sat, 21 Jul 2012 00:53:51 +0000 (10:53 +1000)]
fs: push rcu_barrier() from deactivate_locked_super() to filesystems

There's no reason to call rcu_barrier() on every
deactivate_locked_super().  We only need to make sure that all delayed rcu
free inodes are flushed before we destroy related cache.

Removing rcu_barrier() from deactivate_locked_super() affects some fast
paths.  E.g.  on my machine exit_group() of a last process in IPC
namespace takes 0.07538s.  rcu_barrier() takes 0.05188s of that time.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovfs: increment iversion when a file is truncated
Dmitry Kasatkin [Sat, 21 Jul 2012 00:53:51 +0000 (10:53 +1000)]
vfs: increment iversion when a file is truncated

When a file is truncated with truncate()/ftruncate() and then closed,
iversion is not updated.  This patch uses ATTR_SIZE flag as an indication
to increment iversion.

Mimi said:

On fput(), i_version is used to detect and flag files that have changed
and need to be re-measured in the IMA measurement policy.  When a file
is truncated with truncate()/ftruncate() and then closed, i_version is
not updated.  As a result, although the file has changed, it will not be
re-measured and added to the IMA measurement list on subsequent access.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Acked-by: Mimi Zohar <zohar@us.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/scsi/atp870u.c: fix bad use of udelay
Martin Michlmayr [Sat, 21 Jul 2012 00:53:51 +0000 (10:53 +1000)]
drivers/scsi/atp870u.c: fix bad use of udelay

The ACARD driver calls udelay() with a value > 2000, which leads to
to the following compilation error on ARM:
  ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
  make[1]: *** [__modpost] Error 1

This is because udelay is defined on ARM, roughly speaking, as

#define udelay(n) ((n) > 2000 ? __bad_udelay() : \
__const_udelay((n) * ((2199023U*HZ)>>11)))

The argument to __const_udelay is the number of jiffies to wait divided by
4, but this does not work unless the multiplication does not overflow, and
that is what the build error is designed to prevent.  The intended
behavior can be achieved by using mdelay to call udelay multiple times in
a loop.

[jn: adding context]
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoocfs2: use bitmap_weight()
Akinobu Mita [Sat, 21 Jul 2012 00:53:50 +0000 (10:53 +1000)]
ocfs2: use bitmap_weight()

Use bitmap_weight() instead of reinventing the wheel.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoocfs2: use find_last_bit()
Akinobu Mita [Sat, 21 Jul 2012 00:53:50 +0000 (10:53 +1000)]
ocfs2: use find_last_bit()

We already have find_last_bit().  So just use it as described in the
comment.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoARM: exynos: add thermal sensor driver platform data support
Amit Daniel Kachhap [Sat, 21 Jul 2012 00:53:50 +0000 (10:53 +1000)]
ARM: exynos: add thermal sensor driver platform data support

Add necessary default platform data support needed for TMU driver.  This
dt/non-dt values are tested for origen exynos4210 and smdk exynos5250
platforms.

Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: SangWook Ju <sw.ju@samsung.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agothermal: exynos: register the tmu sensor with the kernel thermal layer
Amit Daniel Kachhap [Sat, 21 Jul 2012 00:53:50 +0000 (10:53 +1000)]
thermal: exynos: register the tmu sensor with the kernel thermal layer

This code added creates a link between temperature sensors, linux thermal
framework and cooling devices for samsung exynos platform.  This layer
monitors the temperature from the sensor and informs the generic thermal
layer to take the necessary cooling action.

[akpm@linux-foundation.org: fix comment layout]
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: SangWook Ju <sw.ju@samsung.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agothermal: exynos5: add exynos5 thermal sensor driver support
Amit Daniel Kachhap [Sat, 21 Jul 2012 00:53:49 +0000 (10:53 +1000)]
thermal: exynos5: add exynos5 thermal sensor driver support

Insert exynos5 TMU sensor changes into the thermal driver.  Some exynos4
changes are made generic for exynos series.

[akpm@linux-foundation.org: fix comment layout]
Signed-off-by: SangWook Ju <sw.ju@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agohwmon: exynos4: move thermal sensor driver to driver/thermal directory
Amit Daniel Kachhap [Sat, 21 Jul 2012 00:53:49 +0000 (10:53 +1000)]
hwmon: exynos4: move thermal sensor driver to driver/thermal directory

This movement is needed because the hwmon entries and corresponding sysfs
interface is a duplicate of utilities already provided by
driver/thermal/thermal_sys.c.  The goal is to place it in thermal folder
and add necessary functions to use the in-kernel thermal interfaces.

Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: SangWook Ju <sw.ju@samsung.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agothermal: add generic cpufreq cooling implementation
Amit Daniel Kachhap [Sat, 21 Jul 2012 00:53:49 +0000 (10:53 +1000)]
thermal: add generic cpufreq cooling implementation

This patchset introduces a new generic cooling device based on cpufreq
that can be used on non-ACPI platforms.  As a proof of concept, we have
drivers for the following platforms using this mechanism now:

 * Samsung Exynos (Exynos4 and Exynos5) in the current patchset.
 * TI OMAP (git://git.linaro.org/people/amitdanielk/linux.git omap4460_thermal)
 * Freescale i.MX (git://git.linaro.org/people/amitdanielk/linux.git imx6q_thermal)

There is a small change in cpufreq cooling registration APIs, so a minor
change is needed for OMAP and Freescale platforms.

Brief Description:

1) The generic cooling devices code is placed inside driver/thermal/*
   as placing inside acpi folder will need un-necessary enabling of acpi
   code.  This codes is architecture independent.

2) This patchset adds generic cpu cooling low level implementation
   through frequency clipping.  In future, other cpu related cooling
   devices may be added here.  An ACPI version of this already exists
   (drivers/acpi/processor_thermal.c) .  But this will be useful for
   platforms like ARM using the generic thermal interface along with the
   generic cpu cooling devices.  The cooling device registration API's
   return cooling device pointers which can be easily binded with the
   thermal zone trip points.  The important APIs exposed are,

   a) struct thermal_cooling_device *cpufreq_cooling_register(
struct freq_clip_table *tab_ptr, unsigned int tab_size)
   b) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

3) Samsung exynos platform thermal implementation is done using the
   generic cpu cooling APIs and the new trip type.  The temperature sensor
   driver present in the hwmon folder(registered as hwmon driver) is moved
   to thermal folder and registered as a thermal driver.

A simple data/control flow diagrams is shown below,

Core Linux thermal <----->  Exynos thermal interface <----- Temperature Sensor
  |                             |
 \|/                            |
  Cpufreq cooling device <---------------

TODO:
*Will send the DT enablement patches later after the driver is merged.

This patch:

Add support for generic cpu thermal cooling low level implementations
using frequency scaling up/down based on the registration parameters.
Different cpu related cooling devices can be registered by the user and
the binding of these cooling devices to the corresponding trip points can
be easily done as the registration APIs return the cooling device pointer.
The user of these APIs are responsible for passing clipping frequency .
The drivers can also register to recieve notification about any cooling
action called.

[akpm@linux-foundation.org: fix comment layout]
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: SangWook Ju <sw.ju@samsung.com>
Cc: Durgadoss <durgadoss.r@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agothermal: add Renesas R-Car thermal sensor support
Kuninori Morimoto [Sat, 21 Jul 2012 00:53:48 +0000 (10:53 +1000)]
thermal: add Renesas R-Car thermal sensor support

This patch add basic Renesas R-Car thermal sensor support.
It was tested on R-Car H1 Marzen board.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agothermal: fix potential out-of-bounds memory access
Guenter Roeck [Sat, 21 Jul 2012 00:53:48 +0000 (10:53 +1000)]
thermal: fix potential out-of-bounds memory access

temp_crit.name and temp_input.name have a length of 16 bytes.  Using
THERMAL_NAME_LENGTH (20) as length parameter for snprintf() may result in
out-of-bounds memory accesses.  Replace it with sizeof().

Addresses Coverity #115679

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotime: don't inline EXPORT_SYMBOL functions
Greg Kroah-Hartman [Sat, 21 Jul 2012 00:53:48 +0000 (10:53 +1000)]
time: don't inline EXPORT_SYMBOL functions

How is the compiler even handling exported functions that are marked
inline?  Anyway, these shouldn't be inline because of that, so remove that
marking.

Based on a larger patch by Mark Charlebois to get LLVM to build the
kernel.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Mark Charlebois <mcharleb@qualcomm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: hank <pyu@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agotimeconst.pl: remove deprecated defined(@array)
Dagfinn Ilmari Mannsåker [Sat, 21 Jul 2012 00:53:47 +0000 (10:53 +1000)]
timeconst.pl: remove deprecated defined(@array)

The use of defined() on arrays and hashes has been deprecated since perl
5.6, but until 5.17.6 it only warned on lexicals, not package globals.

Signed-off-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/dma/dmaengine.c: lower the priority of 'failed to get' dma channel message
Fabio Estevam [Sat, 21 Jul 2012 00:53:47 +0000 (10:53 +1000)]
drivers/dma/dmaengine.c: lower the priority of 'failed to get' dma channel message

Do the same as commit a03a202e9 ("dmaengine: failure to get a specific DMA
channel is not critical") to get rid of the following messages during
kernel boot:

dmaengine_get: failed to get dma1chan0: (-22)
dmaengine_get: failed to get dma1chan1: (-22)
dmaengine_get: failed to get dma1chan2: (-22)
dmaengine_get: failed to get dma1chan3: (-22)
dmaengine_get: failed to get dma1chan4: (-22)
dmaengine_get: failed to get dma1chan5: (-22)
dmaengine_get: failed to get dma1chan6: (-22)
dmaengine_get: failed to get dma1chan7: (-22)
dmaengine_get: failed to get dma1chan8: (-22)
dmaengine_get: failed to get dma1chan9: (-22)
dmaengine_get: failed to get dma1chan10: (-22)
dmaengine_get: failed to get dma1chan11: (-22)
dmaengine_get: failed to get dma1chan12: (-22)
dmaengine_get: failed to get dma1chan13: (-22)
dmaengine_get: failed to get dma1chan14: (-22)
dmaengine_get: failed to get dma1chan15: (-22)
dmaengine_get: failed to get dma1chan16: (-22)
dmaengine_get: failed to get dma1chan17: (-22)
dmaengine_get: failed to get dma1chan18: (-22)
dmaengine_get: failed to get dma1chan19: (-22)
dmaengine_get: failed to get dma1chan20: (-22)
dmaengine_get: failed to get dma1chan21: (-22)
dmaengine_get: failed to get dma1chan22: (-22)
dmaengine_get: failed to get dma1chan23: (-22)
dmaengine_get: failed to get dma1chan24: (-22)
dmaengine_get: failed to get dma1chan25: (-22)
dmaengine_get: failed to get dma1chan26: (-22)
dmaengine_get: failed to get dma1chan27: (-22)
dmaengine_get: failed to get dma1chan28: (-22)
dmaengine_get: failed to get dma1chan29: (-22)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it
Geert Uytterhoeven [Sat, 21 Jul 2012 00:53:46 +0000 (10:53 +1000)]
mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it

It seems the current (gcc 4.6.3) no longer provides this so make it
conditional.

As reported by Tony before, the mn10300 architecture cross-compiles with
gcc-4.6.3 if -mmem-funcs is not added to KBUILD_CFLAGS.

Reported-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoarch/x86/include/asm/spinlock.h: fix comment
Richard Weinberger [Sat, 21 Jul 2012 00:53:46 +0000 (10:53 +1000)]
arch/x86/include/asm/spinlock.h: fix comment

This comment is no longer true.  We support up to 2^16 CPUs because
__ticket_t is an u16 if NR_CPUS is larger than 256.

Signed-off-by: Richard Weinberger <richard@nod.at>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoarch/x86/platform/iris/iris.c: register a platform device and a platform driver
Shérab [Sat, 21 Jul 2012 00:53:45 +0000 (10:53 +1000)]
arch/x86/platform/iris/iris.c: register a platform device and a platform driver

This makes the iris driver use the platform API, so it is properly exposed
in /sys.

[akpm@linux-foundation.org: remove commented-out code, add missing space to printk, clean up code layout]
Signed-off-by: Shérab <Sebastien.Hinderer@ens-lyon.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoacpi_memhotplug.c: auto bind the memory device which is hotplugged before the driver...
Wen Congyang [Sat, 21 Jul 2012 00:53:45 +0000 (10:53 +1000)]
acpi_memhotplug.c: auto bind the memory device which is hotplugged before the driver is loaded

If the memory device is hotplugged before the driver is loaded, the user
cannot see this device under the directory /sys/bus/acpi/devices/, and the
user cannot bind it by hand after the driver is loaded.  This patch
introduces a new feature to bind such device when the driver is being
loaded.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoacpi_memhotplug.c: bind the memory device when the driver is being loaded
Wen Congyang [Sat, 21 Jul 2012 00:53:45 +0000 (10:53 +1000)]
acpi_memhotplug.c: bind the memory device when the driver is being loaded

We had introduced acpi_hotmem_initialized to avoid strange add_memory fail
message.  But the memory device may not be used by the kernel, and the
device should be bound when the driver is being loaded.  Remove
acpi_hotmem_initialized to allow that the device can be bound when the
driver is being loaded.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoacpi_memhotplug.c: don't allow to eject the memory device if it is being used
Wen Congyang [Sat, 21 Jul 2012 00:53:45 +0000 (10:53 +1000)]
acpi_memhotplug.c: don't allow to eject the memory device if it is being used

We eject the memory device even if it is in use.  It is very dangerous,
and it will cause the kernel to panic.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoacpi_memhotplug.c: remove memory info from list before freeing it
Wen Congyang [Sat, 21 Jul 2012 00:53:44 +0000 (10:53 +1000)]
acpi_memhotplug.c: remove memory info from list before freeing it

We free info, but we forget to remove it from the list.  It will cause
unexpected problems when we access the list next time.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoacpi_memhotplug.c: free memory device if acpi_memory_enable_device() failed
Wen Congyang [Sat, 21 Jul 2012 00:53:44 +0000 (10:53 +1000)]
acpi_memhotplug.c: free memory device if acpi_memory_enable_device() failed

If acpi_memory_enable_device() fails, acpi_memory_enable_device() will
return a non-zero value, which means we fail to bind the memory device to
this driver.  So we should free memory device before
acpi_memory_device_add() returns.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoacpi_memhotplug.c: fix memory leak when memory device is unbound from the module...
Wen Congyang [Sat, 21 Jul 2012 00:53:44 +0000 (10:53 +1000)]
acpi_memhotplug.c: fix memory leak when memory device is unbound from the module acpi_memhotplug

We allocate memory to store acpi_memory_info, so we should free it before
freeing mem_device.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: Yasuaki ISIMATU <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocciss: fix incorrect scsi status reporting
Stephen M. Cameron [Sat, 21 Jul 2012 00:53:43 +0000 (10:53 +1000)]
cciss: fix incorrect scsi status reporting

Delete code which sets SCSI status incorrectly as it's already been set
correctly above this incorrect code.  Bug was introduced by b0e15f6db1110
("cciss: fix typo that causes scsi status to be lost.") in 2009.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: Roel van Meer <roel.vanmeer@bokxing.nl>
Tested-by: Roel van Meer <roel.vanmeer@bokxing.nl>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoMerge branch 'signal/from-sfr'
Stephen Rothwell [Fri, 3 Aug 2012 03:15:42 +0000 (13:15 +1000)]
Merge branch 'signal/from-sfr'

Conflicts:
arch/arm/include/asm/thread_info.h
arch/powerpc/kernel/entry_64.S

11 years agoMerge remote-tracking branch 'userns/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:14:05 +0000 (13:14 +1000)]
Merge remote-tracking branch 'userns/for-next'

11 years agoMerge remote-tracking branch 'kvmtool/master'
Stephen Rothwell [Fri, 3 Aug 2012 03:12:30 +0000 (13:12 +1000)]
Merge remote-tracking branch 'kvmtool/master'

11 years agoMerge remote-tracking branch 'tegra/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:12:22 +0000 (13:12 +1000)]
Merge remote-tracking branch 'tegra/for-next'

11 years agoMerge remote-tracking branch 's5p/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:12:13 +0000 (13:12 +1000)]
Merge remote-tracking branch 's5p/for-next'

11 years agoMerge remote-tracking branch 'ep93xx/ep93xx-for-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:12:08 +0000 (13:12 +1000)]
Merge remote-tracking branch 'ep93xx/ep93xx-for-next'

11 years agoMerge remote-tracking branch 'arm-soc/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:10:37 +0000 (13:10 +1000)]
Merge remote-tracking branch 'arm-soc/for-next'

11 years agoMerge remote-tracking branch 'vhost/linux-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:10:20 +0000 (13:10 +1000)]
Merge remote-tracking branch 'vhost/linux-next'

Conflicts:
drivers/net/tun.c

11 years agoMerge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:08:48 +0000 (13:08 +1000)]
Merge remote-tracking branch 'pinctrl/for-next'

11 years agoMerge remote-tracking branch 'tmem/linux-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:08:37 +0000 (13:08 +1000)]
Merge remote-tracking branch 'tmem/linux-next'

11 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Fri, 3 Aug 2012 03:06:14 +0000 (13:06 +1000)]
Merge remote-tracking branch 'tty/tty-next'

Conflicts:
arch/um/drivers/line.c
arch/um/drivers/line.h

11 years agoMerge remote-tracking branch 'leds/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:20:26 +0000 (12:20 +1000)]
Merge remote-tracking branch 'leds/for-next'

11 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:18:31 +0000 (12:18 +1000)]
Merge remote-tracking branch 'xen-two/linux-next'

11 years agoMerge remote-tracking branch 'kvm-ppc/kvm-ppc-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:16:50 +0000 (12:16 +1000)]
Merge remote-tracking branch 'kvm-ppc/kvm-ppc-next'

11 years agoMerge remote-tracking branch 'kvm/linux-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:15:20 +0000 (12:15 +1000)]
Merge remote-tracking branch 'kvm/linux-next'

11 years agoMerge remote-tracking branch 'kmemleak/kmemleak'
Stephen Rothwell [Fri, 3 Aug 2012 02:13:44 +0000 (12:13 +1000)]
Merge remote-tracking branch 'kmemleak/kmemleak'

11 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Fri, 3 Aug 2012 02:06:20 +0000 (12:06 +1000)]
Merge remote-tracking branch 'tip/auto-latest'

11 years agoMerge remote-tracking branch 'edac-amd/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:06:06 +0000 (12:06 +1000)]
Merge remote-tracking branch 'edac-amd/for-next'

Conflicts:
Documentation/edac.txt
drivers/edac/amd64_edac.c

11 years agoMerge remote-tracking branch 'edac/linux_next'
Stephen Rothwell [Fri, 3 Aug 2012 02:05:59 +0000 (12:05 +1000)]
Merge remote-tracking branch 'edac/linux_next'

11 years agoMerge remote-tracking branch 'fsnotify/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:04:20 +0000 (12:04 +1000)]
Merge remote-tracking branch 'fsnotify/for-next'

11 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:04:16 +0000 (12:04 +1000)]
Merge remote-tracking branch 'pm/linux-next'

11 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:02:46 +0000 (12:02 +1000)]
Merge remote-tracking branch 'trivial/for-next'

11 years agoMerge remote-tracking branch 'osd/linux-next'
Stephen Rothwell [Fri, 3 Aug 2012 02:01:11 +0000 (12:01 +1000)]
Merge remote-tracking branch 'osd/linux-next'

11 years agoMerge remote-tracking branch 'vfio/next'
Stephen Rothwell [Fri, 3 Aug 2012 01:59:35 +0000 (11:59 +1000)]
Merge remote-tracking branch 'vfio/next'

11 years agoMerge remote-tracking branch 'watchdog/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:58:01 +0000 (11:58 +1000)]
Merge remote-tracking branch 'watchdog/master'

11 years agoMerge remote-tracking branch 'selinux/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:57:55 +0000 (11:57 +1000)]
Merge remote-tracking branch 'selinux/master'

11 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:56:26 +0000 (11:56 +1000)]
Merge remote-tracking branch 'regulator/for-next'

11 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:54:38 +0000 (11:54 +1000)]
Merge remote-tracking branch 'kgdb/kgdb-next'

11 years agoMerge remote-tracking branch 'block/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:52:04 +0000 (11:52 +1000)]
Merge remote-tracking branch 'block/for-next'

11 years agoMerge remote-tracking branch 'cgroup/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:52:02 +0000 (11:52 +1000)]
Merge remote-tracking branch 'cgroup/for-next'

11 years agoMerge remote-tracking branch 'input/next'
Stephen Rothwell [Fri, 3 Aug 2012 01:50:28 +0000 (11:50 +1000)]
Merge remote-tracking branch 'input/next'

11 years agoMerge branch 'quilt/rr'
Stephen Rothwell [Fri, 3 Aug 2012 01:45:26 +0000 (11:45 +1000)]
Merge branch 'quilt/rr'

11 years agoMerge remote-tracking branch 'drm/drm-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:45:19 +0000 (11:45 +1000)]
Merge remote-tracking branch 'drm/drm-next'

11 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:43:46 +0000 (11:43 +1000)]
Merge remote-tracking branch 'crypto/master'

11 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:42:15 +0000 (11:42 +1000)]
Merge remote-tracking branch 'l2-mtd/master'

Conflicts:
arch/arm/mach-imx/clk-imx6q.c

11 years agoMerge remote-tracking branch 'mtd/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:40:42 +0000 (11:40 +1000)]
Merge remote-tracking branch 'mtd/master'

11 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:39:08 +0000 (11:39 +1000)]
Merge remote-tracking branch 'bluetooth/master'

11 years agoMerge remote-tracking branch 'target-merge/for-next-merge'
Stephen Rothwell [Fri, 3 Aug 2012 01:37:26 +0000 (11:37 +1000)]
Merge remote-tracking branch 'target-merge/for-next-merge'

11 years agoMerge remote-tracking branch 'scsi/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:35:45 +0000 (11:35 +1000)]
Merge remote-tracking branch 'scsi/for-next'

Conflicts:
drivers/ata/libata-core.c

11 years agoMerge remote-tracking branch 'dlm/next'
Stephen Rothwell [Fri, 3 Aug 2012 01:34:19 +0000 (11:34 +1000)]
Merge remote-tracking branch 'dlm/next'

11 years agoMerge remote-tracking branch 'cpuidle/cpuidle-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:34:09 +0000 (11:34 +1000)]
Merge remote-tracking branch 'cpuidle/cpuidle-next'

Conflicts:
drivers/cpuidle/coupled.c

11 years agoRevert "ACPI: remove acpi_get_table_with_size() fucntion"
Stephen Rothwell [Fri, 3 Aug 2012 01:27:38 +0000 (11:27 +1000)]
Revert "ACPI: remove acpi_get_table_with_size() fucntion"

This reverts commit 705d9245d7148adb9ab44d77aa8ac1c3cadc2bb2.

11 years agoMerge remote-tracking branch 'acpi/next'
Stephen Rothwell [Fri, 3 Aug 2012 01:17:45 +0000 (11:17 +1000)]
Merge remote-tracking branch 'acpi/next'

11 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Fri, 3 Aug 2012 01:17:31 +0000 (11:17 +1000)]
Merge remote-tracking branch 'kbuild/for-next'

11 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:15:49 +0000 (11:15 +1000)]
Merge remote-tracking branch 'v4l-dvb/master'

Conflicts:
Documentation/feature-removal-schedule.txt

11 years agoMerge branch 'quilt/i2c'
Stephen Rothwell [Fri, 3 Aug 2012 01:14:21 +0000 (11:14 +1000)]
Merge branch 'quilt/i2c'

11 years agoMerge remote-tracking branch 'logfs/master'
Stephen Rothwell [Fri, 3 Aug 2012 01:12:47 +0000 (11:12 +1000)]
Merge remote-tracking branch 'logfs/master'