From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752224AbcIMGkH (ORCPT ); Tue, 13 Sep 2016 02:40:07 -0400 Received: from smtp-out12.tpgi.com.au ([220.244.226.122]:40547 "EHLO mail12.tpgi.com.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750734AbcIMGkF (ORCPT ); Tue, 13 Sep 2016 02:40:05 -0400 X-Greylist: delayed 660 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Sep 2016 02:40:04 EDT X-TPG-Junk-Status: Message not scanned X-TPG-Antivirus: Passed X-TPG-Abuse: host=[220.240.178.83]; ip=220.240.178.83; date=Tue, 13 Sep 2016 16:27:08 +1000 From: Con Kolivas To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Alfred Chen , Ingo Molnar Subject: [PATCH] sched: Do not use smp_processor_id() with preempt enabled in smpboot_thread_fn Date: Tue, 13 Sep 2016 16:27:05 +1000 Message-ID: <2042051.3vvUWIM0vs@hex> User-Agent: KMail/5.1.3 (Linux/4.7.3-ck3; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should not be using smp_processor_id() with preempt enabled. Bug identified and fix provided by Alfred Chen. Signed-off-by: Con Kolivas --- kernel/smpboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-4.7.3-ck3/kernel/smpboot.c =================================================================== --- linux-4.7.3-ck3.orig/kernel/smpboot.c 2016-05-16 08:43:13.000000000 +1000 +++ linux-4.7.3-ck3/kernel/smpboot.c 2016-09-13 16:17:33.535655129 +1000 @@ -122,12 +122,12 @@ static int smpboot_thread_fn(void *data) if (kthread_should_park()) { __set_current_state(TASK_RUNNING); - preempt_enable(); if (ht->park && td->status == HP_THREAD_ACTIVE) { BUG_ON(td->cpu != smp_processor_id()); ht->park(td->cpu); td->status = HP_THREAD_PARKED; } + preempt_enable(); kthread_parkme(); /* We might have been woken for stop */ continue;