[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877duyoaw1.fsf@nanos.tec.linutronix.de>
Date: Mon, 20 Jul 2020 10:20:46 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Joel Fernandes <joel@...lfernandes.org>
Cc: Vineeth Remanan Pillai <vpillai@...italocean.com>,
Nishanth Aravamudan <naravamudan@...italocean.com>,
Julien Desfossez <jdesfossez@...italocean.com>,
Peter Zijlstra <peterz@...radead.org>,
Tim Chen <tim.c.chen@...ux.intel.com>, mingo@...nel.org,
pjt@...gle.com, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, subhra.mazumdar@...cle.com,
fweisbec@...il.com, keescook@...omium.org, kerrnel@...gle.com,
Phil Auld <pauld@...hat.com>, Aaron Lu <aaron.lwe@...il.com>,
Aubrey Li <aubrey.intel@...il.com>,
Valentin Schneider <valentin.schneider@....com>,
Mel Gorman <mgorman@...hsingularity.net>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Paolo Bonzini <pbonzini@...hat.com>, vineethrp@...il.com,
Chen Yu <yu.c.chen@...el.com>,
Christian Brauner <christian.brauner@...ntu.com>,
Aubrey Li <aubrey.li@...ux.intel.com>,
Tim Chen <tim.c.chen@...el.com>,
"Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [RFC PATCH 14/16] irq: Add support for core-wide protection of IRQ and softirq
Joel,
Joel Fernandes <joel@...lfernandes.org> writes:
> On Sat, Jul 18, 2020 at 01:36:16AM +0200, Thomas Gleixner wrote:
>>
>> The entry case condition wants to have a TIF bit as well, i.e.
>>
>> if (thread_test_bit(TIF_CORE_SCHED_REQUIRED) {
>> sched_ipi_dance() {
>> if (other_sibling_in_user_or_guest())
>> send_IPI();
>> }
>> }
>
> I did not understand this bit. Could you explain more about it? Are you
> talking about the IPIs sent from the schedule() loop in this series?
Nah, let me try again. If two tasks are out in user space (or guest
mode) and they fall under the isolation rule that they either are both
in user space or both in the kernel then you tag both with
TIF_CORE_SCHED_REQUIRED or whatever bit is appropriate.
So in entry from user you do:
if (thread_test_bit(TIF_CORE_SCHED_REQUIRED))
sched_orchestrate_entry();
void sched_orchestrate_entry(void)
{
if (other_sibling_in_user_or_guest())
send_IPI_to_sibling();
}
That IPI brings the sibling out of user or guest mode.
On the way back to user/guest you do:
if (thread_test_bit(TIF_CORE_SCHED_REQUIRED))
sched_orchestrate_exit();
void sched_orchestrate_exit(void)
{
while (other_sibling_in_kernel())
twiddle_thumbs();
}
Hope that clarifies it.
Thanks,
tglx
Powered by blists - more mailing lists