[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100603053803.GA4035@linux.vnet.ibm.com>
Date: Thu, 3 Jun 2010 11:08:03 +0530
From: Srivatsa Vaddagiri <vatsa@...ibm.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Avi Kivity <avi@...hat.com>, Andi Kleen <andi@...stfloor.org>,
Gleb Natapov <gleb@...hat.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, hpa@...or.com, mingo@...e.hu, npiggin@...e.de,
tglx@...utronix.de, mtosatti@...hat.com
Subject: Re: [PATCH] use unfair spinlock when running on hypervisor.
On Thu, Jun 03, 2010 at 06:51:51AM +0200, Eric Dumazet wrote:
> > Guest side:
> >
> > static inline void spin_lock(spinlock_t *lock)
> > {
> > raw_spin_lock(&lock->rlock);
> > + __get_cpu_var(gh_vcpu_ptr)->defer_preempt++;
>
> 1) __this_cpu_inc() should be faster
Ok ..thx for that tip.
> 2) Isnt a bit late to do this increment _after_
> raw_spin_lock(&lock->rlock);
I think so, my worry about doing it earlier is we may set the defer_preempt hint
for the wrong vcpu (if lets say the guest application thread is preempted by
guest kernel and later migrated to another vcpu after it sets the hint and
before it acquires the lock).
- vatsa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists