2023-09-23 09:33:15

by Yang Jihong

[permalink] [raw]
Subject: [PATCH 0/4] perf bench messaging: Kill child processes when exit abnormally in process mode

If perf bench messaging in process mode exits abnormally, the forked child
processes does not exit.

The test result is as follows:

# perf bench sched messaging -l 1000000 -g 1 &
[4] 553
# Running 'sched/messaging' benchmark:
# kill -15 533
# ps -ef | grep perf
root 425 371 0 09:11 pts/0 00:00:00 perf bench sched messaging -l 1000000 -g 1
root 426 425 17 09:11 pts/0 00:01:56 perf bench sched messaging -l 1000000 -g 1
root 427 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 428 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 429 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 430 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 431 425 17 09:11 pts/0 00:01:56 perf bench sched messaging -l 1000000 -g 1
root 432 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 433 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 434 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 435 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 436 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 437 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 438 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 439 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 440 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 441 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 442 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 443 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 444 425 17 09:11 pts/0 00:01:54 perf bench sched messaging -l 1000000 -g 1
root 445 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
root 446 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
root 447 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
root 448 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
root 449 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
root 450 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
root 451 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
root 452 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
root 453 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
root 454 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
<SNIP>

Capture signals SIGINT and SIGTERM to kill child processes in signal handler

Yang Jihong (4):
perf bench messaging: Fix coding style issues for sched-messaging
perf bench messaging: Factor out create_worker()
perf bench messaging: Store chlid process pid when creating worker for
process mode
perf bench messaging: Kill child processes when exit abnormally in
process mode

tools/perf/bench/sched-messaging.c | 102 ++++++++++++++++++-----------
1 file changed, 64 insertions(+), 38 deletions(-)

--
2.34.1


2023-09-23 09:33:24

by Yang Jihong

[permalink] [raw]
Subject: [PATCH 3/4] perf bench messaging: Store chlid process pid when creating worker for process mode

To save pid of child processes when creating worker:
1. The messaging worker is changed to `union` type to store thread id and
process pid.
2. Save child process pid in create_process_worker().
3. Rename `pth_tab` as `work_tab`.

Test result:

# perf bench sched messaging
# Running 'sched/messaging' benchmark:
# 20 sender and receiver processes per group
# 10 groups == 400 processes run

Total time: 6.744 [sec]
# perf bench sched messaging -t
# Running 'sched/messaging' benchmark:
# 20 sender and receiver threads per group
# 10 groups == 400 threads run

Total time: 5.788 [sec]

Signed-off-by: Yang Jihong <[email protected]>
---
tools/perf/bench/sched-messaging.c | 47 +++++++++++++++++-------------
1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index ad8596bed77a..04ffaabdd45b 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -55,6 +55,11 @@ struct receiver_context {
int wakefd;
};

+union messaging_worker {
+ pthread_t thread;
+ pid_t pid;
+};
+
static void fdpair(int fds[2])
{
if (use_pipes) {
@@ -139,7 +144,7 @@ static void *receiver(struct receiver_context* ctx)
return NULL;
}

-static void create_thread_worker(pthread_t *thread,
+static void create_thread_worker(union messaging_worker *worker,
void *ctx, void *(*func)(void *))
{
pthread_attr_t attr;
@@ -153,35 +158,37 @@ static void create_thread_worker(pthread_t *thread,
err(EXIT_FAILURE, "pthread_attr_setstacksize");
#endif

- ret = pthread_create(thread, &attr, func, ctx);
+ ret = pthread_create(&worker->thread, &attr, func, ctx);
if (ret != 0)
err(EXIT_FAILURE, "pthread_create failed");

pthread_attr_destroy(&attr);
}

-static void create_process_worker(void *ctx, void *(*func)(void *))
+static void create_process_worker(union messaging_worker *worker,
+ void *ctx, void *(*func)(void *))
{
/* Fork the receiver. */
- pid_t pid = fork();
+ worker->pid = fork();

- if (pid == -1) {
+ if (worker->pid == -1) {
err(EXIT_FAILURE, "fork()");
- } else if (pid == 0) {
+ } else if (worker->pid == 0) {
(*func) (ctx);
exit(0);
}
}

-static void create_worker(pthread_t *thread, void *ctx, void *(*func)(void *))
+static void create_worker(union messaging_worker *worker,
+ void *ctx, void *(*func)(void *))
{
if (!thread_mode)
- return create_process_worker(ctx, func);
+ return create_process_worker(worker, ctx, func);
else
- return create_thread_worker(thread, ctx, func);
+ return create_thread_worker(worker, ctx, func);
}

-static void reap_worker(pthread_t id)
+static void reap_worker(union messaging_worker *worker)
{
int proc_status;
void *thread_status;
@@ -192,12 +199,12 @@ static void reap_worker(pthread_t id)
if (!WIFEXITED(proc_status))
exit(1);
} else {
- pthread_join(id, &thread_status);
+ pthread_join(worker->thread, &thread_status);
}
}

/* One group of senders and receivers */
-static unsigned int group(pthread_t *pth,
+static unsigned int group(union messaging_worker *worker,
unsigned int num_fds,
int ready_out,
int wakefd)
@@ -228,7 +235,7 @@ static unsigned int group(pthread_t *pth,
ctx->ready_out = ready_out;
ctx->wakefd = wakefd;

- create_worker(pth + i, ctx, (void *)receiver);
+ create_worker(worker + i, ctx, (void *)receiver);

snd_ctx->out_fds[i] = fds[1];
if (!thread_mode)
@@ -241,7 +248,7 @@ static unsigned int group(pthread_t *pth,
snd_ctx->wakefd = wakefd;
snd_ctx->num_fds = num_fds;

- create_worker(pth + num_fds + i, snd_ctx, (void *)sender);
+ create_worker(worker + num_fds + i, snd_ctx, (void *)sender);
}

/* Close the fds we have left */
@@ -275,14 +282,14 @@ int bench_sched_messaging(int argc, const char **argv)
unsigned int num_fds = 20;
int readyfds[2], wakefds[2];
char dummy;
- pthread_t *pth_tab;
+ union messaging_worker *worker_tab;
struct sender_context *pos, *n;

argc = parse_options(argc, argv, options,
bench_sched_message_usage, 0);

- pth_tab = malloc(num_fds * 2 * num_groups * sizeof(pthread_t));
- if (!pth_tab)
+ worker_tab = malloc(num_fds * 2 * num_groups * sizeof(union messaging_worker));
+ if (!worker_tab)
err(EXIT_FAILURE, "main:malloc()");

fdpair(readyfds);
@@ -290,7 +297,7 @@ int bench_sched_messaging(int argc, const char **argv)

total_children = 0;
for (i = 0; i < num_groups; i++)
- total_children += group(pth_tab + total_children, num_fds,
+ total_children += group(worker_tab + total_children, num_fds,
readyfds[1], wakefds[0]);

/* Wait for everyone to be ready */
@@ -306,7 +313,7 @@ int bench_sched_messaging(int argc, const char **argv)

/* Reap them all */
for (i = 0; i < total_children; i++)
- reap_worker(pth_tab[i]);
+ reap_worker(worker_tab + i);

gettimeofday(&stop, NULL);

@@ -334,7 +341,7 @@ int bench_sched_messaging(int argc, const char **argv)
break;
}

- free(pth_tab);
+ free(worker_tab);
list_for_each_entry_safe(pos, n, &sender_contexts, list) {
list_del_init(&pos->list);
free(pos);
--
2.34.1

2023-09-23 09:33:40

by Yang Jihong

[permalink] [raw]
Subject: [PATCH 1/4] perf bench messaging: Fix coding style issues for sched-messaging

Fixed several code style issues in sched-messaging:
1. Use one space around "-" and "+" operators.
2. When a long line is broken, the operator is at the end of the line.

Signed-off-by: Yang Jihong <[email protected]>
---
tools/perf/bench/sched-messaging.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index fa1f8f998814..6a33118c8f9b 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -98,7 +98,7 @@ static void *sender(struct sender_context *ctx)

again:
ret = write(ctx->out_fds[j], data + done,
- sizeof(data)-done);
+ sizeof(data) - done);
if (ret < 0)
err(EXIT_FAILURE, "SENDER: write");
done += ret;
@@ -201,8 +201,8 @@ static unsigned int group(pthread_t *pth,
int wakefd)
{
unsigned int i;
- struct sender_context *snd_ctx = malloc(sizeof(struct sender_context)
- + num_fds * sizeof(int));
+ struct sender_context *snd_ctx = malloc(sizeof(struct sender_context) +
+ num_fds * sizeof(int));

if (!snd_ctx)
err(EXIT_FAILURE, "malloc()");
@@ -239,7 +239,7 @@ static unsigned int group(pthread_t *pth,
snd_ctx->wakefd = wakefd;
snd_ctx->num_fds = num_fds;

- pth[num_fds+i] = create_worker(snd_ctx, (void *)sender);
+ pth[num_fds + i] = create_worker(snd_ctx, (void *)sender);
}

/* Close the fds we have left */
@@ -288,7 +288,7 @@ int bench_sched_messaging(int argc, const char **argv)

total_children = 0;
for (i = 0; i < num_groups; i++)
- total_children += group(pth_tab+total_children, num_fds,
+ total_children += group(pth_tab + total_children, num_fds,
readyfds[1], wakefds[0]);

/* Wait for everyone to be ready */
--
2.34.1

2023-09-23 09:33:41

by Yang Jihong

[permalink] [raw]
Subject: [PATCH 4/4] perf bench messaging: Kill child processes when exit abnormally in process mode

When exit abnormally in process mode, customize SIGINT and SIGTERM signal
handler to kill the forked child processes.

Before:

# perf bench sched messaging -l 1000000 -g 1 &
[1] 8519
# # Running 'sched/messaging' benchmark:

# pgrep sched-messaging | wc -l
41
# kill -15 8519
[1]+ Terminated perf bench sched messaging -l 1000000 -g 1
# pgrep sched-messaging | wc -l
40

After:

# perf bench sched messaging -l 1000000 -g 1 &
[1] 8472
# # Running 'sched/messaging' benchmark:

# pgrep sched-messaging | wc -l
41
# kill -15 8472
[1]+ Exit 1 perf bench sched messaging -l 1000000 -g 1
# pgrep sched-messaging | wc -l
0

Signed-off-by: Yang Jihong <[email protected]>
---
tools/perf/bench/sched-messaging.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index 04ffaabdd45b..e2b8938b7dc3 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -36,6 +36,7 @@ static bool use_pipes = false;
static unsigned int nr_loops = 100;
static bool thread_mode = false;
static unsigned int num_groups = 10;
+static unsigned int total_children = 0;
static struct list_head sender_contexts = LIST_HEAD_INIT(sender_contexts);
static struct list_head receiver_contexts = LIST_HEAD_INIT(receiver_contexts);

@@ -60,6 +61,8 @@ union messaging_worker {
pid_t pid;
};

+static union messaging_worker *worker_tab;
+
static void fdpair(int fds[2])
{
if (use_pipes) {
@@ -260,6 +263,17 @@ static unsigned int group(union messaging_worker *worker,
return num_fds * 2;
}

+static void sig_handler(int sig __maybe_unused)
+{
+ unsigned int i;
+
+ /*
+ * When exit abnormally, kill all forked child processes.
+ */
+ for (i = 0; i < total_children; i++)
+ kill(worker_tab[i].pid, SIGKILL);
+}
+
static const struct option options[] = {
OPT_BOOLEAN('p', "pipe", &use_pipes,
"Use pipe() instead of socketpair()"),
@@ -277,12 +291,11 @@ static const char * const bench_sched_message_usage[] = {

int bench_sched_messaging(int argc, const char **argv)
{
- unsigned int i, total_children;
+ unsigned int i;
struct timeval start, stop, diff;
unsigned int num_fds = 20;
int readyfds[2], wakefds[2];
char dummy;
- union messaging_worker *worker_tab;
struct sender_context *pos, *n;

argc = parse_options(argc, argv, options,
@@ -295,7 +308,11 @@ int bench_sched_messaging(int argc, const char **argv)
fdpair(readyfds);
fdpair(wakefds);

- total_children = 0;
+ if (!thread_mode) {
+ signal(SIGINT, sig_handler);
+ signal(SIGTERM, sig_handler);
+ }
+
for (i = 0; i < num_groups; i++)
total_children += group(worker_tab + total_children, num_fds,
readyfds[1], wakefds[0]);
--
2.34.1

2023-09-23 09:33:42

by Yang Jihong

[permalink] [raw]
Subject: [PATCH 2/4] perf bench messaging: Factor out create_worker()

Refactor the create_worker() helper:
1. Modify the return value and use pthread pointer as a parameter to
facilitate value assignment in create_worker().
2. The thread worker creation and process worker creation are abstracted
into independent helpers.

No functional change.

Test result:

# perf bench sched messaging
# Running 'sched/messaging' benchmark:
# 20 sender and receiver processes per group
# 10 groups == 400 processes run

Total time: 6.332 [sec]
# perf bench sched messaging -t
# Running 'sched/messaging' benchmark:
# 20 sender and receiver threads per group
# 10 groups == 400 threads run

Total time: 5.545 [sec]

Signed-off-by: Yang Jihong <[email protected]>
---
tools/perf/bench/sched-messaging.c | 50 ++++++++++++++++--------------
1 file changed, 26 insertions(+), 24 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index 6a33118c8f9b..ad8596bed77a 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -139,30 +139,12 @@ static void *receiver(struct receiver_context* ctx)
return NULL;
}

-static pthread_t create_worker(void *ctx, void *(*func)(void *))
+static void create_thread_worker(pthread_t *thread,
+ void *ctx, void *(*func)(void *))
{
pthread_attr_t attr;
- pthread_t childid;
int ret;

- if (!thread_mode) {
- /* process mode */
- /* Fork the receiver. */
- switch (fork()) {
- case -1:
- err(EXIT_FAILURE, "fork()");
- break;
- case 0:
- (*func) (ctx);
- exit(0);
- break;
- default:
- break;
- }
-
- return (pthread_t)0;
- }
-
if (pthread_attr_init(&attr) != 0)
err(EXIT_FAILURE, "pthread_attr_init:");

@@ -171,12 +153,32 @@ static pthread_t create_worker(void *ctx, void *(*func)(void *))
err(EXIT_FAILURE, "pthread_attr_setstacksize");
#endif

- ret = pthread_create(&childid, &attr, func, ctx);
+ ret = pthread_create(thread, &attr, func, ctx);
if (ret != 0)
err(EXIT_FAILURE, "pthread_create failed");

pthread_attr_destroy(&attr);
- return childid;
+}
+
+static void create_process_worker(void *ctx, void *(*func)(void *))
+{
+ /* Fork the receiver. */
+ pid_t pid = fork();
+
+ if (pid == -1) {
+ err(EXIT_FAILURE, "fork()");
+ } else if (pid == 0) {
+ (*func) (ctx);
+ exit(0);
+ }
+}
+
+static void create_worker(pthread_t *thread, void *ctx, void *(*func)(void *))
+{
+ if (!thread_mode)
+ return create_process_worker(ctx, func);
+ else
+ return create_thread_worker(thread, ctx, func);
}

static void reap_worker(pthread_t id)
@@ -226,7 +228,7 @@ static unsigned int group(pthread_t *pth,
ctx->ready_out = ready_out;
ctx->wakefd = wakefd;

- pth[i] = create_worker(ctx, (void *)receiver);
+ create_worker(pth + i, ctx, (void *)receiver);

snd_ctx->out_fds[i] = fds[1];
if (!thread_mode)
@@ -239,7 +241,7 @@ static unsigned int group(pthread_t *pth,
snd_ctx->wakefd = wakefd;
snd_ctx->num_fds = num_fds;

- pth[num_fds + i] = create_worker(snd_ctx, (void *)sender);
+ create_worker(pth + num_fds + i, snd_ctx, (void *)sender);
}

/* Close the fds we have left */
--
2.34.1

2023-09-25 00:45:44

by Ian Rogers

[permalink] [raw]
Subject: Re: [PATCH 1/4] perf bench messaging: Fix coding style issues for sched-messaging

On Sat, Sep 23, 2023 at 2:32 AM Yang Jihong <[email protected]> wrote:
>
> Fixed several code style issues in sched-messaging:
> 1. Use one space around "-" and "+" operators.
> 2. When a long line is broken, the operator is at the end of the line.
>
> Signed-off-by: Yang Jihong <[email protected]>

Series:
Reviewed-by: Ian Rogers <[email protected]>
I wonder with the SIGTERM improvements whether there should be
improvements to tools/lib/subcmd and then we use that.

Thanks,
Ian

> ---
> tools/perf/bench/sched-messaging.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
> index fa1f8f998814..6a33118c8f9b 100644
> --- a/tools/perf/bench/sched-messaging.c
> +++ b/tools/perf/bench/sched-messaging.c
> @@ -98,7 +98,7 @@ static void *sender(struct sender_context *ctx)
>
> again:
> ret = write(ctx->out_fds[j], data + done,
> - sizeof(data)-done);
> + sizeof(data) - done);
> if (ret < 0)
> err(EXIT_FAILURE, "SENDER: write");
> done += ret;
> @@ -201,8 +201,8 @@ static unsigned int group(pthread_t *pth,
> int wakefd)
> {
> unsigned int i;
> - struct sender_context *snd_ctx = malloc(sizeof(struct sender_context)
> - + num_fds * sizeof(int));
> + struct sender_context *snd_ctx = malloc(sizeof(struct sender_context) +
> + num_fds * sizeof(int));
>
> if (!snd_ctx)
> err(EXIT_FAILURE, "malloc()");
> @@ -239,7 +239,7 @@ static unsigned int group(pthread_t *pth,
> snd_ctx->wakefd = wakefd;
> snd_ctx->num_fds = num_fds;
>
> - pth[num_fds+i] = create_worker(snd_ctx, (void *)sender);
> + pth[num_fds + i] = create_worker(snd_ctx, (void *)sender);
> }
>
> /* Close the fds we have left */
> @@ -288,7 +288,7 @@ int bench_sched_messaging(int argc, const char **argv)
>
> total_children = 0;
> for (i = 0; i < num_groups; i++)
> - total_children += group(pth_tab+total_children, num_fds,
> + total_children += group(pth_tab + total_children, num_fds,
> readyfds[1], wakefds[0]);
>
> /* Wait for everyone to be ready */
> --
> 2.34.1
>

2023-09-28 04:00:05

by Namhyung Kim

[permalink] [raw]
Subject: Re: [PATCH 0/4] perf bench messaging: Kill child processes when exit abnormally in process mode

On Sat, Sep 23, 2023 at 2:32 AM Yang Jihong <[email protected]> wrote:
>
> If perf bench messaging in process mode exits abnormally, the forked child
> processes does not exit.
>
> The test result is as follows:
>
> # perf bench sched messaging -l 1000000 -g 1 &
> [4] 553
> # Running 'sched/messaging' benchmark:
> # kill -15 533
> # ps -ef | grep perf
> root 425 371 0 09:11 pts/0 00:00:00 perf bench sched messaging -l 1000000 -g 1
> root 426 425 17 09:11 pts/0 00:01:56 perf bench sched messaging -l 1000000 -g 1
> root 427 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 428 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 429 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 430 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 431 425 17 09:11 pts/0 00:01:56 perf bench sched messaging -l 1000000 -g 1
> root 432 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 433 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 434 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 435 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 436 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 437 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 438 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 439 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 440 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 441 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 442 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 443 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 444 425 17 09:11 pts/0 00:01:54 perf bench sched messaging -l 1000000 -g 1
> root 445 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1
> root 446 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
> root 447 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
> root 448 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
> root 449 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
> root 450 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
> root 451 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
> root 452 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1
> root 453 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
> root 454 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1
> <SNIP>
>
> Capture signals SIGINT and SIGTERM to kill child processes in signal handler
>
> Yang Jihong (4):
> perf bench messaging: Fix coding style issues for sched-messaging
> perf bench messaging: Factor out create_worker()
> perf bench messaging: Store chlid process pid when creating worker for
> process mode
> perf bench messaging: Kill child processes when exit abnormally in
> process mode

Applied to perf-tools-next, thanks!