All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: Yejune Deng <yejune.deng@gmail.com>,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, Yejune Deng <yejunedeng@gmail.com>
Subject: Re: [PATCH v2] lib/smp_processor_id: Use is_percpu_thread() check affinity
Date: Mon, 10 May 2021 15:36:50 +0100	[thread overview]
Message-ID: <87mtt2irjx.mognet@arm.com> (raw)
In-Reply-To: <1620654238-1410-1-git-send-email-yejunedeng@gmail.com>

On 10/05/21 21:43, Yejune Deng wrote:
> Use is_percpu_thread() instead of 'current->nr_cpus_allowed == 1',
> and add PF_NO_SETAFFINITY flag in init_idle().This would be nice to
> the sched_setaffinity(), and it also more readable.
>
> v1->v2:
>   - add PF_NO_SETAFFINITY flag in init_idle().
>
> Signed-off-by: Yejune Deng <yejunedeng@gmail.com>
> ---
>  kernel/sched/core.c    | 2 +-
>  lib/smp_processor_id.c | 6 +-----
>  2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 9143163..82e21ea 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -7446,7 +7446,7 @@ void init_idle(struct task_struct *idle, int cpu)
>
>       idle->state = TASK_RUNNING;
>       idle->se.exec_start = sched_clock();
> -	idle->flags |= PF_IDLE;
> +	idle->flags |= PF_IDLE | PF_NO_SETAFFINITY;

Thanks for spinning a v2!

Peter reminded me that it's not the only flag the idle task is missing, so
I went and wrote something to make the idle task really look like a run of
the mill pcpu kthread. I'll bundle your v1 with it.

      reply	other threads:[~2021-05-10 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  7:25 [PATCH] lib/smp_processor_id: Use is_percpu_thread() instead of nr_cpus_allowed Yejune Deng
2021-05-10 10:54 ` Valentin Schneider
2021-05-10 13:43   ` [PATCH v2] lib/smp_processor_id: Use is_percpu_thread() check affinity Yejune Deng
2021-05-10 14:36     ` Valentin Schneider [this message]

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=87mtt2irjx.mognet@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=yejune.deng@gmail.com \
    --cc=yejunedeng@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.