Re: [GIT, RFC] Killing the Big Kernel Lock II

From: Andi Kleen
Date: Mon Mar 29 2010 - 08:30:38 EST


Arnd Bergmann <arnd@xxxxxxxx> writes:

>> - The seek function in uhci-debug.c probably is still racy.
>
> That function could be removed in favor of using generic_file_ioctl
> and setting i_size to up->size.

Does that lock against read in libfs?

> Also, the race is only between concurrent calls of llseek on
> the same file descriptor, which is undefined anyway.
> The current code also doesn't protect you against partial updates
> of f_pos during ->read() on 32 bit systems (nothing ever does),

That is not what I meant.

> and it even fails to protect against the concurrent llseek race
> because the assignment is done outside of the f_pos update.

I wasn't sure it would protect against parallel reads.

Does it?

> The patch looks correct, but I probably wouldn't bother with the rename,
> and simply drop the BKL in the caller.

I think a rename is better, I take compile errors over subtle
breakage any day.

>>Author: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>>Date: Mon Mar 29 01:15:32 2010 +0200
>>
>> USB-BKL: Remove BKL from usb serial drivers ioctl handlers
>>
>> I audited all the low level serial ioctl handlers and none of them
>> actually need the BKL.
>>
>> To make sure all code is checked change the usb_serial_driver ->ioctl
>> field to ->unlocked_ioctl
>>
>> Note this is still called for now with BKL held because tty drivers
>> don't have a ->unlocked_ioctl from the tty layer in mainline.
>> This could be trivially changed now though.
>>
>> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> The serial_ioctl function is already called without the BKL, depite the
> name. tty_operations->ioctl was converted a long time ago, so I guess this
> patch can be dropped from your series.

Ok.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/