]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agonet/netfilter/nf_conntrack_netlink.c: fix Oops on container destroy
Alex Bligh [Wed, 16 Nov 2011 23:40:59 +0000 (10:40 +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 agovmscan: use atomic-long for shrinker batching
Konstantin Khlebnikov [Wed, 16 Nov 2011 23:40:58 +0000 (10:40 +1100)]
vmscan: use atomic-long for shrinker batching

Use atomic-long operations instead of looping around cmpxchg().

[akpm@linux-foundation.org: massage atomic.h inclusions]
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agovmscan: fix initial shrinker size handling
Konstantin Khlebnikov [Wed, 16 Nov 2011 23:40:58 +0000 (10:40 +1100)]
vmscan: fix initial shrinker size handling

A shrinker function can return -1, means that it cannot do anything
without a risk of deadlock.  For example prune_super() does this if it
cannot grab a superblock refrence, even if nr_to_scan=0.  Currently we
interpret this -1 as a ULONG_MAX size shrinker and evaluate `total_scan'
according to this.  So the next time around this shrinker can cause really
big pressure.  Let's skip such shrinkers instead.

Also make total_scan signed, otherwise the check (total_scan < 0) below
never works.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 years agoMerge remote-tracking branch 'kvmtool/master'
Stephen Rothwell [Tue, 22 Nov 2011 05:59:54 +0000 (16:59 +1100)]
Merge remote-tracking branch 'kvmtool/master'

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

12 years agoMerge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:58:23 +0000 (16:58 +1100)]
Merge remote-tracking branch 'pinctrl/for-next'

12 years agoMerge remote-tracking branch 'writeback/writeback-for-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:52:13 +0000 (16:52 +1100)]
Merge remote-tracking branch 'writeback/writeback-for-next'

12 years agoMerge remote-tracking branch 'tmem/tmem'
Stephen Rothwell [Tue, 22 Nov 2011 05:46:59 +0000 (16:46 +1100)]
Merge remote-tracking branch 'tmem/tmem'

Conflicts:
mm/swapfile.c

12 years agoMerge remote-tracking branch 'char-misc/char-misc-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:45:30 +0000 (16:45 +1100)]
Merge remote-tracking branch 'char-misc/char-misc-next'

12 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:43:32 +0000 (16:43 +1100)]
Merge remote-tracking branch 'usb/usb-next'

12 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:41:46 +0000 (16:41 +1100)]
Merge remote-tracking branch 'tty/tty-next'

Conflicts:
drivers/tty/serial/Kconfig
drivers/tty/serial/Makefile
drivers/tty/tty_ldisc.c

12 years agoMerge commit 'refs/next/20111118/driver-core'
Stephen Rothwell [Tue, 22 Nov 2011 05:28:26 +0000 (16:28 +1100)]
Merge commit 'refs/next/20111118/driver-core'

12 years agoMerge remote-tracking branch 'regmap/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:12:17 +0000 (16:12 +1100)]
Merge remote-tracking branch 'regmap/for-next'

12 years agoMerge remote-tracking branch 'namespace/master'
Stephen Rothwell [Tue, 22 Nov 2011 05:10:49 +0000 (16:10 +1100)]
Merge remote-tracking branch 'namespace/master'

12 years agoMerge remote-tracking branch 'sysctl/master'
Stephen Rothwell [Tue, 22 Nov 2011 05:09:21 +0000 (16:09 +1100)]
Merge remote-tracking branch 'sysctl/master'

12 years agoMerge remote-tracking branch 'percpu/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:07:46 +0000 (16:07 +1100)]
Merge remote-tracking branch 'percpu/for-next'

12 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 05:06:22 +0000 (16:06 +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 [Tue, 22 Nov 2011 04:41:57 +0000 (15:41 +1100)]
Merge remote-tracking branch 'xen/upstream/xen'

Conflicts:
arch/x86/xen/Kconfig

12 years agoMerge remote-tracking branch 'kmemleak/kmemleak'
Stephen Rothwell [Tue, 22 Nov 2011 04:35:19 +0000 (15:35 +1100)]
Merge remote-tracking branch 'kmemleak/kmemleak'

12 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Tue, 22 Nov 2011 04:28:30 +0000 (15:28 +1100)]
Merge remote-tracking branch 'tip/auto-latest'

12 years agoMerge remote-tracking branch 'fsnotify/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 04:25:23 +0000 (15:25 +1100)]
Merge remote-tracking branch 'fsnotify/for-next'

12 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 04:20:13 +0000 (15:20 +1100)]
Merge remote-tracking branch 'pm/linux-next'

12 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 04:17:40 +0000 (15:17 +1100)]
Merge remote-tracking branch 'trivial/for-next'

12 years agoMerge remote-tracking branch 'osd/linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 04:17:32 +0000 (15:17 +1100)]
Merge remote-tracking branch 'osd/linux-next'

12 years agoMerge remote-tracking branch 'cputime/cputime'
Stephen Rothwell [Tue, 22 Nov 2011 04:11:25 +0000 (15:11 +1100)]
Merge remote-tracking branch 'cputime/cputime'

12 years agoMerge remote-tracking branch 'iommu/next'
Stephen Rothwell [Tue, 22 Nov 2011 04:10:02 +0000 (15:10 +1100)]
Merge remote-tracking branch 'iommu/next'

12 years agoMerge remote-tracking branch 'watchdog/linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 04:08:38 +0000 (15:08 +1100)]
Merge remote-tracking branch 'watchdog/linux-next'

12 years agoMerge remote-tracking branch 'security/next'
Stephen Rothwell [Tue, 22 Nov 2011 04:05:56 +0000 (15:05 +1100)]
Merge remote-tracking branch 'security/next'

12 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 04:04:38 +0000 (15:04 +1100)]
Merge remote-tracking branch 'regulator/for-next'

12 years agoMerge remote-tracking branch 'fbdev/fbdev-next'
Stephen Rothwell [Tue, 22 Nov 2011 04:03:10 +0000 (15:03 +1100)]
Merge remote-tracking branch 'fbdev/fbdev-next'

12 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:51:28 +0000 (14:51 +1100)]
Merge remote-tracking branch 'md/for-next'

12 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:50:06 +0000 (14:50 +1100)]
Merge remote-tracking branch 'slab/for-next'

12 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:49:58 +0000 (14:49 +1100)]
Merge remote-tracking branch 'kgdb/kgdb-next'

12 years agoMerge remote-tracking branch 'mmc/mmc-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:48:29 +0000 (14:48 +1100)]
Merge remote-tracking branch 'mmc/mmc-next'

12 years agoMerge remote-tracking branch 'battery/master'
Stephen Rothwell [Tue, 22 Nov 2011 03:47:06 +0000 (14:47 +1100)]
Merge remote-tracking branch 'battery/master'

12 years agoMerge remote-tracking branch 'block/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:45:37 +0000 (14:45 +1100)]
Merge remote-tracking branch 'block/for-next'

12 years agoMerge remote-tracking branch 'input/next'
Stephen Rothwell [Tue, 22 Nov 2011 03:44:09 +0000 (14:44 +1100)]
Merge remote-tracking branch 'input/next'

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

12 years agoMerge branch 'quilt/rr'
Stephen Rothwell [Tue, 22 Nov 2011 03:42:42 +0000 (14:42 +1100)]
Merge branch 'quilt/rr'

12 years agoMerge remote-tracking branch 'cpufreq/next'
Stephen Rothwell [Tue, 22 Nov 2011 03:42:33 +0000 (14:42 +1100)]
Merge remote-tracking branch 'cpufreq/next'

12 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:41:02 +0000 (14:41 +1100)]
Merge remote-tracking branch 'sound-asoc/for-next'

12 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:39:32 +0000 (14:39 +1100)]
Merge remote-tracking branch 'sound/for-next'

12 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Tue, 22 Nov 2011 03:38:02 +0000 (14:38 +1100)]
Merge remote-tracking branch 'crypto/master'

12 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Tue, 22 Nov 2011 03:36:44 +0000 (14:36 +1100)]
Merge remote-tracking branch 'l2-mtd/master'

12 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Tue, 22 Nov 2011 03:35:23 +0000 (14:35 +1100)]
Merge remote-tracking branch 'bluetooth/master'

12 years agoMerge commit 'refs/next/20111121/wireless-next'
Stephen Rothwell [Tue, 22 Nov 2011 03:27:02 +0000 (14:27 +1100)]
Merge commit 'refs/next/20111121/wireless-next'

12 years agoMerge remote-tracking branch 'net-next/master'
Stephen Rothwell [Tue, 22 Nov 2011 02:58:45 +0000 (13:58 +1100)]
Merge remote-tracking branch 'net-next/master'

12 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Tue, 22 Nov 2011 02:55:05 +0000 (13:55 +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 [Tue, 22 Nov 2011 02:53:41 +0000 (13:53 +1100)]
Merge remote-tracking branch 'target-merge/for-next-merge'

12 years agoMerge remote-tracking branch 'dlm/next'
Stephen Rothwell [Tue, 22 Nov 2011 02:52:14 +0000 (13:52 +1100)]
Merge remote-tracking branch 'dlm/next'

12 years agoMerge remote-tracking branch 'infiniband/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:50:50 +0000 (13:50 +1100)]
Merge remote-tracking branch 'infiniband/for-next'

12 years agoMerge remote-tracking branch 'libata/NEXT'
Stephen Rothwell [Tue, 22 Nov 2011 02:49:27 +0000 (13:49 +1100)]
Merge remote-tracking branch 'libata/NEXT'

12 years agoMerge remote-tracking branch 'kconfig/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:49:24 +0000 (13:49 +1100)]
Merge remote-tracking branch 'kconfig/for-next'

12 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:47:56 +0000 (13:47 +1100)]
Merge remote-tracking branch 'kbuild/for-next'

12 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Tue, 22 Nov 2011 02:44:37 +0000 (13:44 +1100)]
Merge remote-tracking branch 'v4l-dvb/master'

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

12 years agoMerge branch 'quilt/jdelvare-hwmon'
Stephen Rothwell [Tue, 22 Nov 2011 02:43:19 +0000 (13:43 +1100)]
Merge branch 'quilt/jdelvare-hwmon'

12 years agoMerge remote-tracking branch 'bjdooks-i2c/next-i2c'
Stephen Rothwell [Tue, 22 Nov 2011 02:42:00 +0000 (13:42 +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 [Tue, 22 Nov 2011 02:39:51 +0000 (13:39 +1100)]
Merge branch 'quilt/i2c'

12 years agoMerge remote-tracking branch 'hid/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:38:35 +0000 (13:38 +1100)]
Merge remote-tracking branch 'hid/for-next'

12 years agoMerge remote-tracking branch 'pci/linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:35:29 +0000 (13:35 +1100)]
Merge remote-tracking branch 'pci/linux-next'

12 years agoMerge remote-tracking branch 'ocfs2/linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:33:53 +0000 (13:33 +1100)]
Merge remote-tracking branch 'ocfs2/linux-next'

12 years agoMerge remote-tracking branch 'nfsd/nfsd-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:32:36 +0000 (13:32 +1100)]
Merge remote-tracking branch 'nfsd/nfsd-next'

12 years agoMerge remote-tracking branch 'nfs/linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:31:17 +0000 (13:31 +1100)]
Merge remote-tracking branch 'nfs/linux-next'

12 years agoMerge remote-tracking branch 'logfs/master'
Stephen Rothwell [Tue, 22 Nov 2011 02:30:01 +0000 (13:30 +1100)]
Merge remote-tracking branch 'logfs/master'

Conflicts:
fs/logfs/file.c

12 years agoMerge remote-tracking branch 'gfs2/master'
Stephen Rothwell [Tue, 22 Nov 2011 02:28:29 +0000 (13:28 +1100)]
Merge remote-tracking branch 'gfs2/master'

12 years agoMerge remote-tracking branch 'ecryptfs/next'
Stephen Rothwell [Tue, 22 Nov 2011 02:27:11 +0000 (13:27 +1100)]
Merge remote-tracking branch 'ecryptfs/next'

12 years agoMerge remote-tracking branch 'cifs/master'
Stephen Rothwell [Tue, 22 Nov 2011 02:25:51 +0000 (13:25 +1100)]
Merge remote-tracking branch 'cifs/master'

12 years agoMerge remote-tracking branch 'xtensa/master'
Stephen Rothwell [Tue, 22 Nov 2011 02:24:30 +0000 (13:24 +1100)]
Merge remote-tracking branch 'xtensa/master'

12 years agoMerge remote-tracking branch 's390/features'
Stephen Rothwell [Tue, 22 Nov 2011 02:23:12 +0000 (13:23 +1100)]
Merge remote-tracking branch 's390/features'

12 years agoMerge remote-tracking branch 'galak/next'
Stephen Rothwell [Tue, 22 Nov 2011 02:21:56 +0000 (13:21 +1100)]
Merge remote-tracking branch 'galak/next'

12 years agoMerge remote-tracking branch '52xx-and-virtex/powerpc/next'
Stephen Rothwell [Tue, 22 Nov 2011 02:21:40 +0000 (13:21 +1100)]
Merge remote-tracking branch '52xx-and-virtex/powerpc/next'

12 years agoMerge remote-tracking branch 'parisc/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:20:19 +0000 (13:20 +1100)]
Merge remote-tracking branch 'parisc/for-next'

12 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:18:29 +0000 (13:18 +1100)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

12 years agoMerge remote-tracking branch 'm68knommu/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:17:08 +0000 (13:17 +1100)]
Merge remote-tracking branch 'm68knommu/for-next'

Conflicts:
arch/m68k/Kconfig.debug

12 years agoMerge remote-tracking branch 'm68k/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:15:44 +0000 (13:15 +1100)]
Merge remote-tracking branch 'm68k/for-next'

12 years agoMerge remote-tracking branch 'ia64/next'
Stephen Rothwell [Tue, 22 Nov 2011 02:14:28 +0000 (13:14 +1100)]
Merge remote-tracking branch 'ia64/next'

12 years agoMerge remote-tracking branch 'cris/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:12:55 +0000 (13:12 +1100)]
Merge remote-tracking branch 'cris/for-next'

12 years agoMerge remote-tracking branch 'c6x/for-linux-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:07:41 +0000 (13:07 +1100)]
Merge remote-tracking branch 'c6x/for-linux-next'

12 years agoMerge remote-tracking branch 'tegra/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:06:23 +0000 (13:06 +1100)]
Merge remote-tracking branch 'tegra/for-next'

12 years agoMerge remote-tracking branch 's5p/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 02:05:03 +0000 (13:05 +1100)]
Merge remote-tracking branch 's5p/for-next'

Conflicts:
arch/arm/mach-exynos/cpu.c
arch/arm/mach-exynos/include/mach/entry-macro.S

12 years agoMerge remote-tracking branch 'i.MX/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 01:24:15 +0000 (12:24 +1100)]
Merge remote-tracking branch 'i.MX/for-next'

Conflicts:
arch/arm/mach-mx5/clock-mx51-mx53.c
arch/arm/mach-mx5/devices-imx53.h
arch/arm/mach-mx5/mm.c
arch/arm/plat-mxc/include/mach/hardware.h

12 years agoMerge remote-tracking branch 'at91/at91-next'
Stephen Rothwell [Tue, 22 Nov 2011 01:22:48 +0000 (12:22 +1100)]
Merge remote-tracking branch 'at91/at91-next'

Conflicts:
arch/arm/mach-at91/at91cap9.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/setup.c

12 years agoMerge remote-tracking branch 'arm-lpae/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 01:03:45 +0000 (12:03 +1100)]
Merge remote-tracking branch 'arm-lpae/for-next'

Conflicts:
arch/arm/include/asm/pgalloc.h
arch/arm/include/asm/pgtable.h
arch/arm/include/asm/tlb.h
arch/arm/mm/ioremap.c

12 years agoMerge remote-tracking branch 'arm/for-next'
Stephen Rothwell [Tue, 22 Nov 2011 00:47:49 +0000 (11:47 +1100)]
Merge remote-tracking branch 'arm/for-next'

12 years agoMerge remote-tracking branch 'crypto-current/master'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:44 +0000 (11:41 +1100)]
Merge remote-tracking branch 'crypto-current/master'

12 years agoMerge remote-tracking branch 'input-current/for-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:35 +0000 (11:41 +1100)]
Merge remote-tracking branch 'input-current/for-linus'

12 years agoMerge remote-tracking branch 'char-misc.current/char-misc-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:34 +0000 (11:41 +1100)]
Merge remote-tracking branch 'char-misc.current/char-misc-linus'

12 years agoMerge remote-tracking branch 'staging.current/staging-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:33 +0000 (11:41 +1100)]
Merge remote-tracking branch 'staging.current/staging-linus'

12 years agoMerge remote-tracking branch 'usb.current/usb-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:32 +0000 (11:41 +1100)]
Merge remote-tracking branch 'usb.current/usb-linus'

12 years agoMerge remote-tracking branch 'tty.current/tty-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:31 +0000 (11:41 +1100)]
Merge remote-tracking branch 'tty.current/tty-linus'

12 years agoMerge remote-tracking branch 'driver-core.current/driver-core-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:31 +0000 (11:41 +1100)]
Merge remote-tracking branch 'driver-core.current/driver-core-linus'

12 years agoMerge remote-tracking branch 'wireless/master'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:29 +0000 (11:41 +1100)]
Merge remote-tracking branch 'wireless/master'

12 years agoMerge remote-tracking branch 'pci-current/for-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:28 +0000 (11:41 +1100)]
Merge remote-tracking branch 'pci-current/for-linus'

12 years agoMerge remote-tracking branch 'sound-current/for-linus'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:27 +0000 (11:41 +1100)]
Merge remote-tracking branch 'sound-current/for-linus'

12 years agoMerge remote-tracking branch 'net/master'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:26 +0000 (11:41 +1100)]
Merge remote-tracking branch 'net/master'

12 years agoMerge remote-tracking branch 'arm-current/fixes'
Stephen Rothwell [Tue, 22 Nov 2011 00:41:23 +0000 (11:41 +1100)]
Merge remote-tracking branch 'arm-current/fixes'

12 years agolguest: switch segment-voodoo-numbers to readable symbols
Jacek Galowicz [Tue, 22 Nov 2011 00:09:01 +0000 (11:09 +1100)]
lguest: switch segment-voodoo-numbers to readable symbols

When studying lguest's x86 segment descriptor code, it is not longer
necessary to have the Intel x86 architecture manual open on the page
with the segment descriptor illustration to understand the crazy
numbers assigned to both descriptor structure halves a/b.
Now the struct desc_struct's fields, like suggested by
Glauber de Oliveira Costa in 2008, are used.

Signed-off-by: Jacek Galowicz <jacek@galowicz.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agomodule: Fix performance regression on modules with large symbol tables
Kevin Cernekee [Sun, 13 Nov 2011 03:08:56 +0000 (19:08 -0800)]
module: Fix performance regression on modules with large symbol tables

Commit 554bdfe5acf3715e87c8d5e25a4f9a896ac9f014 (module: reduce string
table for loaded modules) introduced an optimization to shrink the size of
the resident string table.  Part of this involves calling bitmap_weight()
on the strmap bitmap once for each core symbol.  strmap contains one bit
for each byte of the module's strtab.

For kernel modules with a large number of symbols, the addition of the
bitmap_weight() operation to each iteration of the add_kallsyms() loop
resulted in a significant "insmod" performance regression from 2.6.31
to 2.6.32.  bitmap_weight() is expensive when the bitmap is large.

The proposed alternative optimizes the common case in this loop
(is_core_symbol() == true, and the symbol name is not a duplicate), while
penalizing the exceptional case of a duplicate symbol.

My test was run on a 600 MHz MIPS processor, using a kernel module with
15,000 "core" symbols and 10,000 symbols in .init.text.  .strtab takes up
250,227 bytes.

Original code: insmod takes 3.39 seconds
Patched code: insmod takes 0.07 seconds

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agomodule: Add comments describing how the "strmap" logic works
Kevin Cernekee [Sun, 13 Nov 2011 03:08:55 +0000 (19:08 -0800)]
module: Add comments describing how the "strmap" logic works

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: add debugging if driver doesn't kick.
Rusty Russell [Tue, 22 Nov 2011 00:09:00 +0000 (11:09 +1100)]
virtio: add debugging if driver doesn't kick.

Under the existing #ifdef DEBUG, check that they don't have more than
1/10 of a second between an add_buf() and a
virtqueue_notify()/virtqueue_kick_prepare() call.

We could get false positives on a really busy system, but good for
development.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: expose added descriptors immediately.
Rusty Russell [Tue, 22 Nov 2011 00:09:00 +0000 (11:09 +1100)]
virtio: expose added descriptors immediately.

A virtio driver does virtqueue_add_buf() multiple times before finally
calling virtqueue_kick(); previously we only exposed the added buffers
in the virtqueue_kick() call.  This means we don't need a memory
barrier in virtqueue_add_buf(), but it reduces concurrency as the
device (ie. host) can't see the buffers until the kick.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
12 years agovirtio: avoid modulus operation.
Rusty Russell [Tue, 22 Nov 2011 00:08:59 +0000 (11:08 +1100)]
virtio: avoid modulus operation.

Since we know vq->vring.num is a power of 2, modulus is lazy (it's asserted
in vring_new_virtqueue()).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>