lkml.org 
[lkml]   [2004]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][RFC] Spinlock-timeout
From
Date

> Here's a revision to the patch that uses a HAVE_ARCH_GET_TB to allow
> archs use their timebases if they have one, and if they don't, it uses
> jiffies. time_after_eq() is used to do the jiffy checking.
>
> I also left all of the arch/*/Kconfig changes in until a debug Kconfig
> is done. I pretty much added in the spinlock timeout on all archs that
> have CONFIG_DEBUG_SPINLOCK. If I missed your arch, I'm sorry.

Nah, that's not how the abstraction should be done. Much simpler in
fact. Just do something like this in the generic code:

#ifndef ARCH_HAS_SPINLOCK_TIMEOUT
#define get_spinlock_timeout() (jiffies + (SPINLOCK_TIMEOUT * HZ))
#define check_spinlock_timeout(timeout) (time_after_eq(jiffies, timeout))
#endif

That's all. Then, any arch who has it's own implementation of these 2
function will #define ARCH_HAS_SPINLOCK_TIMEOUT and implement them the
way it wants. We shouldn't let anything like get_tb() slip into a common
file, it's totally PPC specific. Other archs may have different counters
they can use to impement the same thing. That part should be entirely
self contained in asm-xxx

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.083 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site