From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753961AbbCMBgG (ORCPT ); Thu, 12 Mar 2015 21:36:06 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:1042 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752286AbbCMBgE (ORCPT ); Thu, 12 Mar 2015 21:36:04 -0400 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="75217687" Message-ID: <55023F93.9000304@cn.fujitsu.com> Date: Fri, 13 Mar 2015 09:38:27 +0800 From: Lai Jiangshan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Christoph Lameter CC: , Kevin Hilman , Mike Galbraith , "Paul E. McKenney" , Tejun Heo , Viresh Kumar , Frederic Weisbecker Subject: Re: [PATCH 4/4] workqueue: Allow modifying low level unbound workqueue cpumask References: <1426136412-7594-1-git-send-email-laijs@cn.fujitsu.com> <1426136412-7594-5-git-send-email-laijs@cn.fujitsu.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.103] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/13/2015 01:42 AM, Christoph Lameter wrote: > On Thu, 12 Mar 2015, Lai Jiangshan wrote: > >> The per-nodes' pwqs are mandatorily controlled by the low level cpumask, while >> the default pwq ignores the low level cpumask when (and ONLY when) the cpumask set >> by the user doesn't overlap with the low level cpumask. In this case, we can't >> apply the empty cpumask to the default pwq, so we use the user-set cpumask >> directly. > > I am wondering now why we have two cpumasks? What's your meaning? which two cpumask? The per-nodes' pwqs' cpumask and the default pwq's cpumask? They refer to different pool, so they have different cpumask. 1) If the per-nodes' pwqs exist, they were controlled by A (A = user-set-cpumask & possible-cpus-of-the-node). Now after this patch, they are controlled by B (B = A & the-low-level-cpumak). if A is empty or B is empty, we used default pwq for the node. 2) The default pwq is different, it was controlled by C (C = user-set-cpumask), and after this patch, it will be controlled by D (D = user-set-cpumask(C) & the-low-level-cpumask), But D may be empty, we can't have a default pwq with empty cpumask, so we have use C instead in this case. > A script can just interate > through the work queues if we want to set them all right? Then we do not > have to deal with the conflict between the settings in the kernel. wq->unbound_attrs->cpumask and the-low-level-cpumask can be set by users. they may be set different or even non-intersect, the non-intersect case is not real conflict, but it is possible, we have to handle it.