From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933227AbcBCQce (ORCPT ); Wed, 3 Feb 2016 11:32:34 -0500 Received: from mail-yk0-f177.google.com ([209.85.160.177]:35782 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932953AbcBCQcb (ORCPT ); Wed, 3 Feb 2016 11:32:31 -0500 Date: Wed, 3 Feb 2016 11:32:29 -0500 From: Tejun Heo To: Mike Galbraith Cc: LKML , tangchen@cn.fujitsu.com, rafael@kernel.org Subject: Re: mod_delayed_work() explosion due to 874bbfe6 Message-ID: <20160203163229.GF14091@mtj.duckdns.org> References: <1454424264.11183.46.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454424264.11183.46.camel@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 02, 2016 at 03:44:24PM +0100, Mike Galbraith wrote: > Scenario: CPU168 calls mod_delayed_work(), is taken offline before the > timer expires. Due to 874bbfe6, dwork->cpu is the now offline CPU168 > vs the previous WORK_CPU_UNBOUND, timer fires on CPU131, it tries to > __queue_work() with cpu == the now offline CPU168, gets to... > > } else > pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu)); > > ... and goes boom. > > > crash> p numa_node | grep 168 > [168]: ffff8c03fdf0e328 > crash> rd ffff8c03fdf0e328 > ffff8c03fdf0e328: 00000000ffffffff ........ > > Thus, pwq becomes 000000000. Then, as the result of reference to > pwq->pool, NULL reference occurs at (*PANIC). > > > What if anything is supposed to prevent this? (cc'ing So, the root problem here is cpu <-> node mapping flipping across cpu on/offlining which is unnecessary and causes other issues too. It's being worked on for quite a while now. http://lkml.kernel.org/g/1453702100-2597-1-git-send-email-tangchen@cn.fujitsu.com I'll create a bandaid patch for now so that wq falls back to dfl_wq on negative node. Thanks. -- tejun