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


Groups > linux.kernel > #1269850

Re: [RT PATCH] sched: rt: fix two possible deadlocks in push_irq_work_func

From yjin <yanjiang.jin@windriver.com>
Newsgroups linux.kernel
Subject Re: [RT PATCH] sched: rt: fix two possible deadlocks in push_irq_work_func
Date 2015-11-16 06:30 +0100
Message-ID <qvkwx-38R-1@gated-at.bofh.it> (permalink)
References (1 earlier) <quADo-7Dz-3@gated-at.bofh.it> <quBpL-89B-1@gated-at.bofh.it> <qv0Hw-7jc-3@gated-at.bofh.it> <qv0Rc-7mf-1@gated-at.bofh.it> <qv3m1-zv-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Thomas,

Thanks for your help.
I have tested your patch this morning, it seems well.
Could you tell me when will you send your formal patch? And please CC me 
when you send your patch.

Regards!
Yanjiang

On 2015年11月15日 19:05, Thomas Gleixner wrote:
> On Sun, 15 Nov 2015, Thomas Gleixner wrote:
>> Which does not happen on MIPS as it uses the generic
>> arch_irq_work_has_interrupt() implementation which returns 'false'.
> So the proper fix is to ensure that the irq safe irq work actually
> happens in interrupt context. Patch below.
>
> Thanks,
>
> 	tglx
>
> 8<-------------
>
> diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
> index 0e427a9997f3..2543aab05daa 100644
> --- a/include/linux/irq_work.h
> +++ b/include/linux/irq_work.h
> @@ -52,4 +52,10 @@ static inline bool irq_work_needs_cpu(void) { return false; }
>   static inline void irq_work_run(void) { }
>   #endif
>   
> +#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT_FULL)
> +void irq_work_tick_soft(void);
> +#else
> +static inline void irq_work_tick_soft(void) { }
> +#endif
> +
>   #endif /* _LINUX_IRQ_WORK_H */
> diff --git a/kernel/irq_work.c b/kernel/irq_work.c
> index 5a0f4525139c..58cf46638ca0 100644
> --- a/kernel/irq_work.c
> +++ b/kernel/irq_work.c
> @@ -200,8 +200,17 @@ void irq_work_tick(void)
>   
>   	if (!llist_empty(raised) && !arch_irq_work_has_interrupt())
>   		irq_work_run_list(raised);
> +
> +	if (!IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
> +		irq_work_run_list(this_cpu_ptr(&lazy_list));
> +}
> +
> +#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT_FULL)
> +void irq_work_tick_soft(void)
> +{
>   	irq_work_run_list(this_cpu_ptr(&lazy_list));
>   }
> +#endif
>   
>   /*
>    * Synchronize against the irq_work @entry, ensures the entry is not
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index adb1d82d6631..c68ba873da3c 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -1455,7 +1455,7 @@ void update_process_times(int user_tick)
>   	scheduler_tick();
>   	run_local_timers();
>   	rcu_check_callbacks(user_tick);
> -#if defined(CONFIG_IRQ_WORK) && !defined(CONFIG_PREEMPT_RT_FULL)
> +#if defined(CONFIG_IRQ_WORK)
>   	if (in_irq())
>   		irq_work_tick();
>   #endif
> @@ -1471,9 +1471,7 @@ static void run_timer_softirq(struct softirq_action *h)
>   
>   	hrtimer_run_pending();
>   
> -#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT_FULL)
> -	irq_work_tick();
> -#endif
> +	irq_work_tick_soft();
>   
>   	if (time_after_eq(jiffies, base->timer_jiffies))
>   		__run_timers(base);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[RT PATCH] sched: rt: fix two possible deadlocks in push_irq_work_func <yanjiang.jin@windriver.com> - 2015-11-14 04:00 +0100
  Re: [RT PATCH] sched: rt: fix two possible deadlocks in  push_irq_work_func Steven Rostedt <rostedt@goodmis.org> - 2015-11-14 05:30 +0100
    Re: [RT PATCH] sched: rt: fix two possible deadlocks in push_irq_work_func yjin <yanjiang.jin@windriver.com> - 2015-11-14 06:20 +0100
      Re: [RT PATCH] sched: rt: fix two possible deadlocks in  push_irq_work_func Thomas Gleixner <tglx@linutronix.de> - 2015-11-15 09:20 +0100
        Re: [RT PATCH] sched: rt: fix two possible deadlocks in  push_irq_work_func Thomas Gleixner <tglx@linutronix.de> - 2015-11-15 09:30 +0100
          Re: [RT PATCH] sched: rt: fix two possible deadlocks in  push_irq_work_func Thomas Gleixner <tglx@linutronix.de> - 2015-11-15 12:10 +0100
            Re: [RT PATCH] sched: rt: fix two possible deadlocks in push_irq_work_func yjin <yanjiang.jin@windriver.com> - 2015-11-16 06:30 +0100
              Re: [RT PATCH] sched: rt: fix two possible deadlocks in  push_irq_work_func Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2015-11-18 17:00 +0100

csiph-web