Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109095
b: refs/heads/master
c: 087713f
h: refs/heads/master
i:
  109093: 28d2775
  109091: bc08dd3
  109087: f95416e
v: v3
  • Loading branch information
Linus Torvalds committed Aug 25, 2008
1 parent 9b9a538 commit 6da4bed
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1327138e294ffda120a50c8f31d792addb196c79
refs/heads/master: 087713f4548e598be64bce28bae36009d41038a4
8 changes: 8 additions & 0 deletions trunk/Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/lguest/lguest_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/virtio/virtio_balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/xen/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 1 addition & 18 deletions trunk/include/linux/stop_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ static void *module_alloc_update_bounds(unsigned long size)

/* Allocate and load the module: note that size of section 0 is always
zero, and we rely on this for optional sections. */
static struct module *load_module(void __user *umod,
static noinline struct module *load_module(void __user *umod,
unsigned long len,
const char __user *uargs)
{
Expand Down

0 comments on commit 6da4bed

Please sign in to comment.