RE: [patch] printk subsystems

Perez-Gonzalez, Inaky (inaky.perez-gonzalez@intel.com)
Mon, 21 Apr 2003 19:49:55 -0700



> From: Tom Zanussi
>
> 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.

So that means you are using cmpxchg to do the locking. I mean, not the
"locking" itself, but a similar process to that of locking. I see.

However, isn't it the almost the same as spinlocking? You are basically
trying to "allocate" a channel idx with atomic cmpxchg; if it fails, you
are retrying, spinning on the retry code until successful.

Not meaning to be an smartass here, but I don't buy the "lockless" tag,
I would agree it is an optimized-lock scheme [assuming it works better
than the spinlock case, that I am sure it does because if not you guys
would have not gone through the process of implementing it], but it is
not lockless.

Although it is not that important, no need to make a fuss out of that :)

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)
-
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/