lkml.org 
[lkml]   [2010]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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


    \
     
     \ /
      Last update: 2010-10-25 22:19    [W:0.020 / U:2.576 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site