From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id B87031A0072 for ; Mon, 8 Dec 2014 15:46:39 +1100 (AEDT) Date: Mon, 8 Dec 2014 15:46:38 +1100 From: Anton Blanchard To: Linus Torvalds 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: yuyang.du@intel.com, Brian Norris , Peter Zijlstra , Paul Turner , "Rafael J. Wysocki" , Yuanhan Liu , Steven Rostedt , Linux Kernel Mailing List , Benjamin Segall , ppc-dev , Ingo Molnar , sp@datera.io, Daniel J Blueman , Tejun Heo , subbaram@codeaurora.org, Andrew Morton , Wu Fengguang , lkp@01.org, Thomas Gleixner List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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