This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [SYSTEMTAP/PATCH 0/4] RT aware systemtap patch set
- From: Josh Stone <jistone at redhat dot com>
- To: Santosh Shukla <sshukla at mvista dot com>
- Cc: systemtap at sourceware dot org, Corey Minyard <cminyard at mvista dot com>
- Date: Mon, 15 Sep 2014 09:45:42 -0700
- Subject: Re: [SYSTEMTAP/PATCH 0/4] RT aware systemtap patch set
- Authentication-results: sourceware.org; auth=none
- References: <1410246499-6938-1-git-send-email-sshukla at mvista dot com> <CAAyOgsYpSz3MFe7gOVFjorN=gYuu_2tLf5DAG0dUwhJGx7r2qw at mail dot gmail dot com> <5416F410 dot 7090009 at redhat dot com> <CAAyOgsaVorsyDhAMdsfOQ1tR0H5m-ceM6Hz2T530SkzEty9Bhg at mail dot gmail dot com> <54171259 dot 6050009 at redhat dot com> <CAAyOgsb97yci-hoQ06jDiCvG1TuRiqP2Xo67k_inap19L-tXNQ at mail dot gmail dot com>
On 09/15/2014 09:35 AM, Santosh Shukla wrote:
> On Mon, Sep 15, 2014 at 9:52 PM, Josh Stone <jistone@redhat.com> wrote:
>> Hi,
>>
>> On 09/15/2014 08:41 AM, Santosh Shukla wrote:
>>> first wanted to get raw_locking specific to get into stap.
>>
>> One ugly aspect of this is that we try to maintain compatibility with
>> older platforms too. It looks like raw_spin_lock didn't come into the
>> kernel until 2.6.33, which doesn't even cover RHEL6. If possible we try
>> to keep things running all the way back to RHEL4 (though see my earlier
>> RFC about dropping that).
>
> Right, I did saw your early RFC and noticed few important stuff
> missing so to keep compatibility per se .i..e.. some type of locking
> function helper api which could ably switch between PREEMPT and
> non-PREEMPT kernel.
>
>
> In v2 version which I am working on [inspired by Corey suggestion] to
> add below type of locking facility, pseudo code look like below
>
> #ifdef CONFIG_PREEMPT_RT
> static inline my_readlock(raw_spinlock_t *lock) { raw_spin_lock(&lock); }
> static inline my_readunlock(raw_spinlock_t *lock) {
> raw_spin_unlock(&lock); }
> static inline my_writelock(raw_spinlock_t *lock) { raw_spin_lock(&lock); }
> static inline my_writeunlock(raw_spinlock_t *lock) {
> raw_spin_unlock(&lock); }
> #else
> static inline my_readlock(rwlock_t *lock) {read_lock(&lock); }
> static inline my_readunlock(rwlock_t *lock) {read_unlock(&lock); }
> static inline my_writelock(rwlock_t *lock) { write_lock(&lock); }
> static inline my_writeunlock(rwlock_t *lock) {write_unlock(&lock); }
> #endif
Ok, if the raw interfaces have always existed with PREEMPT_RT, then this
should be fine.
I suggest "stp_" rather than "my_" though. </bikeshed>