Displaying 2 results from an estimated 2 matches for "klp_switch_current".
2023 Jan 22
0
[PATCH 0/2] vhost: improve livepatch switching for heavily loaded vhost worker kthreads
...atch_state() fully loaded vhost kthreads can
> never switch because vhost_worker() will always appear on the stack, but with
> the call these kthreads can switch but will still be running the old version of
> vhost_worker().
>
> To avoid this situation I've added a new function, klp_switch_current(), which
> switches the current task only if its stack does not include any function being
> patched. This allows kthreads to safely attempt switching themselves if a patch
> is pending. There is at least one downside, however. Since there's no way for
> the kthread to track whether...
2023 Jan 26
1
[PATCH 2/2] vhost: check for pending livepatches from vhost worker kthreads
...-366,6 +367,9 @@ static int vhost_worker(void *data)
> > > > > if (need_resched())
> > > > > schedule();
> > > > > }
> > > > > +
> > > > > + if (unlikely(klp_patch_pending(current)))
> > > > > + klp_switch_current();
> > > >
> > > > I suggest to use the following intead:
> > > >
> > > > if (unlikely(klp_patch_pending(current)))
> > > > klp_update_patch_state(current);
> > > >
> > > > We already use this in do_idle()....