This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [SYSTEMTAP/PATCH 0/4] RT aware systemtap patch set


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]