[0/3] livepatch,sched: Add livepatch task switching to cond_resched()

Message ID cover.1675969869.git.jpoimboe@kernel.org
Headers
Series livepatch,sched: Add livepatch task switching to cond_resched() |

Message

Josh Poimboeuf Feb. 9, 2023, 7:17 p.m. UTC
  Fix patching stalls caused by busy kthreads.

Josh Poimboeuf (3):
  livepatch: Skip task_call_func() for current task
  livepatch,sched: Add livepatch task switching to cond_resched()
  vhost: Fix livepatch timeouts in vhost_worker()

 drivers/vhost/vhost.c           |  3 +-
 include/linux/livepatch.h       |  1 +
 include/linux/livepatch_sched.h | 29 +++++++++++++++
 include/linux/sched.h           | 20 ++++++++---
 kernel/livepatch/transition.c   | 60 ++++++++++++++++++++++++++++++-
 kernel/sched/core.c             | 64 ++++++++++++++++++++++++++++-----
 6 files changed, 161 insertions(+), 16 deletions(-)
 create mode 100644 include/linux/livepatch_sched.h
  

Comments

Seth Forshee (DigitalOcean) Feb. 10, 2023, 9:08 p.m. UTC | #1
On Thu, Feb 09, 2023 at 11:17:46AM -0800, Josh Poimboeuf wrote:
> Fix patching stalls caused by busy kthreads.
> 
> Josh Poimboeuf (3):
>   livepatch: Skip task_call_func() for current task
>   livepatch,sched: Add livepatch task switching to cond_resched()
>   vhost: Fix livepatch timeouts in vhost_worker()

This is working perfectly in my testing. The busy vhost threads get
switched immediately. Thanks for working up these patches!

Tested-by: Seth Forshee (DigitalOcean) <sforshee@kernel.org>

Thanks,
Seth
  
Peter Zijlstra Feb. 14, 2023, 12:08 p.m. UTC | #2
On Thu, Feb 09, 2023 at 11:17:46AM -0800, Josh Poimboeuf wrote:
> Fix patching stalls caused by busy kthreads.
> 
> Josh Poimboeuf (3):
>   livepatch: Skip task_call_func() for current task
>   livepatch,sched: Add livepatch task switching to cond_resched()
>   vhost: Fix livepatch timeouts in vhost_worker()

Seems reasonable, you want me to take them through the sched tree?
  
Josh Poimboeuf Feb. 14, 2023, 7:05 p.m. UTC | #3
On Tue, Feb 14, 2023 at 01:08:22PM +0100, Peter Zijlstra wrote:
> On Thu, Feb 09, 2023 at 11:17:46AM -0800, Josh Poimboeuf wrote:
> > Fix patching stalls caused by busy kthreads.
> > 
> > Josh Poimboeuf (3):
> >   livepatch: Skip task_call_func() for current task
> >   livepatch,sched: Add livepatch task switching to cond_resched()
> >   vhost: Fix livepatch timeouts in vhost_worker()
> 
> Seems reasonable, you want me to take them through the sched tree?

That would be great, though first I'd like to get an ack from at least
another livepatch maintainer.