Re: [Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-16 Thread Roger Pau Monné
On Mon, Dec 16, 2019 at 12:53:40PM +, Igor Druzhinin wrote: > On 16/12/2019 10:00, Roger Pau Monné wrote: > > On Fri, Dec 13, 2019 at 10:48:02PM +, Igor Druzhinin wrote: > > I'm not sure if the following would be slightly better performance > > wise: > > > > do { > > old = d->arch.vtsc

Re: [Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-16 Thread Roger Pau Monné
On Mon, Dec 16, 2019 at 01:45:10PM +0100, Jan Beulich wrote: > On 16.12.2019 13:30, Roger Pau Monné wrote: > > On Mon, Dec 16, 2019 at 12:21:09PM +0100, Jan Beulich wrote: > >> On 16.12.2019 11:00, Roger Pau Monné wrote: > >>> On Fri, Dec 13, 2019 at 10:48:02PM +, Igor Druzhinin wrote: >

Re: [Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-16 Thread Igor Druzhinin
On 16/12/2019 10:00, Roger Pau Monné wrote: > On Fri, Dec 13, 2019 at 10:48:02PM +, Igor Druzhinin wrote: >> Now that vtsc_last is the only entity protected by vtsc_lock we can >> simply update it using a single atomic operation and drop the spinlock >> entirely. This is extremely important for

Re: [Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-16 Thread Jan Beulich
On 16.12.2019 13:30, Roger Pau Monné wrote: > On Mon, Dec 16, 2019 at 12:21:09PM +0100, Jan Beulich wrote: >> On 16.12.2019 11:00, Roger Pau Monné wrote: >>> On Fri, Dec 13, 2019 at 10:48:02PM +, Igor Druzhinin wrote: Now that vtsc_last is the only entity protected by vtsc_lock we can

Re: [Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-16 Thread Roger Pau Monné
On Mon, Dec 16, 2019 at 12:21:09PM +0100, Jan Beulich wrote: > On 16.12.2019 11:00, Roger Pau Monné wrote: > > On Fri, Dec 13, 2019 at 10:48:02PM +, Igor Druzhinin wrote: > >> Now that vtsc_last is the only entity protected by vtsc_lock we can > >> simply update it using a single atomic operati

Re: [Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-16 Thread Jan Beulich
On 16.12.2019 11:00, Roger Pau Monné wrote: > On Fri, Dec 13, 2019 at 10:48:02PM +, Igor Druzhinin wrote: >> Now that vtsc_last is the only entity protected by vtsc_lock we can >> simply update it using a single atomic operation and drop the spinlock >> entirely. This is extremely important for

Re: [Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-16 Thread Roger Pau Monné
On Fri, Dec 13, 2019 at 10:48:02PM +, Igor Druzhinin wrote: > Now that vtsc_last is the only entity protected by vtsc_lock we can > simply update it using a single atomic operation and drop the spinlock > entirely. This is extremely important for the case of running nested > (e.g. shim instance

[Xen-devel] [PATCH 2/2] x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

2019-12-13 Thread Igor Druzhinin
Now that vtsc_last is the only entity protected by vtsc_lock we can simply update it using a single atomic operation and drop the spinlock entirely. This is extremely important for the case of running nested (e.g. shim instance with lots of vCPUs assigned) since if preemption happens somewhere insi