From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750954AbeAPBCo (ORCPT + 1 other); Mon, 15 Jan 2018 20:02:44 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:44233 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbeAPBCn (ORCPT ); Mon, 15 Jan 2018 20:02:43 -0500 X-Google-Smtp-Source: ACJfBosDZBaJ5GJz+zQRVmQeecYW4tlxlrNWI0d5V2bpDx/D4BOeoBgZiQsW1EMfHLYoGibP+6OH8Q== Date: Tue, 16 Jan 2018 02:02:38 +0100 From: Ingo Molnar To: Anna-Maria Gleixner Cc: LKML , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , keescook@chromium.org, Christoph Hellwig , John Stultz Subject: Re: [PATCH v4 02/36] hrtimer: Correct blantanly wrong comment Message-ID: <20180116010238.bel7praokqxtk4cs@gmail.com> References: <20171221104205.7269-1-anna-maria@linutronix.de> <20171221104205.7269-3-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171221104205.7269-3-anna-maria@linutronix.de> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: * Anna-Maria Gleixner wrote: > From: Thomas Gleixner > > The protection of a hrtimer which runs its callback against migration to a > different CPU has nothing to do with hard interrupt context. > > The protection against migration of a hrtimer running the expiry callback > is the pointer in the cpu_base which holds a pointer to the currently > running timer. This pointer is evaluated in the code which potentially > switches the timer base and makes sure it's kept on the CPU on which the > callback is running. > > Reported-by: Anna-Maria Gleixner > Signed-off-by: Thomas Gleixner > Signed-off-by: Anna-Maria Gleixner > --- > kernel/time/hrtimer.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c > index 69d203d8b12d..aee49c0c58b9 100644 > --- a/kernel/time/hrtimer.c > +++ b/kernel/time/hrtimer.c > @@ -1195,9 +1195,9 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, > timer->is_rel = false; > > /* > - * Because we run timers from hardirq context, there is no chance > - * they get migrated to another cpu, therefore its safe to unlock > - * the timer base. > + * The timer is marked as running in the cpu base, so it is > + * protected against migration to a different CPU even if the lock > + * is dropped. Small, nit: s/cpu/CPU to keep the capitalization consistent within the same sentence. Thanks, Ingo