• J
    SUNRPC: have svc_recv() check kthread_should_stop() · 7086721f
    Jeff Layton 提交于
    When using kthreads that call into svc_recv, we want to make sure that
    they do not block there for a long time when we're trying to take down
    the kthread.
    
    This patch changes svc_recv() to check kthread_should_stop() at the same
    places that it checks to see if it's signalled(). Also check just before
    svc_recv() tries to schedule(). By making sure that we check it just
    after setting the task state we can avoid having to use any locking or
    signalling to ensure it doesn't block for a long time.
    
    There's still a chance of a 500ms sleep if alloc_page() fails, but
    that should be a rare occurrence and isn't a terribly long time in
    the context of a kthread being taken down.
    Signed-off-by: NJeff Layton <jlayton@redhat.com>
    Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
    7086721f
svc_xprt.c 28.7 KB