linux-2.6
15 years agotrivial: Fix a typo in comment of addrconf_dad_start()
Masatake YAMATO [Tue, 9 Jun 2009 01:41:12 +0000 (10:41 +0900)] 
trivial: Fix a typo in comment of addrconf_dad_start()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: usb: fix missing space typo in doc
Németh Márton [Sat, 6 Jun 2009 17:06:36 +0000 (19:06 +0200)] 
trivial: usb: fix missing space typo in doc

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: pci hotplug: adding __init/__exit macros to sgi_hotplug
Peter Huewe [Sat, 6 Jun 2009 12:58:56 +0000 (14:58 +0200)] 
trivial: pci hotplug: adding __init/__exit macros to sgi_hotplug

Trivial patch which adds the __init and __exit macros to the module_init /
module_exit functions from drivers/pci/hotplug/sgi_hotplug.c
linux version 2.6.30-rc8

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: Remove the hyphen from git commands
Matt Kraai [Fri, 5 Jun 2009 04:43:10 +0000 (21:43 -0700)] 
trivial: Remove the hyphen from git commands

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fix ETIMEOUT -> ETIMEDOUT typos
Jean Delvare [Thu, 4 Jun 2009 14:20:28 +0000 (16:20 +0200)] 
trivial: fix ETIMEOUT -> ETIMEDOUT typos

fix ETIMEOUT -> ETIMEDOUT typos

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: Kconfig: .ko is normally not included in module names
Pavel Machek [Thu, 4 Jun 2009 22:44:53 +0000 (00:44 +0200)] 
trivial: Kconfig: .ko is normally not included in module names

.ko is normally not included in Kconfig help, make it consistent.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: SubmittingPatches: fix typo
Pavel Machek [Thu, 4 Jun 2009 14:26:50 +0000 (16:26 +0200)] 
trivial: SubmittingPatches: fix typo

Fix typo.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: Documentation/dell_rbu.txt: fix typos
Masanori Kobayasi [Thu, 4 Jun 2009 12:12:29 +0000 (21:12 +0900)] 
trivial: Documentation/dell_rbu.txt: fix typos

Remove a period from end of command-line and fix misplaced comma.

Signed-off-by: Masanori Kobayasi <zap03216@nifty.ne.jp>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: Fix Pavel's address in MAINTAINERS
Pavel Machek [Fri, 29 May 2009 22:58:41 +0000 (00:58 +0200)] 
trivial: Fix Pavel's address in MAINTAINERS

Fix my address in MAINTAINERS.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: ftrace:fix description of trace directory
GeunSik Lim [Mon, 1 Jun 2009 08:49:41 +0000 (10:49 +0200)] 
trivial: ftrace:fix description of trace directory

Fix trace source directory from kernel/tracing/ to kernel/trace/.

Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: unnecessary (void*) cast removal in sound/oss/msnd.c
Chris Sanford [Wed, 27 May 2009 15:23:50 +0000 (17:23 +0200)] 
trivial: unnecessary (void*) cast removal in sound/oss/msnd.c

This is a trivial patch that removes an unnecessary void pointer cast.

Signed-off-by: Chris Sanford <crsanford@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: input/misc: Fix typo in Kconfig
Alessio Igor Bogani [Thu, 21 May 2009 17:54:33 +0000 (19:54 +0200)] 
trivial: input/misc: Fix typo in Kconfig

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fix grammo in bus_for_each_dev() kerneldoc
Alex Chiang [Thu, 14 May 2009 21:15:22 +0000 (23:15 +0200)] 
trivial: fix grammo in bus_for_each_dev() kerneldoc

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: rbtree.txt: fix rb_entry() parameters in sample code
Wang Tinggong [Thu, 14 May 2009 09:00:20 +0000 (11:00 +0200)] 
trivial: rbtree.txt: fix rb_entry() parameters in sample code

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: spelling fix in ppc code comments
Sankar P [Tue, 12 May 2009 07:11:13 +0000 (12:41 +0530)] 
trivial: spelling fix in ppc code comments

Fixes a trivial spelling error in powerpc code comments.

Signed-off-by: Sankar P <sankar.curiosity@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fix typo in bio_alloc kernel doc
Nikanth Karthikesan [Wed, 22 Apr 2009 08:08:58 +0000 (13:38 +0530)] 
trivial: fix typo in bio_alloc kernel doc

Fix typo in bio_alloc kernel doc.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: Documentation/rbtree.txt: cleanup kerneldoc of rbtree.txt
figo.zhang [Fri, 17 Apr 2009 02:58:48 +0000 (10:58 +0800)] 
trivial: Documentation/rbtree.txt: cleanup kerneldoc of rbtree.txt

 The first formal parameter of the rb_link_node() is a pointer, and the
 "node" is define a data struct (pls see line 67 and line 73 in the
 doc), so the actual parameter should use "&data->node".

Signed-off-by: Figo.zhang <figo.zhang@kolorific.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: Miscellaneous documentation typo fixes
Matt LaPlante [Mon, 27 Apr 2009 13:06:31 +0000 (15:06 +0200)] 
trivial: Miscellaneous documentation typo fixes

Fix various typos in documentation txts.

Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fix typo milisecond/millisecond for documentation and source comments.
Martin Olsson [Thu, 23 Apr 2009 09:37:37 +0000 (11:37 +0200)] 
trivial: fix typo milisecond/millisecond for documentation and source comments.

Signed-off-by: Martin Olsson <martin@minimum.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fix typos s/paramter/parameter/ and s/excute/execute/ in documentation and...
Martin Olsson [Wed, 22 Apr 2009 16:21:29 +0000 (18:21 +0200)] 
trivial: fix typos s/paramter/parameter/ and s/excute/execute/ in documentation and source comments.

Signed-off-by: Martin Olsson <martin@minimum.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fix typo compatiable/compatiability has extra 'a'.
Thadeu Lima de Souza Cascardo [Fri, 17 Apr 2009 11:14:23 +0000 (08:14 -0300)] 
trivial: fix typo compatiable/compatiability has extra 'a'.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: kernel/power/poweroff.c: whitespace fix
Manish Katiyar [Sun, 22 Feb 2009 04:54:27 +0000 (10:24 +0530)] 
trivial: kernel/power/poweroff.c: whitespace fix

Fix coding style whitespace fixes. Patch compile tested
Before :-
total: 1 errors, 0 warnings, 46 lines checked
After
total: 0 errors, 0 warnings, 46 lines checked

Before :-
  text    data     bss     dec     hex filename
    107      48       0     155      9b kernel/power/poweroff.o
After
   text    data     bss     dec     hex filename
    107      48       0     155      9b kernel/power/poweroff.o

Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: Fix paramater/parameter typo in dmesg and source comments
Martin Olsson [Tue, 7 Apr 2009 08:30:24 +0000 (10:30 +0200)] 
trivial: Fix paramater/parameter typo in dmesg and source comments

Signed-off-by: Martin Olsson <martin@minimum.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agoTrivial: fix typo s/balence/balance/
Thadeu Lima de Souza Cascardo [Wed, 15 Apr 2009 02:14:17 +0000 (23:14 -0300)] 
Trivial: fix typo s/balence/balance/

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: typo (en|dis|avail|remove)bale -> (en|dis|avail|remove)able
Thadeu Lima de Souza Cascardo [Wed, 15 Apr 2009 02:14:10 +0000 (23:14 -0300)] 
trivial: typo (en|dis|avail|remove)bale -> (en|dis|avail|remove)able

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: mtd: fix Kconfig comment about 'armflash'
Paulius Zaleckas [Mon, 6 Apr 2009 13:10:54 +0000 (16:10 +0300)] 
trivial: mtd: fix Kconfig comment about 'armflash'

The real 'armflash' map driver is selected by CONFIG_MTD_ARM_INTEGRATOR

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: remove extra space
Viral Mehta [Fri, 3 Apr 2009 07:38:14 +0000 (13:08 +0530)] 
trivial: remove extra space

Just for the sake of readability, removing extra space

Signed-off-by: Viral Mehta <viral.mehta@einfochips.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fs/inode: Fix typo in file_update_time nanodoc
Wolfram Sang [Thu, 2 Apr 2009 13:23:37 +0000 (15:23 +0200)] 
trivial: fs/inode: Fix typo in file_update_time nanodoc

The advertised flag for not updating the time was wrong.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: fix comment typo in fs/compat.c
Nikanth Karthikesan [Wed, 1 Apr 2009 09:10:51 +0000 (14:40 +0530)] 
trivial: fix comment typo in fs/compat.c

Fix a typo in fs/compat.c

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agotrivial: ext2: fix a typo in comment in ext2.h
Ali Gholami Rudi [Mon, 30 Mar 2009 12:19:27 +0000 (16:49 +0430)] 
trivial: ext2: fix a typo in comment in ext2.h

Signed-off-by: Ali Gholami Rudi <ali@rudi.ir>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
15 years agoslab: setup cpu caches later on when interrupts are enabled
Pekka Enberg [Fri, 12 Jun 2009 12:58:59 +0000 (15:58 +0300)] 
slab: setup cpu caches later on when interrupts are enabled

Fixes the following boot-time warning:

  [    0.000000] ------------[ cut here ]------------
  [    0.000000] WARNING: at kernel/smp.c:369 smp_call_function_many+0x56/0x1bc()
  [    0.000000] Hardware name:
  [    0.000000] Modules linked in:
  [    0.000000] Pid: 0, comm: swapper Not tainted 2.6.30 #492
  [    0.000000] Call Trace:
  [    0.000000]  [<ffffffff8149e021>] ? _spin_unlock+0x4f/0x5c
  [    0.000000]  [<ffffffff8108f11b>] ? smp_call_function_many+0x56/0x1bc
  [    0.000000]  [<ffffffff81061764>] warn_slowpath_common+0x7c/0xa9
  [    0.000000]  [<ffffffff810617a5>] warn_slowpath_null+0x14/0x16
  [    0.000000]  [<ffffffff8108f11b>] smp_call_function_many+0x56/0x1bc
  [    0.000000]  [<ffffffff810f3e00>] ? do_ccupdate_local+0x0/0x54
  [    0.000000]  [<ffffffff810f3e00>] ? do_ccupdate_local+0x0/0x54
  [    0.000000]  [<ffffffff8108f2be>] smp_call_function+0x3d/0x68
  [    0.000000]  [<ffffffff810f3e00>] ? do_ccupdate_local+0x0/0x54
  [    0.000000]  [<ffffffff81066fd8>] on_each_cpu+0x31/0x7c
  [    0.000000]  [<ffffffff810f64f5>] do_tune_cpucache+0x119/0x454
  [    0.000000]  [<ffffffff81087080>] ? lockdep_init_map+0x94/0x10b
  [    0.000000]  [<ffffffff818133b0>] ? kmem_cache_init+0x421/0x593
  [    0.000000]  [<ffffffff810f69cf>] enable_cpucache+0x68/0xad
  [    0.000000]  [<ffffffff818133c3>] kmem_cache_init+0x434/0x593
  [    0.000000]  [<ffffffff8180987c>] ? mem_init+0x156/0x161
  [    0.000000]  [<ffffffff817f8aae>] start_kernel+0x1cc/0x3b9
  [    0.000000]  [<ffffffff817f829a>] x86_64_start_reservations+0xaa/0xae
  [    0.000000]  [<ffffffff817f837f>] x86_64_start_kernel+0xe1/0xe8
  [    0.000000] ---[ end trace 4eaa2a86a8e2da22 ]---

Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoslab,slub: don't enable interrupts during early boot
Pekka Enberg [Fri, 12 Jun 2009 11:03:06 +0000 (14:03 +0300)] 
slab,slub: don't enable interrupts during early boot

As explained by Benjamin Herrenschmidt:

  Oh and btw, your patch alone doesn't fix powerpc, because it's missing
  a whole bunch of GFP_KERNEL's in the arch code... You would have to
  grep the entire kernel for things that check slab_is_available() and
  even then you'll be missing some.

  For example, slab_is_available() didn't always exist, and so in the
  early days on powerpc, we used a mem_init_done global that is set form
  mem_init() (not perfect but works in practice). And we still have code
  using that to do the test.

Therefore, mask out __GFP_WAIT, __GFP_IO, and __GFP_FS in the slab allocators
in early boot code to avoid enabling interrupts.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoMerge branches 'upstream' and 'ntrig-multitouch' into for-linus
Jiri Kosina [Fri, 12 Jun 2009 15:42:13 +0000 (17:42 +0200)] 
Merge branches 'upstream' and 'ntrig-multitouch' into for-linus

15 years agoslab: fix gfp flag in setup_cpu_cache()
Pekka Enberg [Fri, 12 Jun 2009 11:56:09 +0000 (14:56 +0300)] 
slab: fix gfp flag in setup_cpu_cache()

Fixes the following warning during bootup when compiling with CONFIG_SLAB:

  [    0.000000] ------------[ cut here ]------------
  [    0.000000] WARNING: at kernel/lockdep.c:2282 lockdep_trace_alloc+0x91/0xb9()
  [    0.000000] Hardware name:
  [    0.000000] Modules linked in:
  [    0.000000] Pid: 0, comm: swapper Not tainted 2.6.30 #491
  [    0.000000] Call Trace:
  [    0.000000]  [<ffffffff81087d84>] ? lockdep_trace_alloc+0x91/0xb9
  [    0.000000]  [<ffffffff81061764>] warn_slowpath_common+0x7c/0xa9
  [    0.000000]  [<ffffffff810617a5>] warn_slowpath_null+0x14/0x16
  [    0.000000]  [<ffffffff81087d84>] lockdep_trace_alloc+0x91/0xb9
  [    0.000000]  [<ffffffff810f5b03>] kmem_cache_alloc_node_notrace+0x26/0xdf
  [    0.000000]  [<ffffffff81487f4e>] ? setup_cpu_cache+0x7e/0x210
  [    0.000000]  [<ffffffff81487fe3>] setup_cpu_cache+0x113/0x210
  [    0.000000]  [<ffffffff810f73ff>] kmem_cache_create+0x409/0x486
  [    0.000000]  [<ffffffff818131c1>] kmem_cache_init+0x232/0x593
  [    0.000000]  [<ffffffff8180987c>] ? mem_init+0x156/0x161
  [    0.000000]  [<ffffffff817f8aae>] start_kernel+0x1cc/0x3b9
  [    0.000000]  [<ffffffff817f829a>] x86_64_start_reservations+0xaa/0xae
  [    0.000000]  [<ffffffff817f837f>] x86_64_start_kernel+0xe1/0xe8
  [    0.000000] ---[ end trace 4eaa2a86a8e2da22 ]---

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoxfs: fix freeing memory in xfs_getbmap()
Felix Blyakher [Thu, 11 Jun 2009 22:07:28 +0000 (17:07 -0500)] 
xfs: fix freeing memory in xfs_getbmap()

Regression from commit 28e211700a81b0a934b6c7a4b8e7dda843634d2f.
Need to free temporary buffer allocated in xfs_getbmap().

Signed-off-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Hedi Berriche <hedi@sgi.com>
Reported-by: Justin Piszcz <jpiszcz@lucidpixels.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
15 years ago[SCSI] Merge branch 'linus'
James Bottomley [Fri, 12 Jun 2009 15:02:03 +0000 (10:02 -0500)] 
[SCSI] Merge branch 'linus'

Conflicts:
drivers/message/fusion/mptsas.c

fixed up conflict between req->data_len accessors and mptsas driver updates.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years agolguest: add support for indirect ring entries
Mark McLoughlin [Mon, 11 May 2009 17:11:46 +0000 (18:11 +0100)] 
lguest: add support for indirect ring entries

Support the VIRTIO_RING_F_INDIRECT_DESC feature.

This is a simple matter of changing the descriptor walking
code to operate on a struct vring_desc* and supplying it
with an indirect table if detected.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: suppress notifications in example Launcher
Rusty Russell [Sat, 13 Jun 2009 04:27:12 +0000 (22:27 -0600)] 
lguest: suppress notifications in example Launcher

The Guest only really needs to tell us about activity when we're going
to listen to the eventfd: normally, we don't want to know.

So if there are no available buffers, turn on notifications, re-check,
then wait for the Guest to notify us via the eventfd, then turn
notifications off again.

There's enough else going on that the differences are in the noise.

Before: Secs RxKicks TxKicks
 1G TCP Guest->Host: 3.94   4686   32815
 1M normal pings: 104 142862 1000010
 1M 1k pings (-l 120): 57 142026 1000007

After:
 1G TCP Guest->Host: 3.76   4691   32811
 1M normal pings: 111 142859  997467
 1M 1k pings (-l 120): 55  19648  501549

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: try to batch interrupts on network receive
Rusty Russell [Sat, 13 Jun 2009 04:27:12 +0000 (22:27 -0600)] 
lguest: try to batch interrupts on network receive

Rather than triggering an interrupt every time, we only trigger an
interrupt when there are no more incoming packets (or the recv queue
is full).

However, the overhead of doing the select to figure this out is
measurable: 1M pings goes from 98 to 104 seconds, and 1G Guest->Host
TCP goes from 3.69 to 3.94 seconds.  It's close to the noise though.

I tested various timeouts, including reducing it as the number of
pending packets increased, timing a 1 gigabyte TCP send from Guest ->
Host and Host -> Guest (GSO disabled, to increase packet rate).

// time tcpblast -o -s 65536 -c 16k 192.168.2.1:9999 > /dev/null

Timeout Guest->Host Pkts/irq Host->Guest Pkts/irq
Before 11.3s 1.0 6.3s 1.0
0 11.7s 1.0 6.6s 23.5
1 17.1s 8.8 8.6s 26.0
1/pending 13.4s 1.9 6.6s 23.8
2/pending 13.6s 2.8 6.6s 24.1
5/pending 14.1s 5.0 6.6s 24.4

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: avoid sending interrupts to Guest when no activity occurs.
Rusty Russell [Sat, 13 Jun 2009 04:27:11 +0000 (22:27 -0600)] 
lguest: avoid sending interrupts to Guest when no activity occurs.

If we track how many buffers we've used, we can tell whether we really
need to interrupt the Guest.  This happens as a side effect of
spurious notifications.

Spurious notifications happen because it can take a while before the
Host thread wakes up and sets the VRING_USED_F_NO_NOTIFY flag, and
meanwhile the Guest can more notifications.

A real fix would be to use wake counts, rather than a suppression
flag, but the practical difference is generally in the noise: the
interrupt is usually coalesced into a pending one anyway so we just
save a system call which isn't clearly measurable.

Secs Spurious IRQS
1G TCP Guest->Host: 3.93 58
1M normal pings: 100 72
1M 1k pings (-l 120): 57 492904

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: implement deferred interrupts in example Launcher
Rusty Russell [Sat, 13 Jun 2009 04:27:11 +0000 (22:27 -0600)] 
lguest: implement deferred interrupts in example Launcher

Rather than sending an interrupt on every buffer, we only send an interrupt
when we're about to wait for the Guest to send us a new one.  The console
input and network input still send interrupts manually, but the block device,
network and console output queues can simply rely on this logic to send
interrupts to the Guest at the right time.

The patch is cluttered by moving trigger_irq() higher in the code.

In practice, two factors make this optimization less interesting:
(1) we often only get one input at a time, even for networking,
(2) triggering an interrupt rapidly tends to get coalesced anyway.

Before: Secs RxIRQS TxIRQs
 1G TCP Guest->Host: 3.72 32784 32771
 1M normal pings: 99 1000004 995541
 100,000 1k pings (-l 120): 5 49510 49058

After:
 1G TCP Guest->Host: 3.69 32809 32769
 1M normal pings: 99 1000004 996196
 100,000 1k pings (-l 120): 5 52435 52361

(Note the interrupt count on 100k pings goes *up*: see next patch).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: remove obsolete LHREQ_BREAK call
Rusty Russell [Sat, 13 Jun 2009 04:27:10 +0000 (22:27 -0600)] 
lguest: remove obsolete LHREQ_BREAK call

We no longer need an efficient mechanism to force the Guest back into
host userspace, as each device is serviced without bothering the main
Guest process (aka. the Launcher).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: have example Launcher service all devices in separate threads
Rusty Russell [Sat, 13 Jun 2009 04:27:10 +0000 (22:27 -0600)] 
lguest: have example Launcher service all devices in separate threads

Currently lguest has three threads: the main Launcher thread, a Waker
thread, and a thread for the block device (because synchronous block
was simply too painful to bear).

The Waker selects() on all the input file descriptors (eg. stdin, net
devices, pipe to the block thread) and when one becomes readable it calls
into the kernel to kick the Launcher thread out into userspace, which
repeats the poll, services the device(s), and then tells the kernel to
release the Waker before re-entering the kernel to run the Guest.

Also, to make a slightly-decent network transmit routine, the Launcher
would suppress further network interrupts while it set a timer: that
signal handler would write to a pipe, which would rouse the Waker
which would prod the Launcher out of the kernel to check the network
device again.

Now we can convert all our virtqueues to separate threads: each one has
a separate eventfd for when the Guest pokes the device, and can trigger
interrupts in the Guest directly.

The linecount shows how much this simplifies, but to really bring it
home, here's an strace analysis of single Guest->Host ping before:

* Guest sends packet, notifies xmit vq, return control to Launcher
* Launcher clears notification flag on xmit ring
* Launcher writes packet to TUN device
writev(4, [{"\0\0\0\0\0\0\0\0\0\0", 10}, {"\366\r\224`\2058\272m\224vf\274\10\0E\0\0T\0\0@\0@\1\265"..., 98}], 2) = 108
* Launcher sets up interrupt for Guest (xmit ring is empty)
write(10, "\2\0\0\0\3\0\0\0", 8) = 0
* Launcher sets up timer for interrupt mitigation
setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 505}}, NULL) = 0
* Launcher re-runs guest
pread64(10, 0xbfa5f4d4, 4, 0) ...
* Waker notices reply packet in tun device (it was in select)
select(12, [0 3 4 6 11], NULL, NULL, NULL) = 1 (in [4])
* Waker kicks Launcher out of guest:
pwrite64(10, "\3\0\0\0\1\0\0\0", 8, 0) = 0
* Launcher returns from running guest:
... = -1 EAGAIN (Resource temporarily unavailable)
* Launcher looks at input fds:
select(7, [0 3 4 6], NULL, NULL, {0, 0}) = 1 (in [4], left {0, 0})
* Launcher reads pong from tun device:
readv(4, [{"\0\0\0\0\0\0\0\0\0\0", 10}, {"\272m\224vf\274\366\r\224`\2058\10\0E\0\0T\364\26\0\0@"..., 1518}], 2) = 108
* Launcher injects guest notification:
write(10, "\2\0\0\0\2\0\0\0", 8) = 0
* Launcher rechecks fds:
select(7, [0 3 4 6], NULL, NULL, {0, 0}) = 0 (Timeout)
* Launcher clears Waker:
pwrite64(10, "\3\0\0\0\0\0\0\0", 8, 0) = 0
* Launcher reruns Guest:
pread64(10, 0xbfa5f4d4, 4, 0) = ? ERESTARTSYS (To be restarted)
* Signal comes in, uses pipe to wake up Launcher:
--- SIGALRM (Alarm clock) @ 0 (0) ---
write(8, "\0", 1)       = 1
sigreturn()             = ? (mask now [])
* Waker sees write on pipe:
select(12, [0 3 4 6 11], NULL, NULL, NULL) = 1 (in [6])
* Waker kicks Launcher out of Guest:
pwrite64(10, "\3\0\0\0\1\0\0\0", 8, 0) = 0
* Launcher exits from kernel:
pread64(10, 0xbfa5f4d4, 4, 0) = -1 EAGAIN (Resource temporarily unavailable)
* Launcher looks to see what fd woke it:
select(7, [0 3 4 6], NULL, NULL, {0, 0}) = 1 (in [6], left {0, 0})
* Launcher reads timeout fd, sets notification flag on xmit ring
read(6, "\0", 32)       = 1
* Launcher rechecks fds:
select(7, [0 3 4 6], NULL, NULL, {0, 0}) = 0 (Timeout)
* Launcher clears Waker:
pwrite64(10, "\3\0\0\0\0\0\0\0", 8, 0) = 0
* Launcher resumes Guest:
pread64(10, "\0p\0\4", 4, 0) ....

strace analysis of single Guest->Host ping after:

* Guest sends packet, notifies xmit vq, creates event on eventfd.
* Network xmit thread wakes from read on eventfd:
read(7, "\1\0\0\0\0\0\0\0", 8)          = 8
* Network xmit thread writes packet to TUN device
writev(4, [{"\0\0\0\0\0\0\0\0\0\0", 10}, {"J\217\232FI\37j\27\375\276\0\304\10\0E\0\0T\0\0@\0@\1\265"..., 98}], 2) = 108
* Network recv thread wakes up from read on tunfd:
readv(4, [{"\0\0\0\0\0\0\0\0\0\0", 10}, {"j\27\375\276\0\304J\217\232FI\37\10\0E\0\0TiO\0\0@\1\214"..., 1518}], 2) = 108
* Network recv thread sets up interrupt for the Guest
write(6, "\2\0\0\0\2\0\0\0", 8) = 0
* Network recv thread goes back to reading tunfd
13:39:42.460285 readv(4,  <unfinished ...>
* Network xmit thread sets up interrupt for Guest (xmit ring is empty)
write(6, "\2\0\0\0\3\0\0\0", 8) = 0
* Network xmit thread goes back to reading from eventfd
read(7, <unfinished ...>

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: use eventfds for device notification
Rusty Russell [Sat, 13 Jun 2009 04:27:09 +0000 (22:27 -0600)] 
lguest: use eventfds for device notification

Currently, when a Guest wants to perform I/O it calls LHCALL_NOTIFY with
an address: the main Launcher process returns with this address, and figures
out what device to run.

A far nicer model is to let processes bind an eventfd to an address: if we
find one, we simply signal the eventfd.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Davide Libenzi <davidel@xmailserver.org>
15 years agoeventfd: export eventfd_signal and eventfd_fget for lguest
Rusty Russell [Sat, 13 Jun 2009 04:27:09 +0000 (22:27 -0600)] 
eventfd: export eventfd_signal and eventfd_fget for lguest

lguest wants to attach eventfds to guest notifications, and lguest is
usually a module.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
To: Davide Libenzi <davidel@xmailserver.org>

15 years agolguest: allow any process to send interrupts
Rusty Russell [Sat, 13 Jun 2009 04:27:08 +0000 (22:27 -0600)] 
lguest: allow any process to send interrupts

We currently only allow the Launcher process to send interrupts, but it
as we already send interrupts from the hrtimer, it's a simple matter of
extracting that code into a common set_interrupt routine.

As we switch to a thread per virtqueue, this avoids a bottleneck through the
main Launcher process.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: PAE fixes
Rusty Russell [Sat, 13 Jun 2009 04:27:08 +0000 (22:27 -0600)] 
lguest: PAE fixes

1) j wasn't initialized in setup_pagetables, so they weren't set up for me
   causing immediate guest crashes.

2) gpte_addr should not re-read the pmd from the Guest.  Especially
   not BUG_ON() based on the value.  If we ever supported SMP guests,
   they could trigger that.  And the Launcher could also trigger it
   (tho currently root-only).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: PAE support
Matias Zabaljauregui [Sat, 13 Jun 2009 04:27:07 +0000 (22:27 -0600)] 
lguest: PAE support

This version requires that host and guest have the same PAE status.
NX cap is not offered to the guest, yet.

Signed-off-by: Matias Zabaljauregui <zabaljauregui@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: Add support for kvm_hypercall4()
Matias Zabaljauregui [Sat, 13 Jun 2009 04:27:07 +0000 (22:27 -0600)] 
lguest: Add support for kvm_hypercall4()

Add support for kvm_hypercall4(); PAE wants it.

Signed-off-by: Matias Zabaljauregui <zabaljauregui at gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: replace hypercall name LHCALL_SET_PMD with LHCALL_SET_PGD
Matias Zabaljauregui [Sat, 30 May 2009 18:48:08 +0000 (15:48 -0300)] 
lguest: replace hypercall name LHCALL_SET_PMD with LHCALL_SET_PGD

replace LHCALL_SET_PMD with LHCALL_SET_PGD hypercall name
(That's really what it is, and the confusion gets worse with PAE support)

Signed-off-by: Matias Zabaljauregui <zabaljauregui@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reported-by: Jeremy Fitzhardinge <jeremy@goop.org>
15 years agolguest: use native_set_* macros, which properly handle 64-bit entries when PAE is...
Matias Zabaljauregui [Sat, 13 Jun 2009 04:27:06 +0000 (22:27 -0600)] 
lguest: use native_set_* macros, which properly handle 64-bit entries when PAE is activated

Some cleanups and replace direct assignment with native_set_* macros which properly handle 64-bit entries when PAE is activated

Signed-off-by: Matias Zabaljauregui <zabaljauregui@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: map switcher with executable page table entries
Matias Zabaljauregui [Sat, 30 May 2009 18:35:49 +0000 (15:35 -0300)] 
lguest: map switcher with executable page table entries

Map switcher with executable page table entries.
(This bug didn't matter before PAE and hence NX support -- RR)

Signed-off-by: Matias Zabaljauregui <zabaljauregui@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: fix writev returning short on console output
Rusty Russell [Sat, 13 Jun 2009 04:27:05 +0000 (22:27 -0600)] 
lguest: fix writev returning short on console output

I've never seen it here, but I can't find anywhere that says writev
will write everything.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: clean up length-used value in example launcher
Rusty Russell [Sat, 13 Jun 2009 04:27:04 +0000 (22:27 -0600)] 
lguest: clean up length-used value in example launcher

The "len" field in the used ring for virtio indicates the number of
bytes *written* to the buffer.  This means the guest doesn't have to
zero the buffers in advance as it always knows the used length.

Erroneously, the console and network example code puts the length
*read* into that field.  The guest ignores it, but it's wrong.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: Segment selectors are 16-bit long. Fix lg_cpu.ss1 definition.
Matias Zabaljauregui [Sat, 13 Jun 2009 04:27:04 +0000 (22:27 -0600)] 
lguest: Segment selectors are 16-bit long. Fix lg_cpu.ss1 definition.

If GDT_ENTRIES were every > 256, this could become a problem.

Signed-off-by: Matias Zabaljauregui <zabaljauregui at gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: beyond ARRAY_SIZE of cpu->arch.gdt
Roel Kluin [Tue, 19 May 2009 23:45:45 +0000 (01:45 +0200)] 
lguest: beyond ARRAY_SIZE of cpu->arch.gdt

Do not go beyond ARRAY_SIZE of cpu->arch.gdt

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: clean up example launcher compile flags.
Rusty Russell [Sat, 13 Jun 2009 04:27:03 +0000 (22:27 -0600)] 
lguest: clean up example launcher compile flags.

18 months ago 5bbf89fc260830f3f58b331d946a16b39ad1ca2d changed to loading
bzImages directly, and no longer manually ungzipping them, so we no longer
need libz.

Also, -m32 is useful for those on 64-bit platforms (and harmless on
32-bit).

Reported-by: Ron Minnich <rminnich@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: optimize by coding restore_flags and irq_enable in assembler.
Rusty Russell [Sat, 13 Jun 2009 04:27:03 +0000 (22:27 -0600)] 
lguest: optimize by coding restore_flags and irq_enable in assembler.

The downside of the last patch which made restore_flags and irq_enable
check interrupts is that they are now too big to be patched directly
into the callsites, so the C versions are always used.

But the C versions go via PV_CALLEE_SAVE_REGS_THUNK which saves all
the registers.  In fact, we don't need any registers in the fast path,
so we can do better than this if we actually code them in assembler.

The results are in the noise, but since it's about the same amount of
code, it's worth applying.

1GB Guest->Host: input(suppressed),output(suppressed)
Before:
Seconds: 0:16.53
Packets: 377268,753673
Interrupts: 22461,24297
Notifications: 1(5245),21303(732370)
Net IRQs triggered: 377023(245),42578(711095)

After:
Seconds: 0:16.48
Packets: 377289,753673
Interrupts: 22281,24465
Notifications: 1(5245),21296(732377)
Net IRQs triggered: 377060(229),42564(711109)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: improve interrupt handling, speed up stream networking
Rusty Russell [Sat, 13 Jun 2009 04:27:02 +0000 (22:27 -0600)] 
lguest: improve interrupt handling, speed up stream networking

lguest never checked for pending interrupts when enabling interrupts, and
things still worked.  However, it makes a significant difference to TCP
performance, so it's time we fixed it by introducing a pending_irq flag
and checking it on irq_restore and irq_enable.

These two routines are now too big to patch into the 8/10 bytes
patch space, so we drop that code.

Note: The high latency on interrupt delivery had a very curious
effect: once everything else was optimized, networking without GSO was
faster than networking with GSO, since more interrupts were sent and
hence a greater chance of one getting through to the Guest!

Note2: (Almost) Closing the same loophole for iret doesn't have any
measurable effect, so I'm leaving that patch for the moment.

Before:
1GB tcpblast Guest->Host: 30.7 seconds
1GB tcpblast Guest->Host (no GSO): 76.0 seconds

After:
1GB tcpblast Guest->Host: 6.8 seconds
1GB tcpblast Guest->Host (no GSO): 27.8 seconds

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: fix race in halt code
Rusty Russell [Sat, 13 Jun 2009 04:27:02 +0000 (22:27 -0600)] 
lguest: fix race in halt code

When the Guest does the LHCALL_HALT hypercall, we go to sleep, expecting
that a timer or the Waker will wake_up_process() us.

But we do it in a stupid way, leaving a classic missing wakeup race.

So split maybe_do_interrupt() into interrupt_pending() and
try_deliver_interrupt(), and check maybe_do_interrupt() and the
"break_out" flag before calling schedule.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: remove invalid interrupt forcing logic.
Rusty Russell [Sat, 13 Jun 2009 04:27:01 +0000 (22:27 -0600)] 
lguest: remove invalid interrupt forcing logic.

20887611523e749d99cc7d64ff6c97d27529fbae (lguest: notify on empty) introduced
lguest support for the VIRTIO_F_NOTIFY_ON_EMPTY flag, but in fact it turned on
interrupts all the time.

Because we always process one buffer at a time, the inflight count is always 0
when call trigger_irq and so we always ignore VRING_AVAIL_F_NO_INTERRUPT from
the Guest.

It should be looking to see if there are more buffers in the Guest's queue:
if it's empty, then we force an interrupt.

This makes little difference, since we usually have an empty queue; but
that's the subject of another patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: fix lguest wake on guest clock tick, or fd activity
Rusty Russell [Sat, 13 Jun 2009 04:27:01 +0000 (22:27 -0600)] 
lguest: fix lguest wake on guest clock tick, or fd activity

The Launcher could be inside the Guest on another CPU; wake_up_process
will do nothing because it is "running".  kick_process will knock it
back into our kernel in this case, otherwise we'll miss it until the
next guest exit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agosched: export kick_process
Rusty Russell [Sat, 13 Jun 2009 04:27:00 +0000 (22:27 -0600)] 
sched: export kick_process

lguest needs kick_process: wake_up_process() does nothing if a process
is running, which isn't sufficient (we need it in the kernel).

And lguest support is usually modular.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
15 years agolguest: get more serious about wmb() in example Launcher code
Rusty Russell [Sat, 13 Jun 2009 04:27:00 +0000 (22:27 -0600)] 
lguest: get more serious about wmb() in example Launcher code

Since the Launcher process runs the Guest, it doesn't have to be very
serious about its barriers: the Guest isn't running while we are (Guest
is UP).

Before we change to use threads to service devices, we need to fix this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: clean up lguest_init_IRQ
Rusty Russell [Sat, 13 Jun 2009 04:26:59 +0000 (22:26 -0600)] 
lguest: clean up lguest_init_IRQ

Copy from arch/x86/kernel/irqinit_32.c: we don't use the vectors beyond
LGUEST_IRQS (if any), but we might as well set them all.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: cleanup passing of /dev/lguest fd around example launcher.
Rusty Russell [Sat, 13 Jun 2009 04:26:59 +0000 (22:26 -0600)] 
lguest: cleanup passing of /dev/lguest fd around example launcher.

We hand the /dev/lguest fd everywhere; it's far neater to just make it
a global (it already is, in fact, hidden in the waker_fds struct).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agolguest: be paranoid about guest playing with device descriptors.
Rusty Russell [Sat, 13 Jun 2009 04:26:58 +0000 (22:26 -0600)] 
lguest: be paranoid about guest playing with device descriptors.

We can't trust the values in the device descriptor table once the
guest has booted, so keep local copies.  They could set them to
strange values then cause us to segv (they're 8 bit values, so they
can't make our pointers go too wild).

This becomes more important with the following patches which read them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: enhance id_matching for virtio drivers
Christian Borntraeger [Tue, 26 May 2009 13:46:10 +0000 (15:46 +0200)] 
virtio: enhance id_matching for virtio drivers

This patch allows a virtio driver to use VIRTIO_DEV_ANY_ID for the
device id. This will be used by a test module that can be bound to
any virtio device.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: fix id_matching for virtio drivers
Christian Borntraeger [Tue, 26 May 2009 13:46:09 +0000 (15:46 +0200)] 
virtio: fix id_matching for virtio drivers

This bug never appeared, since all current virtio drivers use
VIRTIO_DEV_ANY_ID for the vendor field. If a real vendor would be used,
the check in virtio_id_match is wrong - it returns 0 if
id->vendor == dev->id.vendor.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: handle short buffers in virtio_rng.
Rusty Russell [Sat, 13 Jun 2009 04:16:39 +0000 (22:16 -0600)] 
virtio: handle short buffers in virtio_rng.

If the device fills less than 4 bytes of our random buffer, we'll
BUG_ON.  It's nicer to handle the case where it partially fills the
buffer (the protocol doesn't explicitly bad that).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio_blk: add missing __dev{init,exit} markings
Mike Frysinger [Mon, 18 May 2009 07:39:09 +0000 (03:39 -0400)] 
virtio_blk: add missing __dev{init,exit} markings

The remove member of the virtio_driver structure uses __devexit_p(), so
the remove function itself should be marked with __devexit.  And where
there be __devexit on the remove, so is there __devinit on the probe.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC)
Mark McLoughlin [Mon, 11 May 2009 17:11:45 +0000 (18:11 +0100)] 
virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC)

Add a new feature flag for indirect ring entries. These are ring
entries which point to a table of buffer descriptors.

The idea here is to increase the ring capacity by allowing a larger
effective ring size whereby the ring size dictates the number of
requests that may be outstanding, rather than the size of those
requests.

This should be most effective in the case of block I/O where we can
potentially benefit by concurrently dispatching a large number of
large requests. Even in the simple case of single segment block
requests, this results in a threefold increase in ring capacity.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: teach virtio_has_feature() about transport features
Mark McLoughlin [Mon, 11 May 2009 17:11:44 +0000 (18:11 +0100)] 
virtio: teach virtio_has_feature() about transport features

Drivers don't add transport features to their table, so we
shouldn't check these with virtio_check_driver_offered_feature().

We could perhaps add an ->offered_feature() virtio_config_op,
but that perhaps that would be overkill for a consitency check
like this.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: expose features in sysfs
Rusty Russell [Sat, 13 Jun 2009 04:16:37 +0000 (22:16 -0600)] 
virtio: expose features in sysfs

Each device negotiates feature bits; expose these in sysfs to help
diagnostics and debugging.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio_pci: optional MSI-X support
Michael S. Tsirkin [Thu, 14 May 2009 10:55:41 +0000 (13:55 +0300)] 
virtio_pci: optional MSI-X support

This implements optional MSI-X support in virtio_pci.
MSI-X is used whenever the host supports at least 2 MSI-X
vectors: 1 for configuration changes and 1 for virtqueues.
Per-virtqueue vectors are allocated if enough vectors
available.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (+ whitespace, style)
15 years agovirtio_pci: split up vp_interrupt
Michael S. Tsirkin [Thu, 14 May 2009 10:55:31 +0000 (13:55 +0300)] 
virtio_pci: split up vp_interrupt

This reorganizes virtio-pci code in vp_interrupt slightly, so that
it's easier to add per-vq MSI support on top.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: find_vqs/del_vqs virtio operations
Michael S. Tsirkin [Sat, 13 Jun 2009 04:16:36 +0000 (22:16 -0600)] 
virtio: find_vqs/del_vqs virtio operations

This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations,
and updates all drivers. This is needed for MSI support, because MSI
needs to know the total number of vectors upfront.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (+ lguest/9p compile fixes)
15 years agovirtio: add names to virtqueue struct, mapping from devices to queues.
Rusty Russell [Sat, 13 Jun 2009 04:16:35 +0000 (22:16 -0600)] 
virtio: add names to virtqueue struct, mapping from devices to queues.

Add a linked list of all virtqueues for a virtio device: this helps for
debugging and is also needed for upcoming interface change.

Also, add a "name" field for clearer debug messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: meet virtio spec by finalizing features before using device
Rusty Russell [Sat, 13 Jun 2009 04:16:35 +0000 (22:16 -0600)] 
virtio: meet virtio spec by finalizing features before using device

Virtio devices are supposed to negotiate features before they start using
the device, but the current code doesn't do this.  This is because the
driver's probe() function invariably has to add buffers to a virtqueue,
or probe the disk (virtio_blk).

This currently doesn't matter since no existing backend is strict about
the feature negotiation.  But it's possible to imagine a future feature
which completely changes how a device operates: in this case, we'd need
to acknowledge it before using the device.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agovirtio: fix obsolete documentation on probe function
Rusty Russell [Sat, 13 Jun 2009 04:16:33 +0000 (22:16 -0600)] 
virtio: fix obsolete documentation on probe function

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoGFS2: Remove lock_kernel from gfs2_put_super()
Steven Whitehouse [Fri, 12 Jun 2009 12:40:47 +0000 (13:40 +0100)] 
GFS2: Remove lock_kernel from gfs2_put_super()

It is not required here.

Signed-off-by: Steven Whitehouse <swhiteho@redhat,com>
Cc: Christoph Hellwig <hch@infradead.org>
15 years agoperf_counter: Add forward/backward attribute ABI compatibility
Peter Zijlstra [Fri, 12 Jun 2009 10:46:55 +0000 (12:46 +0200)] 
perf_counter: Add forward/backward attribute ABI compatibility

Provide for means of extending the perf_counter_attr in a 'natural' way.

We allow growing the structure by appending fields at the end by specifying
the full structure size inside it.

When a new kernel sees a smaller (old) structure, it will 0 pad the tail.
When an old kernel sees a larger (new) structure, it will verify the tail
consists of 0s, otherwise fail.

If we fail due to a size-mismatch, we return -E2BIG and write the kernel's
native attribe size back into the provided structure.

Furthermore, add some attribute verification, so that we'll fail counter
creation when unknown bits are present (PERF_SAMPLE, PERF_FORMAT, or in
the __reserved fields).

(This ABI detail is introduced while keeping the existing syscall ABI.)

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoperf record: Explicity program a default counter
Peter Zijlstra [Thu, 11 Jun 2009 21:11:50 +0000 (23:11 +0200)] 
perf record: Explicity program a default counter

Up until now record has worked on the assumption that type=0, config=0
was a suitable configuration - which it is. Lets make this a little more
explicit and more readable via the use of proper symbols.

[ Impact: cleanup ]

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoperf_counter: Remove PERF_TYPE_RAW special casing
Peter Zijlstra [Thu, 11 Jun 2009 15:57:21 +0000 (17:57 +0200)] 
perf_counter: Remove PERF_TYPE_RAW special casing

The PERF_TYPE_RAW special case seems superfluous these days. Remove
it and add it to the switch() stmt like the others.

[ Impact: cleanup ]

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoperf_counter: PERF_TYPE_HW_CACHE is a hardware counter too
Peter Zijlstra [Thu, 11 Jun 2009 15:56:09 +0000 (17:56 +0200)] 
perf_counter: PERF_TYPE_HW_CACHE is a hardware counter too

is_software_counter() was missing the new HW_CACHE category.

( This could have caused some counter scheduling artifacts
  with mixed sw and hw counters and counter groups. )

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agopowerpc, perf_counter: Fix performance counter event types
Jaswinder Singh Rajput [Fri, 12 Jun 2009 06:34:54 +0000 (12:04 +0530)] 
powerpc, perf_counter: Fix performance counter event types

Sachin Sant reported these compiler errors:

 CC      arch/powerpc/kernel/power7-pmu.o
arch/powerpc/kernel/power7-pmu.c:297: error: PERF_COUNT_CPU_CYCLES undeclared here (not in a function)

Which happened because a last-minute rename of symbols crossed with
the Power7 support patch.

Fix this by using the new symbol names.

Reported-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
LKML-Reference: <1244788494.5554.1.camel@ht.satnam>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agomodule: cleanup FIXME comments about trimming exception table entries.
Rusty Russell [Sat, 13 Jun 2009 03:47:04 +0000 (21:47 -0600)] 
module: cleanup FIXME comments about trimming exception table entries.

Everyone cut and paste this comment from my original one.  We now do
it generically, so cut the comments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Amerigo Wang <amwang@redhat.com>
15 years agomodule: trim exception table on init free.
Rusty Russell [Sat, 13 Jun 2009 03:47:03 +0000 (21:47 -0600)] 
module: trim exception table on init free.

It's theoretically possible that there are exception table entries
which point into the (freed) init text of modules.  These could cause
future problems if other modules get loaded into that memory and cause
an exception as we'd see the wrong fixup.  The only case I know of is
kvm-intel.ko (when CONFIG_CC_OPTIMIZE_FOR_SIZE=n).

Amerigo fixed this long-standing FIXME in the x86 version, but this
patch is more general.

This implements trim_init_extable(); most archs are simple since they
use the standard lib/extable.c sort code.  Alpha and IA64 use relative
addresses in their fixups, so thier trimming is a slight variation.

Sparc32 is unique; it doesn't seem to define ARCH_HAS_SORT_EXTABLE,
yet it defines its own sort_extable() which overrides the one in lib.
It doesn't sort, so we have to mark deleted entries instead of
actually trimming them.

Inspired-by: Amerigo Wang <amwang@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-alpha@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Cc: linux-ia64@vger.kernel.org
15 years agomodule: merge module_alloc() finally
Amerigo Wang [Thu, 4 Jun 2009 01:46:46 +0000 (21:46 -0400)] 
module: merge module_alloc() finally

As Christoph Hellwig suggested, module_alloc() actually can be
unified for i386 and x86_64 (of course, also UML).

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: 'Ingo Molnar' <mingo@elte.hu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agouml module: fix uml build process due to this merge
Amerigo Wang [Thu, 4 Jun 2009 01:46:28 +0000 (21:46 -0400)] 
uml module: fix uml build process due to this merge

Due to the previous merge, uml needs to be fixed.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agox86 module: merge the rest functions with macros
Amerigo Wang [Thu, 4 Jun 2009 01:46:19 +0000 (21:46 -0400)] 
x86 module: merge the rest functions with macros

Merge the rest functions together, with proper preprocessing directives.
Finally remove module_{32|64}.c.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agox86 module: merge the same functions in module_32.c and module_64.c
Amerigo Wang [Thu, 4 Jun 2009 01:46:09 +0000 (21:46 -0400)] 
x86 module: merge the same functions in module_32.c and module_64.c

Merge the same functions both in module_32.c and module_64.c into
module.c.

This is the first step to merge both of them finally.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agouvesafb: improve parameter handling.
Rusty Russell [Sat, 13 Jun 2009 03:46:58 +0000 (21:46 -0600)] 
uvesafb: improve parameter handling.

1) Now module_param(..., invbool, ...) requires a bool, and similarly
   module_param(..., bool, ...) allows it, change pmi_setpal to a bool.
2) #define param_get_scroll to NULL, since it can never be called (perm
   argument to module_param_named is 0).
3) Return -EINVAL from param_set_scroll if the value is bad, so it's
   reported.

Note that I don't think the old fb_get_options() is required for new
drivers: the parameters automatically work as uvesafb.XXX=... anyway.

Acked-by: Michał Januszewski <spock@gentoo.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agomodule_param: allow 'bool' module_params to be bool, not just int.
Rusty Russell [Sat, 13 Jun 2009 03:46:57 +0000 (21:46 -0600)] 
module_param: allow 'bool' module_params to be bool, not just int.

Impact: API cleanup

For historical reasons, 'bool' parameters must be an int, not a bool.
But there are around 600 users, so a conversion seems like useless churn.

So we use __same_type() to distinguish, and handle both cases.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agomodule_param: add __same_type convenience wrapper for __builtin_types_compatible_p
Rusty Russell [Sat, 13 Jun 2009 03:46:56 +0000 (21:46 -0600)] 
module_param: add __same_type convenience wrapper for __builtin_types_compatible_p

Impact: new API

__builtin_types_compatible_p() is a little awkward to use: it takes two
types rather than types or variables, and it's just damn long.

(typeof(type) == type, so this works on types as well as vars).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agomodule_param: split perm field into flags and perm
Rusty Russell [Sat, 13 Jun 2009 03:46:56 +0000 (21:46 -0600)] 
module_param: split perm field into flags and perm

Impact: cleanup

Rather than hack KPARAM_KMALLOCED into the perm field, separate it out.
Since the perm field was 32 bits and only needs 16, we don't add bloat.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agomodule_param: invbool should take a 'bool', not an 'int'
Rusty Russell [Sat, 13 Jun 2009 03:46:53 +0000 (21:46 -0600)] 
module_param: invbool should take a 'bool', not an 'int'

It takes an 'int' for historical reasons, and there are only two
users: simply switch it over to bool.

The other user (uvesafb.c) will get a (harmless-on-x86) warning until
the next patch is applied.

Cc: Brad Douglas <brad@neruo.com>
Cc: Michal Januszewski <spock@gentoo.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agocyber2000fb.c: use proper method for stopping unload if CONFIG_ARCH_SHARK
Rusty Russell [Sat, 13 Jun 2009 03:46:50 +0000 (21:46 -0600)] 
cyber2000fb.c: use proper method for stopping unload if CONFIG_ARCH_SHARK

Russell explains the __module_get():
> cyber2000fb.c does it in its module initialization function
> to prevent the module (when built for Shark) from being unloaded.  It
> does this because it's from the days of 2.2 kernels and no one bothered
> writing the module unload support for Shark.

Since 2.4, the correct answer has been to not define an unload fn.

Cc: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: alex@shark-linux.de
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agokmemleak: Add more info to the MAINTAINERS entry
Catalin Marinas [Fri, 12 Jun 2009 08:35:22 +0000 (09:35 +0100)] 
kmemleak: Add more info to the MAINTAINERS entry

The patch adds the "F:" fields to the KMEMLEAK MAINTAINERS entry and
also moves it before KMEMTRACE to preserve the alphabetical order.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
15 years agoperf_counter/x86: Add a quirk for Atom processors
Yong Wang [Fri, 12 Jun 2009 08:08:55 +0000 (16:08 +0800)] 
perf_counter/x86: Add a quirk for Atom processors

The fixed-function performance counters do not work on current Atom
processors. Use the general-purpose ones instead.

Signed-off-by: Yong Wang <yong.y.wang@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <20090612080855.GA2286@ywang-moblin2.bj.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>