Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932268AbbD1CVQ (ORCPT ); Mon, 27 Apr 2015 22:21:16 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:52488 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932233AbbD1CVM (ORCPT ); Mon, 27 Apr 2015 22:21:12 -0400 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="91326385" Message-ID: <553EEF5F.1090703@cn.fujitsu.com> Date: Tue, 28 Apr 2015 10:24:31 +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 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask References: <1430128720-3021-1-git-send-email-laijs@cn.fujitsu.com> <1430128720-3021-4-git-send-email-laijs@cn.fujitsu.com> <20150427160756.GE1499@htj.duckdns.org> <553EE60C.1040503@cn.fujitsu.com> In-Reply-To: <553EE60C.1040503@cn.fujitsu.com> 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: 1037 Lines: 28 On 04/28/2015 09:44 AM, Lai Jiangshan wrote: >>> >>> + /* save the user configured attrs */ >>> + cpumask_and(new_attrs->cpumask, attrs->cpumask, cpu_possible_mask); >> >> Wouldn't this make a lot more sense above when copying @attrs into >> @new_attrs? The comment there even says "make a copy of @attrs and >> sanitize it". Copy to @new_attrs, mask with wq_unbound_cpumask and >> fall back to wq_unbound_cpumask if empty. We need to save the user original configured attrs. When any time wq_unbound_cpumask is changed, we should use the user original configured attrs (cpumask) to re-calculate the pwqs and avoid losing any information. > > It should be: > > + copy_workqueue_attrs(new_attrs, attrs); > + cpumask_and(new_attrs->cpumask, new_attrs->cpumask, cpu_possible_mask); > -- 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/