Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbdF1VPV (ORCPT ); Wed, 28 Jun 2017 17:15:21 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43876 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751501AbdF1VPP (ORCPT ); Wed, 28 Jun 2017 17:15:15 -0400 Subject: Re: [PATCH] workqueue: Ensure that cpumask set for pools created after boot To: Tejun Heo Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, Nathan Fontenot References: <20170525150353.GE23493@htj.duckdns.org> <20170525150752.GF23493@htj.duckdns.org> <20170606180913.GA32062@htj.duckdns.org> <736f7f6e-8d47-eaea-acc6-8ed75014a287@linux.vnet.ibm.com> <20170612161433.GB19206@htj.duckdns.org> <69c4bbad-5d40-d054-0004-38ac81377b0b@linux.vnet.ibm.com> <20170612173225.GD19206@htj.duckdns.org> <0b95fc96-a481-4439-de65-ffdffa207f47@linux.vnet.ibm.com> <20170613201029.GA7359@htj.duckdns.org> From: Michael Bringmann Organization: IBM Linux Technology Center Date: Wed, 28 Jun 2017 16:15:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170613201029.GA7359@htj.duckdns.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17062821-0008-0000-0000-000002502887 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007291; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00880073; UDB=6.00438692; IPR=6.00660228; BA=6.00005445; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015995; XFM=3.00000015; UTC=2017-06-28 21:15:12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17062821-0009-0000-0000-000035D639BC Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-28_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706280340 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1821 Lines: 56 I will try that patch tomorrow. My only concern about that is the use of WARN_ON(). As I may have mentioned in my note of 6/27, I saw about 600 instances of the warning message just during boot of the PowerPC kernel. I doubt that we want to see that on an ongoing basis. Michael On 06/13/2017 03:10 PM, Tejun Heo wrote: > Hello, > > On Tue, Jun 13, 2017 at 03:04:30PM -0500, Michael Bringmann wrote: >> @@ -3564,19 +3564,28 @@ static struct pool_workqueue *alloc_unbound_pwq(struct workqueue_struct *wq, >> static bool wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node, >> int cpu_going_down, cpumask_t *cpumask) >> { >> + cpumask_t onl_targ_cm; >> + >> if (!wq_numa_enabled || attrs->no_numa) >> goto use_dfl; >> >> /* does @node have any online CPUs @attrs wants? */ >> - cpumask_and(cpumask, cpumask_of_node(node), attrs->cpumask); >> + cpumask_and(&onl_targ_cm, cpumask_of_node(node), attrs->cpumask); >> if (cpu_going_down >= 0) >> - cpumask_clear_cpu(cpu_going_down, cpumask); >> + cpumask_clear_cpu(cpu_going_down, &onl_targ_cm); >> >> - if (cpumask_empty(cpumask)) >> + if (cpumask_empty(&onl_targ_cm)) >> goto use_dfl; >> >> /* yeap, return possible CPUs in @node that @attrs wants */ >> cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]); >> + >> + if (cpumask_weight(&onl_targ_cm) > cpumask_weight(cpumask)) { >> + printk(KERN_INFO "WARNING: WQ cpumask: onl intersect > " >> + "possible intersect\n"); >> + return false; >> + } > > Yeah, alternatively, we can just add right before returning, > > if (WARN_ON(cpumask_empty(cpumask))) > return false; > > Thanks. > -- Michael W. Bringmann Linux Technology Center IBM Corporation Tie-Line 363-5196 External: (512) 286-5196 Cell: (512) 466-0650 mwb@linux.vnet.ibm.com