[PATCH 1/1] stp: rt: replace spin_lock with stp style lock and use STP_ALLOC_FLAGS

David Smith dsmith@redhat.com
Wed Oct 28 17:09:00 GMT 2015


On 10/27/2015 09:30 PM, yzhu1 wrote:
> On 10/27/2015 05:28 AM, David Smith wrote:
>> On 10/25/2015 10:19 PM, yzhu1 wrote:
>>> Hi, David
>>>
>>> I do not have this backtrace. Because STP_ALLOC_SLEEP_FLAGS will cause
>>> kmalloc sleep,
>>> so I replaced it with STP_ALLOC_FLAGS.
>> Evidently I'm not explaining myself well, I'll try again in more detail.
>>
>> We've got 2 sets of allocation flags in systemtap:
>>
>> STP_ALLOC_FLAGS: These are the default flags and allocations using this
>> set of flags will not sleep.
>>
>> STP_ALLOC_SLEEP_FLAGS: These flags are only supposed to be used from
>> contexts where it is safe to sleep (like begin probes).
>>
>> Here's the big question - on the realtime kernel, is it ever safe to
>> sleep?
>>
>> If the answer to the previous question is "no", then your change is
>> correct.
>>
>> If the answer to the previous question is "yes", then your change isn't
>> correct. Instead, we need to look at uses of STP_ALLOC_SLEEP_FLAGS,
>> because we're using the wrong set of flags somewhere. We're using
>> STP_ALLOC_SLEEP_FLAGS in an allocation that should be using
>> STP_ALLOC_FLAGS.
>>
>> I see 6 uses of STP_ALLOC_SLEEP_FLAGS in the systemtap source. If we
>> can't get a backtrace, then I'll need you to change the 6 uses of
>> STP_ALLOC_SLEEP_FLAGS to STP_ALLOC_FLAGS one at a time to figure out
>> which use of STP_ALLOC_SLEEP_FLAGS isn't correct.
>>
>> Thanks for continuing to work this problem.
> Hi, All
> 
> OK. I will do.

I had an idea which might help. I've attached a patch that adds a call
to 'might_sleep()' to all the functions that use STP_ALLOC_SLEEP_FLAGS.
Hopefully that might help point out where the problem lies.

Please give it a try.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: might_sleep.patch
Type: text/x-patch
Size: 2077 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20151028/0c84d425/attachment.bin>


More information about the Systemtap mailing list