Re: [PATCH 01/10] x86 rwsem: minor cleanups

From: David Howells
Date: Wed May 19 2010 - 07:48:32 EST

Michel Lespinasse <walken@xxxxxxxxxx> wrote:

> The only functional change here is that __up_write won't call
> call_rwsem_wake anymore if the new rwsem value is >0. This makes
> no real difference since call_rwsem_wake would have noticed the
> active count being nonzero and done nothing anyway.

Given that you describe this first, this would suggest that the subject of the
patch should be this. I'm not sure I'd count this as a minor cleanup. I think
I'd split it into its own patch.

> Besides that, I clarified a few comments.

Mostly okay, except where you said "expects old value in %edx" - that's only
true on i386, not x86_64. On the latter it would be %rdi. However, I can live
with that: it's true enough.

> - rwsem_count_t tmp;
> + rwsem_count_t tmp = -RWSEM_ACTIVE_WRITE_BIAS;
> ...
> : "+m" (sem->count), "=d" (tmp)
> - : "a" (sem), "1" (-RWSEM_ACTIVE_WRITE_BIAS)
> + : "a" (sem), "1" (tmp)

If you're going to put the initialisation of EDX/RDI on tmp (which isn't really
necessary), rather than directly on the asm statement, you could change the
'"=d" (tmp)' output constraint to be '"+d" (tmp)' and drop the '"1" (tmp)'
constraint entirely.

However, apart from that, feel free to add my Acked-by to this patch or its
split resultant patches.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at