Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753083AbbDGCah (ORCPT ); Mon, 6 Apr 2015 22:30:37 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:52116 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752899AbbDGCag (ORCPT ); Mon, 6 Apr 2015 22:30:36 -0400 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="90263171" Message-ID: <552341F4.9020703@cn.fujitsu.com> Date: Tue, 7 Apr 2015 10:33:24 +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: Tejun Heo CC: , Christoph Lameter , Kevin Hilman , Mike Galbraith , "Paul E. McKenney" , Viresh Kumar , Frederic Weisbecker Subject: Re: [PATCH 4/4 V6] workqueue: Allow modifying low level unbound workqueue cpumask References: <1426653617-3240-1-git-send-email-laijs@cn.fujitsu.com> <1427973282-3052-1-git-send-email-laijs@cn.fujitsu.com> <1427973282-3052-5-git-send-email-laijs@cn.fujitsu.com> <20150406155315.GD10582@htj.duckdns.org> <55233227.9090701@cn.fujitsu.com> <20150407015817.GJ10582@htj.duckdns.org> In-Reply-To: <20150407015817.GJ10582@htj.duckdns.org> 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 Content-Length: 1912 Lines: 50 On 04/07/2015 09:58 AM, Tejun Heo wrote: > Hello, Lai. > > On Tue, Apr 07, 2015 at 09:25:59AM +0800, Lai Jiangshan wrote: >> On 04/06/2015 11:53 PM, Tejun Heo wrote: >>> On Thu, Apr 02, 2015 at 07:14:42PM +0800, Lai Jiangshan wrote: >>>> /* make a copy of @attrs and sanitize it */ >>>> copy_workqueue_attrs(new_attrs, attrs); >>>> - cpumask_and(new_attrs->cpumask, new_attrs->cpumask, wq_unbound_global_cpumask); >>>> + copy_workqueue_attrs(pwq_attrs, attrs); >>>> + cpumask_and(new_attrs->cpumask, new_attrs->cpumask, cpu_possible_mask); >>>> + cpumask_and(pwq_attrs->cpumask, pwq_attrs->cpumask, unbound_cpumask); >>> >>> Hmmm... why do we need to keep track of both cpu_possible_mask and >>> unbound_cpumask? Can't we just make unbound_cpumask replace >>> cpu_possible_mask for unbound workqueues? >>> >> >> I want to save the original user-setting cpumask. >> >> When any time the wq_unbound_global_cpumask is changed, >> the new effective cpumask is >> the-original-user-setting-cpumask & wq_unbound_global_cpumask >> instead of >> the-last-effective-cpumask & wq_unbound_global_cpumask. > > Yes, I get that, but that'd require just tracking the original wq->unbound_attrs (new_attrs) saves the original configured value and is needed to be keep track of. For sanity, it needs to be masked with cpu_possible_mask. + cpumask_and(new_attrs->cpumask, new_attrs->cpumask, cpu_possible_mask); This code is changed back to the original code (before this patchset). In the next iterate, I will reduce the number of the local vars to make the code clearer. > configured value and the unbound_cpumask masked value, no? What am I > missing? > > Thanks. > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/