public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: wufengguang@huawei.com, linux-kernel@vger.kernel.org
Cc: Hui Zhu <teawater@antgroup.com>
Subject: [PATCH for vm-scalability] usemem.c: do_units: Add output before sigsuspend
Date: Mon, 30 May 2022 17:30:36 +0800	[thread overview]
Message-ID: <20220530093036.6926-1-teawater@gmail.com> (raw)

From: Hui Zhu <teawater@antgroup.com>

It is hard to make sure that the process is waiting for the signal
without any output.
This commit add output before sigsuspend in do_units to handle this
issue.

Signed-off-by: Hui Zhu <teawater@antgroup.com>
---
 usemem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usemem.c b/usemem.c
index 3b4d207..2f100e1 100644
--- a/usemem.c
+++ b/usemem.c
@@ -800,6 +800,8 @@ long do_units(void)
 
 	if (opt_write_signal_read) {
 		sigset_t set;
+		printf("Process %d is waiting signal\n", getpid());
+		fflush(stdout);
 		sigfillset(&set);
 		sigdelset(&set, SIGUSR1);
 		sigsuspend(&set);
-- 
1.8.3.1


                 reply	other threads:[~2022-05-30  9:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220530093036.6926-1-teawater@gmail.com \
    --to=teawater@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=teawater@antgroup.com \
    --cc=wufengguang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox