From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754152AbbCBLl0 (ORCPT ); Mon, 2 Mar 2015 06:41:26 -0500 Received: from ozlabs.org ([103.22.144.67]:46803 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbbCBLlW (ORCPT ); Mon, 2 Mar 2015 06:41:22 -0500 From: Rusty Russell To: Oleg Drokin Cc: Andrew Morton , "David S. Miller" , "\ Mailing List" Subject: Re: [PATCH 0/2] incorrect cpumask behavior with CPUMASK_OFFSTACK In-Reply-To: References: <1424931551-11757-1-git-send-email-green@linuxhacker.ru> <87pp8vlgqu.fsf@rustcorp.com.au> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Mon, 02 Mar 2015 21:58:03 +1030 Message-ID: <87wq2zk5a4.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oleg Drokin writes: >>> The second patch that I am not sure if we wnat, but it seems to be useful >>> until struct cpumask is fully dynamic is to convert what looks like >>> whole-set operations e.g. copies, namely: >>> cpumask_setall, cpumask_clear, cpumask_copy to always operate on NR_CPUS >>> bits to ensure there's no stale garbage left in the mask should the >>> cpu count increases later. >> You can't do this, because dynamically allocated cpumasks don't have >> NR_CPUS bits. > > Well, right now they certainly have. As in, it's a static define and we allocate > a bitmap to fit the (in my case) up to 8192 bits into such off-stack masks. You're right, we should fix that properly. Right now, cpumask_size() has: /* FIXME: Once all cpumask assignments are eliminated, this * can be nr_cpumask_bits */ return BITS_TO_LONGS(NR_CPUS) * sizeof(long); >> Let's just kill all the cpus_ functions. This wasn't done originally >> because archs which didn't care about offline cpumasks didn't want the >> churn. In particular, they must not copy struct cpumask by assignment, >> and fixing those is a fair bit of churn. > > Ah, copy masks by assignment, I see. > Well, I guess we can eliminate the users outside of the affected arch trees > (I assume in x86 there would be no objections?) and perhaps add a warning to > checkpatch.pl? OK... I have done a sweep. It's not *that* bad with spatch. I'm going to remove all the old functions. Expect a series RSN. Cheers, Rusty.