Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Aug 2008 18:18:49 +0000 (11:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Aug 2008 18:18:49 +0000 (11:18 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  lguest: update commentry
  stop_machine: Remove deprecated stop_machine_run
  stop_machine: wean Xen off stop_machine_run
  virtio_balloon: fix towards_target when deflating balloon

Documentation/lguest/lguest.c
drivers/lguest/lguest_device.c
drivers/virtio/virtio_balloon.c
drivers/xen/manage.c
include/linux/stop_machine.h

index 655414821edc361fae2382104a068bb2c895f0de..7228369d1014b956ff3c8843d8ef642a225682b3 100644 (file)
@@ -895,6 +895,9 @@ static void handle_console_output(int fd, struct virtqueue *vq, bool timeout)
        }
 }
 
+/* This is called when we no longer want to hear about Guest changes to a
+ * virtqueue.  This is more efficient in high-traffic cases, but it means we
+ * have to set a timer to check if any more changes have occurred. */
 static void block_vq(struct virtqueue *vq)
 {
        struct itimerval itm;
@@ -939,6 +942,11 @@ static void handle_net_output(int fd, struct virtqueue *vq, bool timeout)
        if (!timeout && num)
                block_vq(vq);
 
+       /* We never quite know how long should we wait before we check the
+        * queue again for more packets.  We start at 500 microseconds, and if
+        * we get fewer packets than last time, we assume we made the timeout
+        * too small and increase it by 10 microseconds.  Otherwise, we drop it
+        * by one microsecond every time.  It seems to work well enough. */
        if (timeout) {
                if (num < last_timeout_num)
                        timeout_usec += 10;
index 37344aaee22f3ab44910a18576489466c0b8c30d..a661bbdae3d62f657fc801eceb80d9afefc3e4bf 100644 (file)
@@ -98,6 +98,10 @@ static u32 lg_get_features(struct virtio_device *vdev)
        return features;
 }
 
+/* The virtio core takes the features the Host offers, and copies the
+ * ones supported by the driver into the vdev->features array.  Once
+ * that's all sorted out, this routine is called so we can tell the
+ * Host which features we understand and accept. */
 static void lg_finalize_features(struct virtio_device *vdev)
 {
        unsigned int i, bits;
@@ -108,6 +112,10 @@ static void lg_finalize_features(struct virtio_device *vdev)
        /* Give virtio_ring a chance to accept features. */
        vring_transport_features(vdev);
 
+       /* The vdev->feature array is a Linux bitmask: this isn't the
+        * same as a the simple array of bits used by lguest devices
+        * for features.  So we do this slow, manual conversion which is
+        * completely general. */
        memset(out_features, 0, desc->feature_len);
        bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8;
        for (i = 0; i < bits; i++) {
index bfef604160d16460062f46b84f16c9320579c0d4..62eab43152d21314826838080caed9ad3ee3eb1e 100644 (file)
@@ -158,7 +158,7 @@ static inline s64 towards_target(struct virtio_balloon *vb)
        vb->vdev->config->get(vb->vdev,
                              offsetof(struct virtio_balloon_config, num_pages),
                              &v, sizeof(v));
-       return v - vb->num_pages;
+       return (s64)v - vb->num_pages;
 }
 
 static void update_balloon_size(struct virtio_balloon *vb)
index a5bc91ae6ff69f5d5d4b2e9f49e308acd9126b20..d0e87cbe157ca5e4634151f8d997e9d66fb66ebc 100644 (file)
@@ -102,7 +102,7 @@ static void do_suspend(void)
        /* XXX use normal device tree? */
        xenbus_suspend();
 
-       err = stop_machine_run(xen_suspend, &cancelled, 0);
+       err = stop_machine(xen_suspend, &cancelled, &cpumask_of_cpu(0));
        if (err) {
                printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
                goto out;
index f1cb0ba6d71586a5cd2f5b41172ee5b32b55631d..faf1519b5adc5235aab952baeb6876083e21c5ab 100644 (file)
@@ -3,16 +3,13 @@
 /* "Bogolock": stop the entire machine, disable interrupts.  This is a
    very heavy lock, which is equivalent to grabbing every spinlock
    (and more).  So the "read" side to such a lock is anything which
-   diables preeempt. */
+   disables preeempt. */
 #include <linux/cpu.h>
 #include <linux/cpumask.h>
 #include <asm/system.h>
 
 #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
 
-/* Deprecated, but useful for transition. */
-#define ALL_CPUS ~0U
-
 /**
  * stop_machine: freeze the machine on all CPUs and run this function
  * @fn: the function to run
@@ -50,18 +47,4 @@ static inline int stop_machine(int (*fn)(void *), void *data,
        return ret;
 }
 #endif /* CONFIG_SMP */
-
-static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data,
-                                               unsigned int cpu)
-{
-       /* If they don't care which cpu fn runs on, just pick one. */
-       if (cpu == NR_CPUS)
-               return stop_machine(fn, data, NULL);
-       else if (cpu == ~0U)
-               return stop_machine(fn, data, &cpu_possible_map);
-       else {
-               cpumask_t cpus = cpumask_of_cpu(cpu);
-               return stop_machine(fn, data, &cpus);
-       }
-}
 #endif /* _LINUX_STOP_MACHINE */