Re: [patch] 2.6.6-rc2 Allow architectures to reenable interrupts on contended spinlocks

From: Linus Torvalds (torvalds_at_osdl.org)
Date: 04/27/04

  • Next message: Albert Cahalan: "Re: [PATCH] Blacklist binary-only modules lying about their license"
    Date:	Tue, 27 Apr 2004 09:01:17 -0700 (PDT)
    To: Keith Owens <kaos@sgi.com>
    
    

    On Tue, 27 Apr 2004, Keith Owens wrote:
    >
    > This patch consists of an ia64 specific change (David Mosberger is
    > happy with it) and an architecture independent change. The latter has
    > no effect unless the architecture implements this feature and defines
    > __HAVE_ARCH_RAW_SPIN_LOCK_FLAGS. IOW, this change has no effect on
    > anything except ia64, unless the other architecture maintainers want to
    > implement this feature for their architecture.

    Aargh. Ugly ugly. Can you instead _first_ do all the infrastructure, and
    just add the unused "flags" argument to all architectures, ie take this
    part of the patch:

    > Index: 2.6.6-rc2/include/linux/spinlock.h
    > ===================================================================
    > --- 2.6.6-rc2.orig/include/linux/spinlock.h Thu Dec 18 13:58:49 2003
    > +++ 2.6.6-rc2/include/linux/spinlock.h Tue Apr 27 11:48:03 2004
    > @@ -184,6 +184,12 @@
    >
    > #endif /* !SMP */
    >
    > +#ifdef __HAVE_ARCH_RAW_SPIN_LOCK_FLAGS
    > +#define _raw_spin_lock(lock) _raw_spin_lock_flags(lock, 0)
    > +#else
    > +#define _raw_spin_lock_flags(lock, flags) do { (void)flags; _raw_spin_lock(lock); } while(0)
    > +#endif
    > +
    > /*
    > * Define the various spin_lock and rw_lock methods. Note we define these
    > * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various
    > @@ -257,7 +263,7 @@
    > do { \
    > local_irq_save(flags); \
    > preempt_disable(); \
    > - _raw_spin_lock(lock); \
    > + _raw_spin_lock_flags(lock, flags); \
    > } while (0)
    >
    > #define spin_lock_irq(lock) \

    And remove the need for "__HAVE_ARCH_RAW_SPIN_LOCK_FLAGS", and instead
    create a patch where _all_ architectures have that

            _raw_spin_lock_flags()

    define, it's just that they ignore the "flags" value.

    I think the patch makes sense, but I'd rather make the infrastructure
    clean, than have another silly architecture flag.

                    Linus
    -
    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/


  • Next message: Albert Cahalan: "Re: [PATCH] Blacklist binary-only modules lying about their license"

    Relevant Pages

    • Re: [PATCH] generic irq subsystem: ppc64 port
      ... >> I still like the idea of the patch, so it would be useful if you added ... >> architecture can provide it's own. ... > generic IRQ code and just provide a way to switch between 1:1 mapped and ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] CRISv10 improve and bugfix fasttimer
      ... Jesper Nilsson wrote: ... that has gotten out of sync with mainline (although we've continued ... This means that the CRISv10 architecture has gotten broken in mainline, ... I'll submit a later patch that removes this. ...
      (Linux-Kernel)
    • [patch] Real-Time Preemption, -RT-2.6.11-rc2-V0.7.36-04
      ... > you try and use the patchset on an architecture that doesn't work. ... The -04 patch should also fix the down_write_interruptiblerelated ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: boot time node and memory limit options
      ... >> architecture independent patch. ... My patch basically allocates memory ... _after_ the memory layout is discovered. ...
      (Linux-Kernel)
    • Re: [PATCH] ftrace: Allow section alignment
      ... Not that I object to the patch, ... As long as the alignment is less than or equal to ... Unaligned accesses are not supported by our architecture ... if ($arch eq "x86") { ...
      (Linux-Kernel)