Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp753323ybe; Wed, 4 Sep 2019 07:16:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwft+FOMJhUS6st+PuHFWIeAiHZHb1aTzjHpSxB051UH0llT48sDrIChzdKwxDAmJApKuxS X-Received: by 2002:a17:90a:9512:: with SMTP id t18mr5249244pjo.129.1567606613097; Wed, 04 Sep 2019 07:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567606613; cv=none; d=google.com; s=arc-20160816; b=lMIJZHFi3gOiEI2Qat1SK3f1vA0tT8ZTCTb7jEQhL08tUxYmwmjSV+0FjoLgRUc7NO 7ATnYySzP7Zp0ukDVj8jiu91d0p08lsSplHLvYQRpOucVj7Kzs+CTrVQLxLKUu0zNeJc SR0H7jMWN8D9IPNFu44FdouozWJ5mRW5zFC23Y+kJEJ4fCHZyHvXcUF7ufXiidRRLfua 8WpxvISu95DrCGNLfZTq3/aRERyKPBjSWxlmJqxAlNbNy+GZcGVG/qbLw73Fa/0axQXL kZGL8tGRIyFIPYoo/W0mA/baSE35FsfojZVI5rtUVQahEDmCD+lv1GuAX5Ac6x/Os09g 2hqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=d83pwmTgXGUJgFPp6Yly9tqaolDO92X9ywBYS8F2/ZQ=; b=P276WPPoZPMXEqdxxp8bHCm6i6I9D3Fgsehsk9VAnaQpH+hnt/ES1OgnHSPMiR4qoQ 2TJvHr3v8Ph5M0ttEV6oV+NUb7ff1mRMf5NwTYxDd8kiOW76cOgnfmp1WgUwDS2om2EC 1QY4dRMoZ2DwRjrM0cGas61dxwIyhT8CCVkCm68uIhwqjJaDbkOJMQgmEt3K9EFB7JUb D8x04VwOAFN1TBVKxQcICEvVRbJzPwTeFDu/qznufveS8P6ODPX1Ra+vaV3lo4W19uY+ J301cCSiGFq0aHJgNyZn1dUeZvVM+czJoa/9vQNURUOLyRDBHaHGjKGONCCKrNIkMctH SWGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si17209269pgp.250.2019.09.04.07.16.36; Wed, 04 Sep 2019 07:16:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730117AbfIDOPm (ORCPT + 99 others); Wed, 4 Sep 2019 10:15:42 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:39417 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbfIDOPm (ORCPT ); Wed, 4 Sep 2019 10:15:42 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1i5W4S-0005HG-EP; Wed, 04 Sep 2019 16:15:40 +0200 Date: Wed, 4 Sep 2019 16:15:40 +0200 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Julien Grall Subject: [PATCH] hrtimer: Add a missing bracket and hide `migration_base' on !SMP Message-ID: <20190904141540.xucehzbndjmgkrio@linutronix.de> References: <20190821092409.13225-4-julien.grall@arm.com> <156652633520.11649.15892124550118329976.tip-bot2@tip-bot2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <156652633520.11649.15892124550118329976.tip-bot2@tip-bot2> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 68b2c8c1e4210 ("hrtimer: Don't take expiry_lock when timer is currently migrated") missed to add a bracket at the end of the if statement leading to compile errors. Since that commit the variable `migration_base' is always used but only available on SMP configuration thus leading to another compile error. The changelog says "The timer base and base->cpu_base cannot be NULL in the code path" so it is safe to limit this check to SMP configurations only. Add the missing bracket to the if statement and hide `migration_base' behind CONFIG_SMP bars. Fixes: 68b2c8c1e4210 ("hrtimer: Don't take expiry_lock when timer is currently migrated") Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index f5a1a5e16216c..bc84c74ae5b96 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1216,12 +1216,16 @@ void hrtimer_cancel_wait_running(const struct hrtimer *timer) { /* Lockless read. Prevent the compiler from reloading it below */ struct hrtimer_clock_base *base = READ_ONCE(timer->base); + bool is_migration_base = false; /* * Just relax if the timer expires in hard interrupt context or if * it is currently on the migration base. */ - if (!timer->is_soft || base == &migration_base) +#ifdef CONFIG_SMP + is_migration_base = base == &migration_base; +#endif + if (timer->is_soft || is_migration_base) { cpu_relax(); return; } -- 2.23.0