Commit 7cf0bed9c322992c7d5f912cb9a83d2809e71881
Exists in
master
and in
7 other branches
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* 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
Showing 5 changed files Side-by-side Diff
Documentation/lguest/lguest.c
... | ... | @@ -895,6 +895,9 @@ |
895 | 895 | } |
896 | 896 | } |
897 | 897 | |
898 | +/* This is called when we no longer want to hear about Guest changes to a | |
899 | + * virtqueue. This is more efficient in high-traffic cases, but it means we | |
900 | + * have to set a timer to check if any more changes have occurred. */ | |
898 | 901 | static void block_vq(struct virtqueue *vq) |
899 | 902 | { |
900 | 903 | struct itimerval itm; |
... | ... | @@ -939,6 +942,11 @@ |
939 | 942 | if (!timeout && num) |
940 | 943 | block_vq(vq); |
941 | 944 | |
945 | + /* We never quite know how long should we wait before we check the | |
946 | + * queue again for more packets. We start at 500 microseconds, and if | |
947 | + * we get fewer packets than last time, we assume we made the timeout | |
948 | + * too small and increase it by 10 microseconds. Otherwise, we drop it | |
949 | + * by one microsecond every time. It seems to work well enough. */ | |
942 | 950 | if (timeout) { |
943 | 951 | if (num < last_timeout_num) |
944 | 952 | timeout_usec += 10; |
drivers/lguest/lguest_device.c
... | ... | @@ -98,6 +98,10 @@ |
98 | 98 | return features; |
99 | 99 | } |
100 | 100 | |
101 | +/* The virtio core takes the features the Host offers, and copies the | |
102 | + * ones supported by the driver into the vdev->features array. Once | |
103 | + * that's all sorted out, this routine is called so we can tell the | |
104 | + * Host which features we understand and accept. */ | |
101 | 105 | static void lg_finalize_features(struct virtio_device *vdev) |
102 | 106 | { |
103 | 107 | unsigned int i, bits; |
... | ... | @@ -108,6 +112,10 @@ |
108 | 112 | /* Give virtio_ring a chance to accept features. */ |
109 | 113 | vring_transport_features(vdev); |
110 | 114 | |
115 | + /* The vdev->feature array is a Linux bitmask: this isn't the | |
116 | + * same as a the simple array of bits used by lguest devices | |
117 | + * for features. So we do this slow, manual conversion which is | |
118 | + * completely general. */ | |
111 | 119 | memset(out_features, 0, desc->feature_len); |
112 | 120 | bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8; |
113 | 121 | for (i = 0; i < bits; i++) { |
drivers/virtio/virtio_balloon.c
... | ... | @@ -158,7 +158,7 @@ |
158 | 158 | vb->vdev->config->get(vb->vdev, |
159 | 159 | offsetof(struct virtio_balloon_config, num_pages), |
160 | 160 | &v, sizeof(v)); |
161 | - return v - vb->num_pages; | |
161 | + return (s64)v - vb->num_pages; | |
162 | 162 | } |
163 | 163 | |
164 | 164 | static void update_balloon_size(struct virtio_balloon *vb) |
drivers/xen/manage.c
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | /* XXX use normal device tree? */ |
103 | 103 | xenbus_suspend(); |
104 | 104 | |
105 | - err = stop_machine_run(xen_suspend, &cancelled, 0); | |
105 | + err = stop_machine(xen_suspend, &cancelled, &cpumask_of_cpu(0)); | |
106 | 106 | if (err) { |
107 | 107 | printk(KERN_ERR "failed to start xen_suspend: %d\n", err); |
108 | 108 | goto out; |
include/linux/stop_machine.h
... | ... | @@ -3,16 +3,13 @@ |
3 | 3 | /* "Bogolock": stop the entire machine, disable interrupts. This is a |
4 | 4 | very heavy lock, which is equivalent to grabbing every spinlock |
5 | 5 | (and more). So the "read" side to such a lock is anything which |
6 | - diables preeempt. */ | |
6 | + disables preeempt. */ | |
7 | 7 | #include <linux/cpu.h> |
8 | 8 | #include <linux/cpumask.h> |
9 | 9 | #include <asm/system.h> |
10 | 10 | |
11 | 11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
12 | 12 | |
13 | -/* Deprecated, but useful for transition. */ | |
14 | -#define ALL_CPUS ~0U | |
15 | - | |
16 | 13 | /** |
17 | 14 | * stop_machine: freeze the machine on all CPUs and run this function |
18 | 15 | * @fn: the function to run |
... | ... | @@ -50,19 +47,5 @@ |
50 | 47 | return ret; |
51 | 48 | } |
52 | 49 | #endif /* CONFIG_SMP */ |
53 | - | |
54 | -static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data, | |
55 | - unsigned int cpu) | |
56 | -{ | |
57 | - /* If they don't care which cpu fn runs on, just pick one. */ | |
58 | - if (cpu == NR_CPUS) | |
59 | - return stop_machine(fn, data, NULL); | |
60 | - else if (cpu == ~0U) | |
61 | - return stop_machine(fn, data, &cpu_possible_map); | |
62 | - else { | |
63 | - cpumask_t cpus = cpumask_of_cpu(cpu); | |
64 | - return stop_machine(fn, data, &cpus); | |
65 | - } | |
66 | -} | |
67 | 50 | #endif /* _LINUX_STOP_MACHINE */ |