From patchwork Sun Jul 22 16:43:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 1224751 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 68C213FC5A for ; Sun, 22 Jul 2012 16:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752176Ab2GVQnf (ORCPT ); Sun, 22 Jul 2012 12:43:35 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:63465 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118Ab2GVQnd (ORCPT ); Sun, 22 Jul 2012 12:43:33 -0400 Received: by pbbrp8 with SMTP id rp8so9427077pbb.19 for ; Sun, 22 Jul 2012 09:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4v6LPub8pTvwNM3919SFtw+3OsNNW2W5XU5w7jEOaq8=; b=HTvnKPEx3SndlvrRXEfuUmp9KWodWD4gQTec4gFbDuHc75jJ+tD5AO0Kpxag/G4eFA PoYMMRNRtjMpRQxNi575/s4XUuQwwBo526LYjiXxIZK1V+1etnMffUypIwKZoOWKzlA1 eyc1Q2AWBHbL47UkT4bfE11ofBimEEM8GcpHlRAxvS0lNjpJSySJT2cZQVjPgiO+mUzt +6Haxdh6N+ZApMxMr/WHP0LNwy+tvvTsw8kkm4EbOTT3coZYiXsCVyNQGz9XB904/qVT 5SOhdnxeZqM/OLu12eFyWqC21NKT2HYAmzcMJHTJ9ImaebGbcrav0Tt3ePdsgat4Pze7 Ne0Q== Received: by 10.68.233.103 with SMTP id tv7mr29379552pbc.124.1342975412743; Sun, 22 Jul 2012 09:43:32 -0700 (PDT) Received: from dhcp-172-17-108-109.mtv.corp.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id rg9sm8169815pbc.67.2012.07.22.09.43.30 (version=SSLv3 cipher=OTHER); Sun, 22 Jul 2012 09:43:31 -0700 (PDT) Date: Sun, 22 Jul 2012 09:43:27 -0700 From: Tejun Heo To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, peterz@infradead.org, tglx@linutronix.de, linux-pm@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] workqueue: fix spurious CPU locality WARN from process_one_work() Message-ID: <20120722164327.GA5144@dhcp-172-17-108-109.mtv.corp.google.com> References: <1342545149-3515-1-git-send-email-tj@kernel.org> <1342545149-3515-2-git-send-email-tj@kernel.org> <20120720215207.GA18841@linux.vnet.ibm.com> <20120720215835.GB6823@google.com> <20120721213656.GA7783@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120721213656.GA7783@linux.vnet.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 25511a4776 "workqueue: reimplement CPU online rebinding to handle idle workers" added CPU locality sanity check in process_one_work(). It triggers if a worker is executing on a different CPU without UNBOUND or REBIND set. This works for all normal workers but rescuers can trigger this spuriously when they're serving the unbound or a disassociated global_cwq - rescuers don't have either flag set and thus its gcwq->cpu can be a different value including %WORK_CPU_UNBOUND. Fix it by additionally testing %GCWQ_DISASSOCIATED. Signed-off-by: Tejun Heo Reported-by: "Paul E. McKenney" LKML-Refence: <20120721213656.GA7783@linux.vnet.ibm.com> --- This should fix it. Will queue it on wq/for-3.6. Thanks! kernel/workqueue.c | 6 ++++++ 1 file changed, 6 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1949,7 +1949,13 @@ __acquires(&gcwq->lock) lockdep_copy_map(&lockdep_map, &work->lockdep_map); #endif + /* + * Ensure we're on the correct CPU. DISASSOCIATED test is + * necessary to avoid spurious warnings from rescuers servicing the + * unbound or a disassociated gcwq. + */ WARN_ON_ONCE(!(worker->flags & (WORKER_UNBOUND | WORKER_REBIND)) && + !(gcwq->flags & GCWQ_DISASSOCIATED) && raw_smp_processor_id() != gcwq->cpu); /*