Messages in this thread | | | Date | Mon, 25 Oct 2010 15:19:52 -0600 | From | Paul Fulghum <> | Subject | Re: [PATCH] n_hdlc fix read and write locking |
| |
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
| |