RE: [patch] printk subsystems

Tom Zanussi (zanussi@us.ibm.com)
Thu, 17 Apr 2003 16:37:25 -0500


Hi,

Perez-Gonzalez, Inaky writes:
> >
> > relayfs is there to solve the data transfer problems for the most
> > demanding of applications. Sending a few messages here and there
> > isn't really a problem. Sending messages/events/what-you-want-to-call-it
> > by the thousand every second, while using as little locking as possible
> > (lockless-logging is implemented in the case of relayfs' buffer handling
> > routines), and providing per-cpu buffering requires a different beast.
>
> Well, you are doing an IRQ lock (relay_lock_channel()), so it is not
> lockless. Or am I missing anything here? Please let me know, I am
> really interested on how to reduce locking in for logging to the
> minimal.

relayfs actually uses 2 mutually-exclusive schemes internally -
'lockless' and 'locking', depending on the availability of a cmpxchg
instruction (lockless needs cmpxchg). If the lockless scheme is being
used, relay_lock_channel() does no locking or irq disabling of any
kind i.e. it's basically a no-op in that case. It's only when the
'locking' scheme is in use that relay_lock_channel() does locking/irq
disabling. Normally the lockless scheme would be in use - the locking
scheme is there mainly as a fallback, so normally relay_lock_channel()
would indeed cause no locking.

-- 
Regards,

Tom Zanussi <zanussi@us.ibm.com> IBM Linux Technology Center/RAS

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