Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation

From: Nikita Danilov
Date: Thu Dec 15 2005 - 08:40:04 EST


Andrew Morton writes:
> Mark Lord <lkml@xxxxxx> wrote:
> >
> > Leaving up()/down() as-is is really the most sensible option.
> >
>
> Absolutely.
>
> I must say that my interest in this stuff is down in
> needs-an-electron-microscope-to-locate territory. down() and up() work
> just fine and they're small, efficient, well-debugged and well-understood.
> We need a damn good reason for taking on tree-wide churn or incompatible
> renames or addition of risk. What's the damn good reason here?
>
> Please. Go fix some bugs. We're not short of them.

But this change is about fixing bugs: mutex assumes that

- only owner can unlock, and

- owner cannot lock (immediate self-deadlock).

This can be checked by the debugging code, and yes, these kinds of
errors do happen.

Not to say that by looking at

struct foo_bar_baz {
struct mutex fbb_mutex;
...
};

one can instantly infer that ->fbb_mutex is used to serialize something
rather than serves as some fancy signaling mechanism.

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