From: Joel Fernandes <joel@joelfernandes.org>
To: peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, Aaron Lu <aaron.lwe@gmail.com>,
Aubrey Li <aubrey.li@linux.intel.com>,
Julien Desfossez <jdesfossez@digitalocean.com>,
Kees Cook <keescook@chromium.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Paul Turner <pjt@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Tim Chen <tim.c.chen@intel.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Vineeth Pillai <viremana@linux.microsoft.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>,
fweisbec@gmail.com, kerrnel@google.com,
Phil Auld <pauld@redhat.com>,
Valentin Schneider <valentin.schneider@arm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Chen Yu <yu.c.chen@intel.com>,
Christian Brauner <christian.brauner@ubuntu.com>
Subject: Re: [PATCH RFC 02/12] entry/idle: Add a common function for activites during idle entry/exit
Date: Sun, 16 Aug 2020 22:17:14 -0400 [thread overview]
Message-ID: <20200817021714.GB1492280@google.com> (raw)
In-Reply-To: <20200815081441.GG2674@hirez.programming.kicks-ass.net>
Hello Peter,
On Sat, Aug 15, 2020 at 10:14:41AM +0200, peterz@infradead.org wrote:
> On Fri, Aug 14, 2020 at 11:18:58PM -0400, Joel Fernandes (Google) wrote:
> > Currently only RCU hooks for idle entry/exit are called. In later
> > patches, kernel-entry protection functionality will be added.
> >
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>
> NAK, rcu_idle_enter() is broken where it is now, it needs to be pushed
> in deeper:
>
> http://lkml.kernel.org/r/20200807193017.962482579@infradead.org
Thank you for pointing it out. Not a huge problem, a couple ways I can do it:
1. Move the calls to sched_core_unsafe_{enter,exit}() deeper into the idle loop.
2. Keep the calls to sched_core_unsafe_{enter,exit}() where they are now as
in this patch, but leave out the rcu_idle_{enter,exit}() calls alone so
they can be moved deeper as you mentioned.
#1 is not necessary for these patches to work and might be overkill.
I'll go the #2 route then. Let me know any other ideas you might have.
What I am trying to do here is to handle a case where task is switching to
idle (say it went to sleep) and wakes up later.
usermode -> syscall (kernel mode - so mark unsafe) -> idle (mark safe).
idle -> syscall wakes (kernel mode - so mark unsafe) -> usermode (mark safe).
Thank you,
- Joel
next prev parent reply other threads:[~2020-08-17 2:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-15 3:18 [PATCH RFC 00/12] Core-sched v6+: kernel protection and hotplug fixes Joel Fernandes (Google)
2020-08-15 3:18 ` [PATCH RFC 01/12] irq_work: Add support to detect if work is pending Joel Fernandes (Google)
2020-08-15 8:13 ` peterz
2020-08-17 2:04 ` Joel Fernandes
2020-08-15 3:18 ` [PATCH RFC 02/12] entry/idle: Add a common function for activites during idle entry/exit Joel Fernandes (Google)
2020-08-15 8:14 ` peterz
2020-08-17 2:17 ` Joel Fernandes [this message]
2020-08-15 3:18 ` [PATCH RFC 03/12] arch/x86: Add a new TIF flag for untrusted tasks Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 04/12] kernel/entry: Add support for core-wide protection of kernel-mode Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 05/12] entry/idle: Enter and exit kernel protection during idle entry and exit Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 06/12] entry/kvm: Protect the kernel when entering from guest Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 07/12] bitops: Introduce find_next_or_bit Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 08/12] cpumask: Introduce a new iterator for_each_cpu_wrap_or Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 09/12] sched/coresched: Use for_each_cpu(_wrap)_or for pick_next_task Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 10/12] sched/coresched: Make core_pick_seq per run-queue Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 11/12] sched/coresched: Check for dynamic changes in smt_mask Joel Fernandes (Google)
2020-08-15 3:19 ` [PATCH RFC 12/12] sched/coresched: rq->core should be set only if not previously set Joel Fernandes (Google)
2020-08-19 18:26 ` [PATCH RFC 00/12] Core-sched v6+: kernel protection and hotplug fixes Kees Cook
2020-08-20 1:44 ` Joel Fernandes
2020-08-22 20:22 ` Joel Fernandes
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=20200817021714.GB1492280@google.com \
--to=joel@joelfernandes.org \
--cc=aaron.lwe@gmail.com \
--cc=aubrey.li@linux.intel.com \
--cc=christian.brauner@ubuntu.com \
--cc=fweisbec@gmail.com \
--cc=jdesfossez@digitalocean.com \
--cc=keescook@chromium.org \
--cc=kerrnel@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pauld@redhat.com \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@intel.com \
--cc=tim.c.chen@linux.intel.com \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=viremana@linux.microsoft.com \
--cc=x86@kernel.org \
--cc=yu.c.chen@intel.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.