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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM9d7chTQG0QxntYArWdAOz1aCqyaxZecYszo2YTgS1yVC2NdA@mail.gmail.com>
Date:   Fri, 6 Aug 2021 19:56:12 -0700
From:   Namhyung Kim <namhyung@...nel.org>
To:     Riccardo Mancini <rickyman7@...il.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Jiri Olsa <jolsa@...hat.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-perf-users <linux-perf-users@...r.kernel.org>,
        Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>
Subject: Re: [RFC PATCH v2 04/10] perf workqueue: add threadpool execute and
 wait functions

On Fri, Jul 30, 2021 at 8:34 AM Riccardo Mancini <rickyman7@...il.com> wrote:
>
> This patch adds:
>  - threadpool__execute: assigns a task to the threads to execute
>    asynchronously.
>  - threadpool__wait: waits for the task to complete on all threads.
> Furthermore, testing for these new functions is added.
>
> This patch completes the threadpool.
>
> Signed-off-by: Riccardo Mancini <rickyman7@...il.com>
> ---

[SNIP]
> +/**
> + * threadpool__wake_thread - send wake msg to @thread
> + *
> + * This function does not wait for the thread to actually wake
> + * NB: call only from main thread!
> + */
> +static int threadpool__wake_thread(struct threadpool_entry *thread)

Same here.  You can pass pool and idx instead.

Thanks,
Namhyung


> +{
> +       int res;
> +       enum threadpool_msg msg = THREADPOOL_MSG__WAKE;
> +
> +       res = writen(thread->pipes.cmd[1], &msg, sizeof(msg));
> +       if (res < 0) {
> +               pr_debug2("threadpool: error sending wake msg: %s\n", strerror(errno));
> +               return -THREADPOOL_ERROR__WRITEPIPE;
> +       }
> +
> +       pr_debug2("threadpool: sent wake msg %s to tid=%d\n",
> +               threadpool_msg_tags[msg], thread->tid);
> +       return 0;
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ