From: Michael Trimarchi <trimarchimichael@yahoo.it>
To: linux-sh@vger.kernel.org
Subject: Re: [RFC PATCH V2 FIX] Fix deadlock during find
Date: Wed, 26 Nov 2008 13:04:28 +0000 [thread overview]
Message-ID: <375040.72760.qm@web23502.mail.ird.yahoo.com> (raw)
In-Reply-To: <20081120134502.GA27286@gandalf.sssup.it>
Hi,
----- Messaggio originale -----
> Da: Paul Mundt <lethal@linux-sh.org>
> A: Michael Trimarchi <trimarchimichael@yahoo.it>
> Cc: linux-sh@vger.kernel.org
> Inviato: Martedì 25 novembre 2008, 18:06:03
> Oggetto: Re: [RFC PATCH V2 FIX] Fix deadlock during find
>
> On Thu, Nov 20, 2008 at 02:45:02PM +0100, Michael Trimarchi wrote:
> > Fix a deadlock during find.
> >
> > Continue with testing i find and errata implementation in the unlock.
> > This patch fix the deadlock.
> >
> > Signed-off-by: Michael Trimarchi
> >
> > ---
> > arch/sh/include/asm/mutex_sh.h | 12 ++++++------
> > 1 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/sh/include/asm/mutex_sh.h b/arch/sh/include/asm/mutex_sh.h
> > index c98e875..c65f19e 100644
> > --- a/arch/sh/include/asm/mutex_sh.h
> > +++ b/arch/sh/include/asm/mutex_sh.h
> > @@ -48,18 +48,18 @@ __mutex_fastpath_lock_retval(atomic_t *count, int
> (*fail_fn)(atomic_t *))
> > static inline void
> > __mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
> > {
> > - int __res, __orig;
> > + int __res;
> >
> > __asm__ __volatile__ (
> > - "movli.l @%2, %0 \n\t"
> > - "mov %0, %1 \n\t"
> > + "1: movli.l @%1, %0 \n\t"
> > "add #1, %0 \n\t"
> > - "movco.l %0, @%2 "
> > - : "=&z" (__res), "=&r" (__orig)
> > + "movco.l %0, @%1 \n\t"
> > + "bf 1b\n\t"
> > + : "=&z" (__res)
> > : "r" (&(count)->counter)
> > : "t" );
> >
> > - if (unlikely(__orig != 0))
> > + if (unlikely(__res <= 0))
> > fail_fn(count);
> > }
> >
>
> Making __mutex_fastpath_unlock() loop seems counter-intuitive. I think
> the initial test on __orig is what was causing you issues rather than the
> need for looping. I do see why ARM did it this way, but we don't have
> precisely the same semantics there.
>
> Does the following patch against current git pass your test cases?
>
This is an old one patch. You integrate the correct one V3
Regards MIchael
next prev parent reply other threads:[~2008-11-26 13:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-20 13:45 [RFC PATCH V2 FIX] Fix deadlock during find Michael Trimarchi
2008-11-25 17:06 ` Paul Mundt
2008-11-26 13:04 ` Michael Trimarchi [this message]
2008-12-06 13:01 ` Paul Mundt
2008-12-06 14:16 ` Michael Trimarchi
2008-12-06 14:17 ` Michael Trimarchi
2008-12-06 14:17 ` Michael Trimarchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=375040.72760.qm@web23502.mail.ird.yahoo.com \
--to=trimarchimichael@yahoo.it \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox