lkml.org 
[lkml]   [2023]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v9 18/25] dept: Apply timeout consideration to wait_for_completion()/complete()
    Date
    Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the
    consideration to wait_for_completion()/complete().

    Signed-off-by: Byungchul Park <max.byungchul.park@gmail.com>
    ---
    include/linux/completion.h | 4 ++--
    kernel/sched/completion.c | 2 +-
    2 files changed, 3 insertions(+), 3 deletions(-)

    diff --git a/include/linux/completion.h b/include/linux/completion.h
    index 32d535a..15eede0 100644
    --- a/include/linux/completion.h
    +++ b/include/linux/completion.h
    @@ -41,9 +41,9 @@ struct completion {
    */
    #define init_completion_map(x, m) init_completion(x)

    -static inline void complete_acquire(struct completion *x)
    +static inline void complete_acquire(struct completion *x, long timeout)
    {
    - sdt_might_sleep_start(&x->dmap);
    + sdt_might_sleep_start_timeout(&x->dmap, timeout);
    }

    static inline void complete_release(struct completion *x)
    diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c
    index d57a5c1..261807f 100644
    --- a/kernel/sched/completion.c
    +++ b/kernel/sched/completion.c
    @@ -100,7 +100,7 @@ void complete_all(struct completion *x)
    {
    might_sleep();

    - complete_acquire(x);
    + complete_acquire(x, timeout);

    raw_spin_lock_irq(&x->wait.lock);
    timeout = do_wait_for_common(x, action, timeout, state);
    --
    1.9.1
    \
     
     \ /
      Last update: 2023-03-27 00:03    [W:4.323 / U:0.380 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site