Linux-rt-users archive on lore.kernel.org
 help / color / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Yunfeng Ye <yeyunfeng@huawei.com>
Cc: williams@redhat.com, linux-rt-users@vger.kernel.org,
	Shiyuan Hu <hushiyuan@huawei.com>,
	Hewenliang <hewenliang4@huawei.com>
Subject: Re: [PATCH] rt-tests: cyclictest: try not to share the same cpu with main thread
Date: Wed, 1 Jul 2020 12:24:27 -0400 (EDT)
Message-ID: <alpine.LFD.2.21.2007011145320.7008@planxty> (raw)
In-Reply-To: <60c13be0-76ad-5d95-f8d5-124cb13d0561@huawei.com>

<

On Sat, 20 Jun 2020, Yunfeng Ye wrote:

> The main thread will interfere with the test thread and try not to share
> the same CPU with the main thread when the number of thread is less than
> max_cpus.
> 
> Signed-off-by: yeyunfeng <yeyunfeng@huawei.com>
> ---
>  src/cyclictest/cyclictest.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 989113fb3483..b3d72caa10ce 100644
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -1080,7 +1080,8 @@ static int cpu_for_thread_sp(int thread_num, int max_cpus)
>  		fatal("No allowable cpus to run on\n");
>  	}
> 
> -	m = thread_num % num_cpus;
> +	/* just don't try to share the same cpu with main thread */
> +	m = (thread_num + 1) % num_cpus;
> 
>  	/* there are num_cpus bits set, we want position of m'th one */
>  	for (i = 0, cpu = 0; i < max_cpus; i++) {
> -- 
> 1.8.3.1
> 
> 
I'm not sure about this one. It would work, but the purpose of the test is 
to make sure we get good real-time results despite the other threads. Plus 
we have done it this way for so long, and tools might expect things to 
work this way. I'm inclined not to take this, even though your idea is 
correct, although note that you didn't apply it everywhere it would be 
needed.

Thanks

John

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20  1:48 Yunfeng Ye
2020-07-01 16:24 ` John Kacur [this message]
2020-07-02  1:45   ` Yunfeng Ye

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=alpine.LFD.2.21.2007011145320.7008@planxty \
    --to=jkacur@redhat.com \
    --cc=hewenliang4@huawei.com \
    --cc=hushiyuan@huawei.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    --cc=yeyunfeng@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

Linux-rt-users archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git