lkml.org 
[lkml]   [2012]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 15/25] x86/mce: don't use [delayed_]work_pending()
    Date
    There's no need to test whether a (delayed) work item in pending
    before queueing, flushing or cancelling it. Most uses are unnecessary
    and quite a few of them are buggy.

    Remove unnecessary pending tests from x86/mce. Only compile tested.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: linux-edac@vger.kernel.org
    ---
    Please let me know how this patch should be routed. I can take it
    through the workqueue tree if necessary.

    Thanks.

    arch/x86/kernel/cpu/mcheck/mce.c | 10 ++--------
    1 file changed, 2 insertions(+), 8 deletions(-)

    diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
    index 80dbda8..c06a736 100644
    --- a/arch/x86/kernel/cpu/mcheck/mce.c
    +++ b/arch/x86/kernel/cpu/mcheck/mce.c
    @@ -514,8 +514,7 @@ static void mce_schedule_work(void)
    {
    if (!mce_ring_empty()) {
    struct work_struct *work = &__get_cpu_var(mce_work);
    - if (!work_pending(work))
    - schedule_work(work);
    + schedule_work(work);
    }
    }

    @@ -1351,12 +1350,7 @@ int mce_notify_irq(void)
    /* wake processes polling /dev/mcelog */
    wake_up_interruptible(&mce_chrdev_wait);

    - /*
    - * There is no risk of missing notifications because
    - * work_pending is always cleared before the function is
    - * executed.
    - */
    - if (mce_helper[0] && !work_pending(&mce_trigger_work))
    + if (mce_helper[0])
    schedule_work(&mce_trigger_work);

    if (__ratelimit(&ratelimit))
    --
    1.8.0.2


    \
     
     \ /
      Last update: 2012-12-22 04:21    [W:4.344 / U:0.416 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site