[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150803130652.GO25159@twins.programming.kicks-ass.net>
Date: Mon, 3 Aug 2015 15:06:52 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Vineet Gupta <Vineet.Gupta1@...opsys.com>
Cc: lkml <linux-kernel@...r.kernel.org>,
"arc-linux-dev@...opsys.com" <arc-linux-dev@...opsys.com>
Subject: Re: [PATCH 5/6] ARCv2: spinlock/rwlock/atomics: Delayed retry of
failed SCOND with exponential backoff
On Mon, Aug 03, 2015 at 01:02:09PM +0000, Vineet Gupta wrote:
> On Monday 03 August 2015 05:21 PM, Peter Zijlstra wrote:
>
> On Mon, Aug 03, 2015 at 03:33:07PM +0530, Vineet Gupta wrote:
>
>
> > +#define SCOND_FAIL_RETRY_ASM \
> > + " bz 4f \n" \
> > + " ; --- scond fail delay --- \n" \
> > + " mov %[tmp], %[delay] \n" /* tmp = delay */ \
> > + "2: brne.d %[tmp], 0, 2b \n" /* while (tmp != 0) */ \
> > + " sub %[tmp], %[tmp], 1 \n" /* tmp-- */ \
> > + " asl %[delay], %[delay], 1 \n" /* delay *= 2 */ \
> > + " b 1b \n" /* start over */ \
> > + "4: ; --- success --- \n" \
>
>
> One more note, you might want a test to handle the case where delay *= 2
> overflows and results in a 0.
>
>
> yeah !
>
> - asl %[delay], %[delay], 1
> + asl.f %[delay], %[delay], 1
> + mov.z %[delay], 1
The other obvious option is: 0x80000000 :-)
--
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