]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agodrivers/platform/x86/sony-laptop.c: fix scancodes
John Hughes [Fri, 16 Dec 2011 04:49:30 +0000 (15:49 +1100)]
drivers/platform/x86/sony-laptop.c: fix scancodes

The scancodes returned by the sony-laptop driver for function keys did not
match the scancodes used to remap keys.  Also, since the scancode was sent
to the input subsystem after the mapped keysym the /lib/udev/keymap
utility was confused about which scancode to report for which keysym.

This patch fixes the driver so the correct scancode is shown for each key.
 It also adds to the documentation a description of where to find the
scancodes.

Before the patch FN/E returned scancode 0x1B, but to remap scancode 0x14
had to be used.

Signed-off-by: John Hughes <john@calva.com>
Cc: Mattia Dongili <malattia@linux.it>
Cc: Matthew Garrett <mjg@redhat.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agox86, olpc: add debugfs interface for EC commands
Daniel Drake [Fri, 16 Dec 2011 04:49:29 +0000 (15:49 +1100)]
x86, olpc: add debugfs interface for EC commands

Add a debugfs interface for sending commands to the OLPC Embedded
Controller (EC) and reading the responses.  The EC provides functionality
for machine identification, battery and AC control, wakeup control, etc.

Having a debugfs interface available is useful for EC development and
debugging.

Based on code by Paul Fox.

Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Daniel Drake <dsd@laptop.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andres Salomon <dilinger@queued.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agomm-vmallocc-eliminate-extra-loop-in-pcpu_get_vm_areas-error-path-fix
Andrew Morton [Fri, 16 Dec 2011 04:49:29 +0000 (15:49 +1100)]
mm-vmallocc-eliminate-extra-loop-in-pcpu_get_vm_areas-error-path-fix

remove now-unneeded tests

Cc: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agomm/vmalloc.c: eliminate extra loop in pcpu_get_vm_areas error path
Kautuk Consul [Fri, 16 Dec 2011 04:49:29 +0000 (15:49 +1100)]
mm/vmalloc.c: eliminate extra loop in pcpu_get_vm_areas error path

If either of the vas or vms arrays are not properly kzalloced, then the
code jumps to the err_free label.

The err_free label runs a loop to check and free each of the array members
of the vas and vms arrays which is not required for this situation as none
of the array members have been allocated till this point.

Eliminate the extra loop we have to go through by introducing a new label
err_free2 and then jumping to it.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agox86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-v2
Daniel Drake [Fri, 16 Dec 2011 04:49:28 +0000 (15:49 +1100)]
x86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-v2

v2: Fix sscanf usage error and add an explanatory comment in the code, both pointed out by Andrew Morton. Thanks!

Signed-off-by: Daniel Drake <dsd@laptop.org>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Matthew Garrett <mjg@redhat.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>
12 years agox86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-fix
Andrew Morton [Fri, 16 Dec 2011 04:49:28 +0000 (15:49 +1100)]
x86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-fix

fix sscanf checking

Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Daniel Drake <dsd@laptop.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agox86, olpc-xo15-sci: enable lid close wakeup control through sysfs
Daniel Drake [Fri, 16 Dec 2011 04:49:28 +0000 (15:49 +1100)]
x86, olpc-xo15-sci: enable lid close wakeup control through sysfs

Like most systems, OLPC's ACPI LID switch wakes up the system when the lid
is opened, but not when it is closed.

Under OLPC's opportunistic suspend model, the lid may be closed while the
system was oportunistically suspended with the screen running.  In this
event, we want to wake up to turn the screen off.

Enable control of normal ACPI wakeups through lid close events through a
new sysfs attribute "lid_wake_on_closed".  When set, and when LID wakeups
are enabled through ACPI, the system will wake up on both open and close
lid events.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Matthew Garrett <mjg@redhat.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>
12 years agoarch/x86/platform/iris/iris.c: register a platform device and a platform driver
Shérab [Fri, 16 Dec 2011 04:49:27 +0000 (15:49 +1100)]
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>
12 years agoacerhdf: lowered default temp fanon/fanoff values
Peter Feuerer [Fri, 16 Dec 2011 04:49:27 +0000 (15:49 +1100)]
acerhdf: lowered default temp fanon/fanoff values

Due to new supported hardware, of which the actual temperature limits of
processor, harddisk and other components are unknown, it feels safer with
lower fanon / fanoff settings.

It won't change much for most people, already using acerhdf, as they use
their own fanon/fanoff variable settings when loading the module.

Furthermore seems like kernel and userspace tools have been improved to
work more efficient and netbooks don't get so hot anymore.

Signed-off-by: Peter Feuerer <peter@piie.net>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agoacerhdf: add support for new hardware
Peter Feuerer [Fri, 16 Dec 2011 04:49:27 +0000 (15:49 +1100)]
acerhdf: add support for new hardware

Add support for new hardware:
Acer Aspire LT-10Q/531/751/1810/1825,
Acer Travelmate 7730,
Packard Bell ENBFT/DOTVR46

Signed-off-by: Peter Feuerer <peter@piie.net>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agoacerhdf: add support for Aspire 1410 BIOS v1.3314
Clay Carpenter [Fri, 16 Dec 2011 04:49:26 +0000 (15:49 +1100)]
acerhdf: add support for Aspire 1410 BIOS v1.3314

Add support for Aspire 1410 BIOS v1.3314.  Fixes the following error:

acerhdf: unknown (unsupported) BIOS version Acer/Aspire 1410/v1.3314,
please report, aborting!

Signed-off-by: Clay Carpenter <claycarpenter@gmail.com>
Signed-off-by: Peter Feuerer <peter@piie.net>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agonet/netfilter/nf_conntrack_netlink.c: fix Oops on container destroy
Alex Bligh [Fri, 16 Dec 2011 04:49:26 +0000 (15:49 +1100)]
net/netfilter/nf_conntrack_netlink.c: fix Oops on container destroy

Problem:

A repeatable Oops can be caused if a container with networking
unshared is destroyed when it has nf_conntrack entries yet to expire.

A copy of the oops follows below. A perl program generating the oops
repeatably is attached inline below.

Analysis:

The oops is called from cleanup_net when the namespace is
destroyed. conntrack iterates through outstanding events and calls
death_by_timeout on each of them, which in turn produces a call to
ctnetlink_conntrack_event. This calls nf_netlink_has_listeners, which
oopses because net->nfnl is NULL.

The perl program generates the container through fork() then
clone(NS_NEWNET). I does not explicitly set up netlink
explicitly set up netlink, but I presume it was set up else net->nfnl
would have been NULL earlier (i.e. when an earlier connection
timed out). This would thus suggest that net->nfnl is made NULL
during the destruction of the container, which I think is done by
nfnetlink_net_exit_batch.

I can see that the various subsystems are deinitialised in the opposite
order to which the relevant register_pernet_subsys calls are called,
and both nf_conntrack and nfnetlink_net_ops register their relevant
subsystems. If nfnetlink_net_ops registered later than nfconntrack,
then its exit routine would have been called first, which would cause
the oops described. I am not sure there is anything to prevent this
happening in a container environment.

Whilst there's perhaps a more complex problem revolving around ordering
of subsystem deinit, it seems to me that missing a netlink event on a
container that is dying is not a disaster. An early check for net->nfnl
being non-NULL in ctnetlink_conntrack_event appears to fix this. There
may remain a potential race condition if it becomes NULL immediately
after being checked (I am not sure any lock is held at this point or
how synchronisation for subsystem deinitialization works).

Patch:

The patch attached should apply on everything from 2.6.26 (if not before)
onwards; it appears to be a problem on all kernels. This was taken against
Ubuntu-3.0.0-11.17 which is very close to 3.0.4. I have torture-tested it
with the above perl script for 15 minutes or so; the perl script hung the
machine within 20 seconds without this patch.

Applicability:

If this is the right solution, it should be applied to all stable kernels
as well as head. Apart from the minor overhead of checking one variable
against NULL, it can never 'do the wrong thing', because if net->nfnl
is NULL, an oops will inevitably result. Therefore, checking is a reasonable
thing to do unless it can be proven than net->nfnl will never be NULL.

Check net->nfnl for NULL in ctnetlink_conntrack_event to avoid Oops on
container destroy

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Cc: Patrick McHardy <kaber@trash.net>
Cc: David Miller <davem@davemloft.net>
Cc: <stable@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agobinary_sysctl(): fix memory leak
Michel Lespinasse [Fri, 16 Dec 2011 04:49:25 +0000 (15:49 +1100)]
binary_sysctl(): fix memory leak

binary_sysctl() calls sysctl_getname() which allocates from names_cache
slab usin __getname()

The matching function to free the name is __putname(), and not putname()
which should be used only to match getname() allocations.

This is because when auditing is enabled, putname() calls audit_putname
*instead* (not in addition) to __putname().  Then, if a syscall is in
progress, audit_putname does not release the name - instead, it expects
the name to get released when the syscall completes, but that will happen
only if audit_getname() was called previously, i.e.  if the name was
allocated with getname() rather than the naked __getname().  So,
__getname() followed by putname() ends up leaking memory.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Eric Paris <eparis@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agovmalloc: Remove static declaration of va from __get_vm_area_node
Kautuk Consul [Thu, 8 Dec 2011 07:50:21 +0000 (13:20 +0530)]
vmalloc: Remove static declaration of va from __get_vm_area_node

Static storage is not required for the struct vmap_area in
__get_vm_area_node.

Removing "static" to store this variable on the stack instead.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
12 years agoipmi_watchdog: restore settings when BMC reset
Corey Minyard [Fri, 16 Dec 2011 04:49:25 +0000 (15:49 +1100)]
ipmi_watchdog: restore settings when BMC reset

If the BMC gets reset, it will return 0x80 response errors.

In less than a week
# grep "Error 80 on cmd 22" /var/log/kernel |wc -l
378681

In this case, it is probably a good idea to restore the IPMI settings.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Arkadiusz Miśkiewicz <a.miskiewicz@gmail.com>
Reported-by: Arkadiusz Miśkiewicz <a.miskiewicz@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agooom: fix integer overflow of points in oom_badness
Frantisek Hrbata [Fri, 16 Dec 2011 04:49:24 +0000 (15:49 +1100)]
oom: fix integer overflow of points in oom_badness

An integer overflow will happen on 64bit archs if task's sum of rss,
swapents and nr_ptes exceeds (2^31)/1000 value.  This was introduced by
commit

f755a04 oom: use pte pages in OOM score

where the oom score computation was divided into several steps and it's no
longer computed as one expression in unsigned long(rss, swapents, nr_pte
are unsigned long), where the result value assigned to points(int) is in
range(1..1000).  So there could be an int overflow while computing

176          points *= 1000;

and points may have negative value. Meaning the oom score for a mem hog task
will be one.

196          if (points <= 0)
197                  return 1;

For example:
[ 3366]     0  3366 35390480 24303939   5       0             0 oom01
Out of memory: Kill process 3366 (oom01) score 1 or sacrifice child

Here the oom1 process consumes more than 24303939(rss)*4096~=92GB physical
memory, but it's oom score is one.

In this situation the mem hog task is skipped and oom killer kills another and
most probably innocent task with oom score greater than one.

The points variable should be of type long instead of int to prevent the
int overflow.

Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: <stable@vger.kernel.org> [2.6.36+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agomemcg: keep root group unchanged if creation fails
Hillf Danton [Fri, 16 Dec 2011 04:49:24 +0000 (15:49 +1100)]
memcg: keep root group unchanged if creation fails

If the request is to create non-root group and we fail to meet it, we
should leave the root unchanged.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agonilfs2: potential integer overflow in nilfs_ioctl_clean_segments()
Haogang Chen [Fri, 16 Dec 2011 04:49:23 +0000 (15:49 +1100)]
nilfs2: potential integer overflow in nilfs_ioctl_clean_segments()

There is a potential integer overflow in nilfs_ioctl_clean_segments().
When a large argv[n].v_nmembs is passed from the userspace, the subsequent
call to vmalloc() will allocate a buffer smaller than expected, which
leads to out-of-bound access in nilfs_ioctl_move_blocks() and
lfs_clean_segments().

The following check does not prevent the overflow because nsegs is also
controlled by the userspace and could be very large.

if (argv[n].v_nmembs > nsegs * nilfs->ns_blocks_per_segment)
goto out_free;

This patch clamps argv[n].v_nmembs to UINT_MAX / argv[n].v_size, and
returns -EINVAL when overflow.

Signed-off-by: Haogang Chen <haogangchen@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agonilfs2: unbreak compat ioctl
Thomas Meyer [Fri, 16 Dec 2011 04:49:23 +0000 (15:49 +1100)]
nilfs2: unbreak compat ioctl

commit 828b1c50ae ("nilfs2: add compat ioctl") incidentally broke all
other NILFS compat ioctls.  Make them work again.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: <stable@vger.kernel.org> [3.0+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agomemcg: add mem_cgroup_replace_page_cache() to fix LRU issue
KAMEZAWA Hiroyuki [Fri, 16 Dec 2011 04:49:23 +0000 (15:49 +1100)]
memcg: add mem_cgroup_replace_page_cache() to fix LRU issue

Commit ef6a3c6311 ("mm: add replace_page_cache_page() function") added a
function replace_page_cache_page().  This function replaces a page in the
radix-tree with a new page.  WHen doing this, memory cgroup needs to fix
up the accounting information.  memcg need to check PCG_USED bit etc.

In some(many?) cases, 'newpage' is on LRU before calling
replace_page_cache().  So, memcg's LRU accounting information should be
fixed, too.

This patch adds mem_cgroup_replace_page_cache() and removes the old hooks.
 In that function, old pages will be unaccounted without touching
res_counter and new page will be accounted to the memcg (of old page).
WHen overwriting pc->mem_cgroup of newpage, take zone->lru_lock and avoid
races with LRU handling.

Background:
  replace_page_cache_page() is called by FUSE code in its splice() handling.
  Here, 'newpage' is replacing oldpage but this newpage is not a newly allocated
  page and may be on LRU. LRU mis-accounting will be critical for memory cgroup
  because rmdir() checks the whole LRU is empty and there is no account leak.
  If a page is on the other LRU than it should be, rmdir() will fail.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agocpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix-2...
Andrew Morton [Fri, 16 Dec 2011 04:49:22 +0000 (15:49 +1100)]
cpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix-2-fix-2-fix

Cc: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Miao Xie <miaox@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agocpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix-2...
Andrew Morton [Fri, 16 Dec 2011 04:49:22 +0000 (15:49 +1100)]
cpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix-2-fix-2

Cc: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Miao Xie <miaox@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agocpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix-2
David Rientjes [Fri, 16 Dec 2011 04:49:22 +0000 (15:49 +1100)]
cpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix-2

Here's a cleaner way of doing it, we can extend it to mm/slab.c later.
Please fold into
cpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask.patch.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Miao Xie <miaox@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agocpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix
Andrew Morton [Fri, 16 Dec 2011 04:49:21 +0000 (15:49 +1100)]
cpusets-stall-when-updating-mems_allowed-for-mempolicy-or-disjoint-nodemask-fix

stupid temporary hack to make it build with CONFIG_NUMA=n

Cc: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Miao Xie <miaox@cn.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agocpusets: stall when updating mems_allowed for mempolicy or disjoint nodemask
David Rientjes [Fri, 16 Dec 2011 04:49:21 +0000 (15:49 +1100)]
cpusets: stall when updating mems_allowed for mempolicy or disjoint nodemask

Kernels where MAX_NUMNODES > BITS_PER_LONG may temporarily see an empty
nodemask in a tsk's mempolicy if its previous nodemask is remapped onto a
new set of allowed cpuset nodes where the two nodemasks, as a result of
the remap, are now disjoint.

c0ff7453bb5c ("cpuset,mm: fix no node to alloc memory when changing
cpuset's mems") adds get_mems_allowed() to prevent the set of allowed
nodes from changing for a thread.  This causes any update to a set of
allowed nodes to stall until put_mems_allowed() is called.

This stall is unncessary, however, if at least one node remains unchanged
in the update to the set of allowed nodes.  This was addressed by
89e8a244b97e ("cpusets: avoid looping when storing to mems_allowed if one
node remains set"), but it's still possible that an empty nodemask may be
read from a mempolicy because the old nodemask may be remapped to the new
nodemask during rebind.  To prevent this, only avoid the stall if there is
no mempolicy for the thread being changed.

This is a temporary solution until all reads from mempolicy nodemasks can
be guaranteed to not be empty without the get_mems_allowed()
synchronization.

Also moves the check for nodemask intersection inside task_lock() so that
tsk->mems_allowed cannot change.  This ensures that nothing can set this
tsk's mems_allowed out from under us and also protects tsk->mempolicy.

Reported-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Paul Menage <paul@paulmenage.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agoMerge remote-tracking branch 'uapi/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 07:03:12 +0000 (18:03 +1100)]
Merge remote-tracking branch 'uapi/for-next'

12 years agoMerge remote-tracking branch 'kvmtool/master'
Stephen Rothwell [Mon, 19 Dec 2011 07:00:40 +0000 (18:00 +1100)]
Merge remote-tracking branch 'kvmtool/master'

Conflicts:
include/net/9p/9p.h
scripts/kconfig/Makefile

12 years agoMerge remote-tracking branch 'remoteproc/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:46:36 +0000 (17:46 +1100)]
Merge remote-tracking branch 'remoteproc/for-next'

12 years agoMerge remote-tracking branch 'memblock/memblock-kill-early_node_map'
Stephen Rothwell [Mon, 19 Dec 2011 06:39:27 +0000 (17:39 +1100)]
Merge remote-tracking branch 'memblock/memblock-kill-early_node_map'

Conflicts:
arch/arm/mm/init.c
arch/score/Kconfig

12 years agoMerge remote-tracking branch 'xshm/xshm-for-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:37:56 +0000 (17:37 +1100)]
Merge remote-tracking branch 'xshm/xshm-for-next'

12 years agoMerge remote-tracking branch 'kmap_atomic/kmap_atomic'
Stephen Rothwell [Mon, 19 Dec 2011 06:34:48 +0000 (17:34 +1100)]
Merge remote-tracking branch 'kmap_atomic/kmap_atomic'

Conflicts:
Documentation/feature-removal-schedule.txt

12 years agoMerge remote-tracking branch 'vhost/linux-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:28:07 +0000 (17:28 +1100)]
Merge remote-tracking branch 'vhost/linux-next'

Conflicts:
arch/hexagon/Kconfig
arch/m68k/Kconfig

12 years agoMerge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:26:36 +0000 (17:26 +1100)]
Merge remote-tracking branch 'pinctrl/for-next'

12 years agoMerge remote-tracking branch 'writeback/writeback-for-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:20:12 +0000 (17:20 +1100)]
Merge remote-tracking branch 'writeback/writeback-for-next'

12 years agoMerge remote-tracking branch 'tmem/tmem'
Stephen Rothwell [Mon, 19 Dec 2011 06:18:17 +0000 (17:18 +1100)]
Merge remote-tracking branch 'tmem/tmem'

Conflicts:
mm/swapfile.c

12 years agoMerge remote-tracking branch 'char-misc/char-misc-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:16:40 +0000 (17:16 +1100)]
Merge remote-tracking branch 'char-misc/char-misc-next'

12 years agoMerge remote-tracking branch 'staging/staging-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:15:02 +0000 (17:15 +1100)]
Merge remote-tracking branch 'staging/staging-next'

Conflicts:
drivers/hid/hid-hyperv.c
drivers/staging/hv/Kconfig
drivers/staging/hv/Makefile
drivers/staging/iio/adc/ad799x_core.c

12 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:09:22 +0000 (17:09 +1100)]
Merge remote-tracking branch 'usb/usb-next'

12 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:07:26 +0000 (17:07 +1100)]
Merge remote-tracking branch 'tty/tty-next'

Conflicts:
drivers/tty/serial/Kconfig
drivers/tty/serial/Makefile

12 years agoMerge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Mon, 19 Dec 2011 06:00:35 +0000 (17:00 +1100)]
Merge remote-tracking branch 'driver-core/driver-core-next'

12 years agoMerge remote-tracking branch 'hsi/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 05:59:04 +0000 (16:59 +1100)]
Merge remote-tracking branch 'hsi/for-next'

12 years agoMerge commit 'refs/next/20111214/regmap'
Stephen Rothwell [Mon, 19 Dec 2011 05:53:13 +0000 (16:53 +1100)]
Merge commit 'refs/next/20111214/regmap'

Conflicts:
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap.c

12 years agoMerge remote-tracking branch 'namespace/master'
Stephen Rothwell [Mon, 19 Dec 2011 05:40:42 +0000 (16:40 +1100)]
Merge remote-tracking branch 'namespace/master'

12 years agoMerge remote-tracking branch 'sysctl/master'
Stephen Rothwell [Mon, 19 Dec 2011 05:39:05 +0000 (16:39 +1100)]
Merge remote-tracking branch 'sysctl/master'

12 years agoMerge remote-tracking branch 'percpu/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 05:37:27 +0000 (16:37 +1100)]
Merge remote-tracking branch 'percpu/for-next'

12 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Mon, 19 Dec 2011 05:31:26 +0000 (16:31 +1100)]
Merge remote-tracking branch 'xen-two/linux-next'

Conflicts:
arch/x86/xen/Kconfig

12 years agoMerge remote-tracking branch 'xen/upstream/xen'
Stephen Rothwell [Mon, 19 Dec 2011 05:29:48 +0000 (16:29 +1100)]
Merge remote-tracking branch 'xen/upstream/xen'

Conflicts:
arch/x86/xen/Kconfig

12 years agoMerge remote-tracking branch 'oprofile/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 05:23:49 +0000 (16:23 +1100)]
Merge remote-tracking branch 'oprofile/for-next'

12 years agoMerge remote-tracking branch 'kmemleak/kmemleak'
Stephen Rothwell [Mon, 19 Dec 2011 05:16:59 +0000 (16:16 +1100)]
Merge remote-tracking branch 'kmemleak/kmemleak'

12 years agoMerge remote-tracking branch 'cgroup/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 05:10:19 +0000 (16:10 +1100)]
Merge remote-tracking branch 'cgroup/for-next'

12 years agoMerge remote-tracking branch 'uprobes/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 04:56:27 +0000 (15:56 +1100)]
Merge remote-tracking branch 'uprobes/for-next'

12 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Mon, 19 Dec 2011 04:49:27 +0000 (15:49 +1100)]
Merge remote-tracking branch 'tip/auto-latest'

Conflicts:
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/macintosh/rack-meter.c
fs/proc/stat.c
fs/proc/uptime.c
kernel/sched/core.c
kernel/sched/fair.c

12 years agoMerge remote-tracking branch 'gpio/gpio/next'
Stephen Rothwell [Mon, 19 Dec 2011 04:24:43 +0000 (15:24 +1100)]
Merge remote-tracking branch 'gpio/gpio/next'

12 years agoMerge remote-tracking branch 'edac-amd/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 04:23:11 +0000 (15:23 +1100)]
Merge remote-tracking branch 'edac-amd/for-next'

12 years agoMerge remote-tracking branch 'fsnotify/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 04:20:04 +0000 (15:20 +1100)]
Merge remote-tracking branch 'fsnotify/for-next'

12 years agoMerge remote-tracking branch 'apm/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 04:18:32 +0000 (15:18 +1100)]
Merge remote-tracking branch 'apm/for-next'

12 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Mon, 19 Dec 2011 04:11:42 +0000 (15:11 +1100)]
Merge remote-tracking branch 'pm/linux-next'

Conflicts:
fs/xfs/xfs_buf.c

12 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 04:01:20 +0000 (15:01 +1100)]
Merge remote-tracking branch 'trivial/for-next'

Conflicts:
arch/powerpc/platforms/40x/Kconfig

12 years agoMerge remote-tracking branch 'osd/linux-next'
Stephen Rothwell [Mon, 19 Dec 2011 04:01:10 +0000 (15:01 +1100)]
Merge remote-tracking branch 'osd/linux-next'

12 years agoMerge remote-tracking branch 'cputime/cputime'
Stephen Rothwell [Mon, 19 Dec 2011 03:54:50 +0000 (14:54 +1100)]
Merge remote-tracking branch 'cputime/cputime'

12 years agoMerge remote-tracking branch 'iommu/next'
Stephen Rothwell [Mon, 19 Dec 2011 03:51:35 +0000 (14:51 +1100)]
Merge remote-tracking branch 'iommu/next'

Conflicts:
drivers/pci/hotplug/acpiphp_glue.c
include/linux/pci_regs.h

12 years agoMerge remote-tracking branch 'watchdog/linux-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:49:58 +0000 (14:49 +1100)]
Merge remote-tracking branch 'watchdog/linux-next'

12 years agoMerge remote-tracking branch 'security/next'
Stephen Rothwell [Mon, 19 Dec 2011 03:47:14 +0000 (14:47 +1100)]
Merge remote-tracking branch 'security/next'

Conflicts:
lib/Makefile

12 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:45:44 +0000 (14:45 +1100)]
Merge remote-tracking branch 'regulator/for-next'

12 years agoMerge remote-tracking branch 'fbdev/fbdev-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:44:12 +0000 (14:44 +1100)]
Merge remote-tracking branch 'fbdev/fbdev-next'

12 years agoMerge remote-tracking branch 'drm/drm-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:39:23 +0000 (14:39 +1100)]
Merge remote-tracking branch 'drm/drm-next'

Conflicts:
drivers/gpu/drm/nouveau/nouveau_sgdma.c

12 years agoMerge remote-tracking branch 'mfd/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:35:10 +0000 (14:35 +1100)]
Merge remote-tracking branch 'mfd/for-next'

12 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:33:41 +0000 (14:33 +1100)]
Merge remote-tracking branch 'md/for-next'

12 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:32:08 +0000 (14:32 +1100)]
Merge remote-tracking branch 'slab/for-next'

12 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:31:59 +0000 (14:31 +1100)]
Merge remote-tracking branch 'kgdb/kgdb-next'

12 years agoMerge remote-tracking branch 'mmc/mmc-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:30:29 +0000 (14:30 +1100)]
Merge remote-tracking branch 'mmc/mmc-next'

Conflicts:
drivers/mmc/card/block.c

12 years agoMerge remote-tracking branch 'battery/master'
Stephen Rothwell [Mon, 19 Dec 2011 03:28:58 +0000 (14:28 +1100)]
Merge remote-tracking branch 'battery/master'

12 years agoMerge commit 'refs/next/20111215/block'
Stephen Rothwell [Mon, 19 Dec 2011 03:18:52 +0000 (14:18 +1100)]
Merge commit 'refs/next/20111215/block'

12 years agoMerge remote-tracking branch 'input/next'
Stephen Rothwell [Mon, 19 Dec 2011 03:06:02 +0000 (14:06 +1100)]
Merge remote-tracking branch 'input/next'

Conflicts:
drivers/input/keyboard/samsung-keypad.c

12 years agoMerge branch 'quilt/rr'
Stephen Rothwell [Mon, 19 Dec 2011 03:04:34 +0000 (14:04 +1100)]
Merge branch 'quilt/rr'

12 years agoMerge remote-tracking branch 'cpufreq/next'
Stephen Rothwell [Mon, 19 Dec 2011 03:03:09 +0000 (14:03 +1100)]
Merge remote-tracking branch 'cpufreq/next'

12 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:01:43 +0000 (14:01 +1100)]
Merge remote-tracking branch 'sound-asoc/for-next'

12 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 03:00:07 +0000 (14:00 +1100)]
Merge remote-tracking branch 'sound/for-next'

Conflicts:
arch/arm/mach-s3c64xx/mach-crag6410.c

12 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Mon, 19 Dec 2011 02:58:31 +0000 (13:58 +1100)]
Merge remote-tracking branch 'crypto/master'

12 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Mon, 19 Dec 2011 02:57:05 +0000 (13:57 +1100)]
Merge remote-tracking branch 'l2-mtd/master'

Conflicts:
drivers/mtd/maps/bcm963xx-flash.c

12 years agoMerge remote-tracking branch 'mtd/master'
Stephen Rothwell [Mon, 19 Dec 2011 02:50:20 +0000 (13:50 +1100)]
Merge remote-tracking branch 'mtd/master'

12 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Mon, 19 Dec 2011 02:48:52 +0000 (13:48 +1100)]
Merge remote-tracking branch 'bluetooth/master'

12 years agoMerge remote-tracking branch 'wireless-next/master'
Stephen Rothwell [Mon, 19 Dec 2011 02:47:05 +0000 (13:47 +1100)]
Merge remote-tracking branch 'wireless-next/master'

Conflicts:
drivers/net/wireless/iwlwifi/iwl-agn.c

12 years agoMerge remote-tracking branch 'net-next/master'
Stephen Rothwell [Mon, 19 Dec 2011 02:41:02 +0000 (13:41 +1100)]
Merge remote-tracking branch 'net-next/master'

Conflicts:
drivers/net/wireless/iwlwifi/iwl-agn.c

12 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Mon, 19 Dec 2011 02:37:22 +0000 (13:37 +1100)]
Merge remote-tracking branch 'slave-dma/next'

Conflicts:
drivers/dma/pl330.c

12 years agoMerge remote-tracking branch 'target-merge/for-next-merge'
Stephen Rothwell [Mon, 19 Dec 2011 01:58:36 +0000 (12:58 +1100)]
Merge remote-tracking branch 'target-merge/for-next-merge'

12 years agoMerge remote-tracking branch 'target-updates/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 01:57:11 +0000 (12:57 +1100)]
Merge remote-tracking branch 'target-updates/for-next'

12 years agoMerge remote-tracking branch 'scsi/master'
Stephen Rothwell [Mon, 19 Dec 2011 01:55:26 +0000 (12:55 +1100)]
Merge remote-tracking branch 'scsi/master'

12 years agoMerge remote-tracking branch 'dlm/next'
Stephen Rothwell [Mon, 19 Dec 2011 01:53:57 +0000 (12:53 +1100)]
Merge remote-tracking branch 'dlm/next'

12 years agoMerge remote-tracking branch 'ubi/linux-next'
Stephen Rothwell [Mon, 19 Dec 2011 01:52:32 +0000 (12:52 +1100)]
Merge remote-tracking branch 'ubi/linux-next'

12 years agoMerge remote-tracking branch 'libata/NEXT'
Stephen Rothwell [Mon, 19 Dec 2011 01:50:34 +0000 (12:50 +1100)]
Merge remote-tracking branch 'libata/NEXT'

12 years agoMerge remote-tracking branch 'kconfig/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 01:50:30 +0000 (12:50 +1100)]
Merge remote-tracking branch 'kconfig/for-next'

12 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Mon, 19 Dec 2011 01:49:01 +0000 (12:49 +1100)]
Merge remote-tracking branch 'kbuild/for-next'

12 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Mon, 19 Dec 2011 01:45:39 +0000 (12:45 +1100)]
Merge remote-tracking branch 'v4l-dvb/master'

Conflicts:
drivers/staging/media/as102/as102_drv.h

12 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Mon, 19 Dec 2011 01:44:14 +0000 (12:44 +1100)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

12 years agoMerge branch 'quilt/jdelvare-hwmon'
Stephen Rothwell [Mon, 19 Dec 2011 01:42:51 +0000 (12:42 +1100)]
Merge branch 'quilt/jdelvare-hwmon'

12 years agoMerge remote-tracking branch 'bjdooks-i2c/next-i2c'
Stephen Rothwell [Mon, 19 Dec 2011 01:41:27 +0000 (12:41 +1100)]
Merge remote-tracking branch 'bjdooks-i2c/next-i2c'

Conflicts:
drivers/i2c/busses/i2c-designware-platdrv.c

12 years agoMerge branch 'quilt/i2c'
Stephen Rothwell [Mon, 19 Dec 2011 01:40:01 +0000 (12:40 +1100)]
Merge branch 'quilt/i2c'

12 years agoMerge commit 'refs/next/20111216/hid'
Stephen Rothwell [Mon, 19 Dec 2011 01:34:12 +0000 (12:34 +1100)]
Merge commit 'refs/next/20111216/hid'

12 years agoMerge remote-tracking branch 'pci/linux-next'
Stephen Rothwell [Mon, 19 Dec 2011 01:23:38 +0000 (12:23 +1100)]
Merge remote-tracking branch 'pci/linux-next'