• Dean Luick's avatar
    IB/mad: Ensure fairness in ib_mad_completion_handler · 0d6ed314
    Dean Luick authored
    It was found that when a process was rapidly sending MADs other processes could
    be hung in their unregister calls.
    
    This would happen when process A was injecting packets fast enough that the
    single threaded workqueue was never exiting ib_mad_completion_handler.
    Therefore when process B called flush_workqueue via the unregister call it
    would hang until process A stopped sending MADs.
    
    The fix is to periodically reschedule ib_mad_completion_handler after
    processing a large number of completions.  The number of completions chosen was
    decided based on the defaults for the recv queue size.  However, it was kept
    fixed such that increasing those queue sizes would not adversely affect
    fairness in the future.
    Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
    Signed-off-by: default avatarDean Luick <dean.luick@intel.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    0d6ed314
mad.c 95.3 KB