Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753664AbaLHEqm (ORCPT ); Sun, 7 Dec 2014 23:46:42 -0500 Received: from ozlabs.org ([103.22.144.67]:56706 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbaLHEql (ORCPT ); Sun, 7 Dec 2014 23:46:41 -0500 Date: Mon, 8 Dec 2014 15:46:38 +1100 From: Anton Blanchard To: Linus Torvalds Cc: Andrew Morton , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Steven Rostedt , Tejun Heo , Wu Fengguang , "Rafael J. Wysocki" , yuyang.du@intel.com, lkp@01.org, Yuanhan Liu , Paul Turner , Benjamin Segall , Daniel J Blueman , subbaram@codeaurora.org, Brian Norris , sp@datera.io, Linux Kernel Mailing List , ppc-dev Subject: Re: [PATCH] kthread: kthread_bind fails to enforce CPU affinity (fixes kernel BUG at kernel/smpboot.c:134!) Message-ID: <20141208154638.37c1ec18@kryten> In-Reply-To: References: <1418009221-12719-1-git-send-email-anton@samba.org> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, > The __set_task_cpu() function does various other things too: > > set_task_rq(p, cpu); > #ifdef CONFIG_SMP > /* > * After ->cpu is set up to a new value, task_rq_lock(p, ...) > can be > * successfuly executed on another CPU. We must ensure that > updates of > * per-task data have been completed by this moment. > */ > smp_wmb(); > task_thread_info(p)->cpu = cpu; > p->wake_cpu = cpu; > #endif > > which makes me worry about just setting the thread_info->cpu value. > That set_task_rq() initializes various group scheduling things, an > dthat whole "wake_cpu" thing seems relevant too. Yeah, I would definitely like the scheduler guys to weigh in on this, especially considering how difficult it can be to hit. Anton -- 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/