lkml.org 
[lkml]   [2022]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] sched,livepatch: call klp_try_switch_task in __cond_resched
    On Sat, May 07, 2022 at 07:18:51PM +0000, Rik van Riel wrote:
    > Huh, I just looked at that, and the x86 should_resched()
    > only seems to check that we _can_ resched, not whether
    > we should...
    >
    >
    > /*
    > * Returns true when we need to resched and can (barring IRQ state).
    > */
    > static __always_inline bool should_resched(int preempt_offset)
    > {
    > return unlikely(raw_cpu_read_4(__preempt_count) ==
    > preempt_offset);
    > }
    >
    > I wonder if that was intended, and why, or whether
    > the x86 should_resched should also be checking for
    > TIF_NEED_RESCHED?

    No, it does what you think it should do, you're just getting confused by
    the inverted PREEMPT_NEED_RESCHED bit :-)

    \
     
     \ /
      Last update: 2022-05-08 22:42    [W:4.966 / U:0.288 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site