Re: [PATCH] n_hdlc fix read and write locking

From: Paul Fulghum
Date: Mon Oct 25 2010 - 16:15:57 EST


On 10/25/2010 2:05 PM, Andrew Morton wrote:
> And a signed-off-by:, please.

OK

> It's not a bug afaict, but beware that a copy_to_user() will
> unconditionally flip this task back into TASK_RUNNING state if it takes
> a pagefault. This means that the below schedule() will fall straight
> through. It looks like the code will handle this correctly? If so,
> it's just a little suboptimal.

copy_to_user is only called when data is available to
complete the read and break terminates the loop without
calling schedule().

>> + set_current_state(TASK_RUNNING);
>
> We normally use __set_current_state() here - it saves a few cycles.

I'll change it to __set_current_state() and resubmit.

--
Paul Fulghum
MicroGate Systems, Ltd.
=Customer Driven, by Design=
(800)444-1982
(512)345-7791 (Direct)
(512)343-9046 (Fax)
Central Time Zone (GMT -6h)
www.microgate.com
--
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/