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: Santosh Shukla <sshukla at mvista dot com>
- To: Josh Stone <jistone at redhat dot com>
- Cc: systemtap at sourceware dot org, Corey Minyard <cminyard at mvista dot com>
- Date: Mon, 15 Sep 2014 22:05:23 +0530
- 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>
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
>
> That said, we can get away with new interfaces in some cases. e.g. I
> believe stp_utrace.c and task_finder2.c can only be used on 3.x kernels.
> But anything that's more generic, like addr-map.c, will need some kind
> of wrapper or compat #define added to let it work on older kernels too.
> Maybe just #define raw_spin_lock spin_lock, etc.
Above one right? Its coming in v2 soon.
>
>
> Josh