From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752422AbbI0GeT (ORCPT ); Sun, 27 Sep 2015 02:34:19 -0400 Received: from ozlabs.org ([103.22.144.67]:38108 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbbI0GeS (ORCPT ); Sun, 27 Sep 2015 02:34:18 -0400 From: Rusty Russell To: Rasmus Villemoes , Thomas Gleixner , Oleg Nesterov , "Paul E. McKenney" , Greg Kroah-Hartman Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/5] kernel/cpu.c: eliminate some indirection In-Reply-To: <1443205347-13634-1-git-send-email-linux@rasmusvillemoes.dk> References: <1443205347-13634-1-git-send-email-linux@rasmusvillemoes.dk> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Sun, 27 Sep 2015 16:01:09 +0930 Message-ID: <87twqgpe4y.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 Rasmus Villemoes writes: > Maybe third time's the charm... > > The four cpumasks cpu_{possible,online,present,active}_bits are > exposed readonly via the corresponding const variables > cpu_xyz_mask. But they are also accessible for arbitrary writing via > the exposed functions set_cpu_xyz. There's quite a bit of code > throughout the kernel which iterates over or otherwise accesses these > bitmaps, and having the access go via the cpu_xyz_mask variables is > simply a useless indirection. Thanks, consider all patches Acked-by: Rusty Russell But to be clear, it has outlived its usefulness, but it was not useless. In particular, there used to be a debug config where 'struct cpumask' wasn't defined, so we could catch people declaring 'struct cpumask' on the stack (or passing by value). There was a plan to remove CONFIG_NR_CPUS (ie. having no compile-time cpu limit), but it seemed overkill and was abandoned. But avoiding 'struct cpumask' (not struct cpumask *) in the core wherever possible was a step towards it. Hope that clarifies, Rusty.