[lkml]   [2020]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH 14/16] irq: Add support for core-wide protection of IRQ and softirq

Joel Fernandes <> 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))

void sched_orchestrate_entry(void)
if (other_sibling_in_user_or_guest())

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))

void sched_orchestrate_exit(void)
while (other_sibling_in_kernel())

Hope that clarifies it.



 \ /
  Last update: 2020-07-20 10:20    [W:1.617 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site