All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhltc@us.ibm.com>
To: Mike Galbraith <efault@gmx.de>
Cc: gowrishankar <gowrishankar.m@linux.vnet.ibm.com>,
	linux-rt-users@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: 2.6.33.[56]-rt23: howto create repeatable explosion in wakeup_next_waiter()
Date: Wed, 07 Jul 2010 08:05:04 -0700	[thread overview]
Message-ID: <4C3497A0.8030807@us.ibm.com> (raw)
In-Reply-To: <1278513073.10564.12.camel@marge.simson.net>

On 07/07/2010 07:31 AM, Mike Galbraith wrote:
> On Wed, 2010-07-07 at 19:41 +0530, gowrishankar wrote:
>> On Wednesday 07 July 2010 10:16 AM, Mike Galbraith wrote:
>>> Greetings,
>>>
>>> Stress testing, looking to trigger RCU stalls, I've managed to find a
>>> way to repeatably create fireworks.  (got RCU stall, see attached)
>>>
>>> 1. download ltp-full-20100630.  Needs to be this version because of
>>> testcase bustage in earlier versions, and must be built with gcc>   4.3,
>>> else testcases will segfault due to a gcc bug.
>>>
>>>
>> Hi Mike,
>> I have seen this segfault esp with GCC v4.3.4. I am about to post this
>> patch
>> in ltp:
>>
>> Signed-off-by: Gowrishankar<gowrishankar.m@in.ibm.com>
>> ---
>>    testcases/realtime/include/librttest.h |    6 +++---
>>    1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/testcases/realtime/include/librttest.h
>> b/testcases/realtime/include/librttest.h
>> index e526ab4..273de6f 100644
>> --- a/testcases/realtime/include/librttest.h
>> +++ b/testcases/realtime/include/librttest.h
>> @@ -118,9 +118,9 @@ static inline int atomic_add(int i, atomic_t *v)
>>           int __i;
>>           __i = i;
>>           asm volatile(
>> -                       "lock; xaddl %0, %1;"
>> -                       :"=r"(i)
>> -                       :"m"(v->counter), "0"(i));
>> +                       "lock; xaddl %1, %0;"
>> +                       :"=m"(v->counter)
>> +                       :"r"(i), "m" (v->counter));
>>           return i + __i;
>>    #elif defined(__powerpc__)
>>    #define ISYNC_ON_SMP   "\n\tisync\n"
>> --
>>
>> Please let me know if this patch helps.
>
> Yup, all better.

So with this, the "volatile struct" patch isn't necessary?

If so, perhaps we would be better off converting librttest.h to 
implement the atomic functions using the glibc built-ins, ie:

static inline int
atomic_add(atomic_t *addr, int i)
{
	return __sync_add_and_fetch(&addr->val, i);
}

It's more maintainable than inline asm and better tested than a roll 
your own implementation. Oddly, I believe the original was patterned 
after what is in the Linux kernel...

--
Darren



>
> 	-Mike
>


-- 
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team

  reply	other threads:[~2010-07-07 15:05 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07  4:46 2.6.33.[56]-rt23: howto create repeatable explosion in wakeup_next_waiter() Mike Galbraith
2010-07-07  8:03 ` Mike Galbraith
2010-07-07 11:57   ` Thomas Gleixner
2010-07-07 12:50     ` Mike Galbraith
2010-07-07 11:57 ` Thomas Gleixner
2010-07-07 14:03   ` Darren Hart
2010-07-07 14:17     ` Mike Galbraith
2010-07-08 12:05     ` Mike Galbraith
2010-07-08 14:12       ` Darren Hart
2010-07-09  2:11   ` Darren Hart
2010-07-09  4:32     ` Mike Galbraith
     [not found]     ` <4C36CD83.6070809@us.ibm.com>
2010-07-09  8:13       ` Mike Galbraith
2010-07-09 13:58       ` Mike Galbraith
2010-07-09 14:51         ` Mike Galbraith
2010-07-09 16:35         ` Darren Hart
2010-07-09 19:34           ` Mike Galbraith
2010-07-09 20:05   ` Darren Hart
2010-07-13  8:03   ` [PATCH][RT] futex: protect against pi_blocked_on corruption during requeue PI Darren Hart
2010-07-13  9:25     ` Thomas Gleixner
2010-07-13 10:28       ` Thomas Gleixner
2010-07-13 11:52         ` [PATCH][RT] futex: protect against pi_blocked_on corruption during requeue PI -V2 Thomas Gleixner
2010-07-13 15:57           ` Mike Galbraith
2010-07-13 18:59           ` Darren Hart
2010-07-18  8:32           ` Mike Galbraith
2010-07-13  9:58     ` [PATCH][RT] futex: protect against pi_blocked_on corruption during requeue PI Thomas Gleixner
2010-07-07 14:11 ` 2.6.33.[56]-rt23: howto create repeatable explosion in wakeup_next_waiter() gowrishankar
2010-07-07 14:31   ` Mike Galbraith
2010-07-07 15:05     ` Darren Hart [this message]
2010-07-07 17:45       ` Mike Galbraith

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=4C3497A0.8030807@us.ibm.com \
    --to=dvhltc@us.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=efault@gmx.de \
    --cc=gowrishankar.m@linux.vnet.ibm.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.