Re: R/W semaphore changes

From: Arjan van de Ven
Date: Tue Jul 04 2006 - 08:51:15 EST


On Tue, 2006-07-04 at 13:47 +0100, David Howells wrote:
> I see you've made some R/W semaphore changes...
>
> | /*
> | * nested locking:
> | */
>
> This comment is inadequate. Please be more explicit about when you're allowed
> to do this.
>
> | extern void down_read_nested(struct rw_semaphore *sem, int subclass);
> | extern void down_write_nested(struct rw_semaphore *sem, int subclass);
>
> Please, please, please don't. R/W semaphores are _not_ permitted to nest.

yet they do in places, there where there is a natural hierarchy..

> | # define down_read_nested(sem, subclass) down_read(sem)
> | # define down_write_nested(sem, subclass) down_write(sem)
>
> This is _not_ okay.

why not?



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