Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1709368

Re: [patch-rt] hotplug, hrtimer: Migrate expired/deferred timers during cpu offline

From Mike Galbraith <efault@gmx.de>
Newsgroups linux.kernel
Subject Re: [patch-rt] hotplug, hrtimer: Migrate expired/deferred timers during cpu offline
Date 2017-08-11 10:20 +0200
Message-ID <uddkK-17M-23@gated-at.bofh.it> (permalink)
References (2 earlier) <ub8Iy-6kU-39@gated-at.bofh.it> <ubKNQ-5gB-25@gated-at.bofh.it> <ubLAe-5Ov-13@gated-at.bofh.it> <uc9Cx-6yS-3@gated-at.bofh.it> <udd1o-LV-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2017-08-11 at 09:55 +0200, Mike Galbraith wrote:
> The below fixes the list debug explosion up.
> 
> If we do not migrate expired/deferred timers during cpu offline, ->cb_entry
> will be corrupted by online initialization of base->expired, leading to a
> loud list debug complaint should someone call __remove_hrtimer() thereafter.
> 
> Signed-off-by: Mike Galvraith <efault@gmx.de>
ahem.....................b

> ---
>  kernel/time/hrtimer.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> --- a/kernel/time/hrtimer.c
> +++ b/kernel/time/hrtimer.c
> @@ -1802,6 +1802,19 @@ static void migrate_hrtimer_list(struct
>  		 */
>  		enqueue_hrtimer(timer, new_base);
>  	}
> +
> +	/*
> +	 * Finally, migrate any expired timers deferred by RT.
> +	 */
> +	while (!list_empty(&old_base->expired)) {
> +		struct list_head *entry = old_base->expired.next;
> +
> +		timer = container_of(entry, struct hrtimer, cb_entry);
> +		/* XXX: hm, perhaps defer again instead of enqueueing. */
> +		__remove_hrtimer(timer, old_base, HRTIMER_STATE_ENQUEUED, 0);
> +		timer->base = new_base;
> +		enqueue_hrtimer(timer, new_base);
> +	}
>  }
>  
>  int hrtimers_dead_cpu(unsigned int scpu)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[ANNOUNCE] v4.11.12-rt9 Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2017-08-04 19:40 +0200
  Re: [ANNOUNCE] v4.11.12-rt9 Mike Galbraith <efault@gmx.de> - 2017-08-05 08:20 +0200
    Re: [ANNOUNCE] v4.11.12-rt9 Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2017-08-07 09:40 +0200
      Re: [ANNOUNCE] v4.11.12-rt9 Mike Galbraith <efault@gmx.de> - 2017-08-07 10:30 +0200
        Re: [ANNOUNCE] v4.11.12-rt9 Mike Galbraith <efault@gmx.de> - 2017-08-08 12:10 +0200
          [patch-rt] hotplug, hrtimer: Migrate expired/deferred timers during  cpu offline Mike Galbraith <efault@gmx.de> - 2017-08-11 10:00 +0200
            Re: [patch-rt] hotplug, hrtimer: Migrate expired/deferred timers  during cpu offline Mike Galbraith <efault@gmx.de> - 2017-08-11 10:20 +0200
    Re: [ANNOUNCE] v4.11.12-rt9 Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2017-08-07 10:00 +0200
      Re: [ANNOUNCE] v4.11.12-rt9 Mike Galbraith <efault@gmx.de> - 2017-08-07 10:40 +0200
        [patch-rt] locking, rwlock-rt: do not save state multiple times in  __write_rt_lock() Mike Galbraith <efault@gmx.de> - 2017-08-09 14:10 +0200
      Re: [ANNOUNCE] v4.11.12-rt9 Mike Galbraith <efault@gmx.de> - 2017-08-07 11:20 +0200

csiph-web