lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0i=+jXz71DBx=Hr9_6bxOx7yFF_xZJc4tXB0j4kSW0Q_g@mail.gmail.com>
Date:   Tue, 23 Aug 2022 19:32:33 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Oleg Nesterov <oleg@...hat.com>,
        Ingo Molnar <mingo@...nel.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mel Gorman <mgorman@...e.de>,
        Eric Biederman <ebiederm@...ssion.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Will Deacon <will@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Tejun Heo <tj@...nel.org>, Linux PM <linux-pm@...r.kernel.org>
Subject: Re: [PATCH v3 4/6] sched/completion: Add wait_for_completion_state()

On Mon, Aug 22, 2022 at 1:48 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> Allows waiting with a custom @state.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
>  include/linux/completion.h |    1 +
>  kernel/sched/completion.c  |    9 +++++++++
>  2 files changed, 10 insertions(+)
>
> --- a/include/linux/completion.h
> +++ b/include/linux/completion.h
> @@ -103,6 +103,7 @@ extern void wait_for_completion(struct c
>  extern void wait_for_completion_io(struct completion *);
>  extern int wait_for_completion_interruptible(struct completion *x);
>  extern int wait_for_completion_killable(struct completion *x);
> +extern int wait_for_completion_state(struct completion *x, unsigned int state);
>  extern unsigned long wait_for_completion_timeout(struct completion *x,
>                                                    unsigned long timeout);
>  extern unsigned long wait_for_completion_io_timeout(struct completion *x,
> --- a/kernel/sched/completion.c
> +++ b/kernel/sched/completion.c
> @@ -247,6 +247,15 @@ int __sched wait_for_completion_killable
>  }
>  EXPORT_SYMBOL(wait_for_completion_killable);
>
> +int __sched wait_for_completion_state(struct completion *x, unsigned int state)
> +{
> +       long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, state);
> +       if (t == -ERESTARTSYS)
> +               return t;
> +       return 0;
> +}
> +EXPORT_SYMBOL(wait_for_completion_state);

Why not EXPORT_SYMBOL_GPL?  I guess to match the above?

> +
>  /**
>   * wait_for_completion_killable_timeout: - waits for completion of a task (w/(to,killable))
>   * @x:  holds the state of this particular completion
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ