Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1198762
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 4/6] ARC: LLOCK/SCOND based rwlock |
| Date | 2015-08-03 13:40 +0200 |
| Message-ID | <pTmg2-1ME-13@gated-at.bofh.it> (permalink) |
| References | <pTkQW-8kh-1@gated-at.bofh.it> <pTkQW-8kh-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Aug 03, 2015 at 03:33:06PM +0530, Vineet Gupta wrote:
> With LLOCK/SCOND, the rwlock counter can be atomically updated w/o need
> for a guarding spin lock.
Maybe re-iterate the exclusive vs shared spin story again.
And aside from the far too many full barriers (again), I was just
wondering about:
> +static inline void arch_write_unlock(arch_rwlock_t *rw)
> +{
> + unsigned int val;
> +
> + smp_mb();
> +
> + /*
> + * rw->counter = __ARCH_RW_LOCK_UNLOCKED__;
> + */
> + __asm__ __volatile__(
> + "1: llock %[val], [%[rwlock]] \n"
> + " scond %[UNLOCKED], [%[rwlock]]\n"
> + " bnz 1b \n"
> + " \n"
> + : [val] "=&r" (val)
> + : [rwlock] "r" (&(rw->counter)),
> + [UNLOCKED] "r" (__ARCH_RW_LOCK_UNLOCKED__)
> + : "memory", "cc");
> +
> + smp_mb();
> +}
Why can't that be a straight store?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] ARC: spinlocks/atomics rework Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 12:10 +0200
[PATCH 4/6] ARC: LLOCK/SCOND based rwlock Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 12:10 +0200
Re: [PATCH 4/6] ARC: LLOCK/SCOND based rwlock Peter Zijlstra <peterz@infradead.org> - 2015-08-03 13:40 +0200
Re: [PATCH 4/6] ARC: LLOCK/SCOND based rwlock Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 14:00 +0200
[PATCH 6/6] ARCv2: spinlock/rwlock: Reset retry delay when starting a new spin-wait cycle Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 12:10 +0200
Re: [PATCH 6/6] ARCv2: spinlock/rwlock: Reset retry delay when starting a new spin-wait cycle Peter Zijlstra <peterz@infradead.org> - 2015-08-03 13:50 +0200
Re: [PATCH 6/6] ARCv2: spinlock/rwlock: Reset retry delay when starting a new spin-wait cycle Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 16:50 +0200
Re: [PATCH 6/6] ARCv2: spinlock/rwlock: Reset retry delay when starting a new spin-wait cycle Peter Zijlstra <peterz@infradead.org> - 2015-08-03 16:50 +0200
[PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 12:10 +0200
Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Peter Zijlstra <peterz@infradead.org> - 2015-08-03 13:50 +0200
Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 15:10 +0200
Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 16:00 +0200
Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Peter Zijlstra <peterz@infradead.org> - 2015-08-03 16:10 +0200
Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Peter Zijlstra <peterz@infradead.org> - 2015-08-03 14:00 +0200
Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Peter Zijlstra <peterz@infradead.org> - 2015-08-03 15:10 +0200
Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of failed SCOND with exponential backoff Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 15:10 +0200
[PATCH 3/6] ARC: LLOCK/SCOND based spin_lock Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 12:10 +0200
Re: [PATCH 3/6] ARC: LLOCK/SCOND based spin_lock Peter Zijlstra <peterz@infradead.org> - 2015-08-03 13:30 +0200
Re: [PATCH 3/6] ARC: LLOCK/SCOND based spin_lock Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 13:50 +0200
[PATCH 1/6] Revert "ARCv2: STAR 9000837815 workaround hardware exclusive transactions livelock" Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 12:10 +0200
[PATCH 2/6] ARC: refactor atomic inline asm operands with symbolic names Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-03 12:10 +0200
csiph-web