Re: [PATCH v3 0/6] virtio_balloon: virtio 1 support

2015-04-13 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Apr 01, 2015 at 02:57:35PM +0200, Michael S. Tsirkin wrote: >> Virtio 1.0 doesn't include a modern balloon device. At some point we'll >> likely >> define an incompatible interface with a different ID and different >> semantics. But for now, it's not a big

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-13 Thread Waiman Long
On 04/13/2015 11:09 AM, Peter Zijlstra wrote: On Thu, Apr 09, 2015 at 05:41:44PM -0400, Waiman Long wrote: +__visible void __pv_queue_spin_unlock(struct qspinlock *lock) +{ + struct __qspinlock *l = (void *)lock; + struct pv_node *node; + + if (likely(cmpxchg(&l->locked, _Q_LOC

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-13 Thread Waiman Long
On 04/13/2015 11:08 AM, Peter Zijlstra wrote: On Thu, Apr 09, 2015 at 05:41:44PM -0400, Waiman Long wrote: +static void pv_wait_head(struct qspinlock *lock, struct mcs_spinlock *node) +{ + struct __qspinlock *l = (void *)lock; + struct qspinlock **lp = NULL; + struct pv_node *

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-13 Thread Waiman Long
On 04/13/2015 10:47 AM, Peter Zijlstra wrote: On Thu, Apr 09, 2015 at 05:41:44PM -0400, Waiman Long wrote: +void __init __pv_init_lock_hash(void) +{ + int pv_hash_size = 4 * num_possible_cpus(); + + if (pv_hash_size< (1U<< LFSR_MIN_BITS)) + pv_hash_size = (1U<< LF

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-13 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 05:41:44PM -0400, Waiman Long wrote: > >>+__visible void __pv_queue_spin_unlock(struct qspinlock *lock) > >>+{ > >>+ struct __qspinlock *l = (void *)lock; > >>+ struct pv_node *node; > >>+ > >>+ if (likely(cmpxchg(&l->locked, _Q_LOCKED_VAL, 0) == _Q_LOCKED_VAL)) > >>+

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-13 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 05:41:44PM -0400, Waiman Long wrote: > >>+static void pv_wait_head(struct qspinlock *lock, struct mcs_spinlock *node) > >>+{ > >>+ struct __qspinlock *l = (void *)lock; > >>+ struct qspinlock **lp = NULL; > >>+ struct pv_node *pn = (struct pv_node *)node; > >>+ int

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-13 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 05:41:44PM -0400, Waiman Long wrote: > >>+void __init __pv_init_lock_hash(void) > >>+{ > >>+ int pv_hash_size = 4 * num_possible_cpus(); > >>+ > >>+ if (pv_hash_size< (1U<< LFSR_MIN_BITS)) > >>+ pv_hash_size = (1U<< LFSR_MIN_BITS); > >>+ /* > >>+* Allo

Re: [PATCH 2/2] virtio-balloon: virtio 1 support

2015-04-13 Thread Cornelia Huck
On Mon, 13 Apr 2015 13:26:31 +0200 "Michael S. Tsirkin" wrote: > BTW I suspect the stats code is broken for > cross-endian platforms: it should do LE unconditinally, > should it not? Stats are guest-endian for legacy, so no. Only the config space is always LE. __

Re: [PATCH 2/2] virtio-balloon: virtio 1 support

2015-04-13 Thread Cornelia Huck
On Mon, 13 Apr 2015 13:49:42 +0200 "Michael S. Tsirkin" wrote: > On Mon, Apr 13, 2015 at 01:35:21PM +0200, Cornelia Huck wrote: > > On Mon, 13 Apr 2015 13:26:31 +0200 > > "Michael S. Tsirkin" wrote: > > > > > On Mon, Apr 13, 2015 at 10:02:58AM +0200, Cornelia Huck wrote: > > > > > > Also, does

Re: [PATCH 2/2] virtio-balloon: virtio 1 support

2015-04-13 Thread Michael S. Tsirkin
On Mon, Apr 13, 2015 at 01:35:21PM +0200, Cornelia Huck wrote: > On Mon, 13 Apr 2015 13:26:31 +0200 > "Michael S. Tsirkin" wrote: > > > On Mon, Apr 13, 2015 at 10:02:58AM +0200, Cornelia Huck wrote: > > > > Also, doesn't get_features need to be modified as well so that > > > VERSION_1 is adverti

Re: [PATCH 2/2] virtio-balloon: virtio 1 support

2015-04-13 Thread Cornelia Huck
On Mon, 13 Apr 2015 13:26:31 +0200 "Michael S. Tsirkin" wrote: > On Mon, Apr 13, 2015 at 10:02:58AM +0200, Cornelia Huck wrote: > > Also, doesn't get_features need to be modified as well so that > > VERSION_1 is advertised? > > virtio_pci_device_plugged seems to set it ATM. I'll re-test to conf

Re: [PATCH 2/2] virtio-balloon: virtio 1 support

2015-04-13 Thread Michael S. Tsirkin
On Mon, Apr 13, 2015 at 10:02:58AM +0200, Cornelia Huck wrote: > On Sun, 12 Apr 2015 17:00:48 +0200 > "Michael S. Tsirkin" wrote: > > > Virtio 1.0 doesn't include a modern balloon device. At some point we'll > > likely define an incompatible interface with a different ID and > > different semant

Re: [PATCH 2/2] virtio-balloon: virtio 1 support

2015-04-13 Thread Cornelia Huck
On Sun, 12 Apr 2015 17:00:48 +0200 "Michael S. Tsirkin" wrote: > Virtio 1.0 doesn't include a modern balloon device. At some point we'll > likely define an incompatible interface with a different ID and > different semantics. But for now, it's not a big effort to support a > transitional balloo