From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753300AbbK3LsG (ORCPT ); Mon, 30 Nov 2015 06:48:06 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:7273 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbbK3LsE (ORCPT ); Mon, 30 Nov 2015 06:48:04 -0500 Subject: Re: [PATCH v2 04/19] genirq: Add new struct ipi_mask and helper functions To: Thomas Gleixner References: <1448453217-3874-1-git-send-email-qais.yousef@imgtec.com> <1448453217-3874-5-git-send-email-qais.yousef@imgtec.com> CC: , , , , , From: Qais Yousef Message-ID: <565C3771.7040202@imgtec.com> Date: Mon, 30 Nov 2015 11:48:01 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/30/2015 11:20 AM, Thomas Gleixner wrote: > On Wed, 25 Nov 2015, Qais Yousef wrote: >> cpumask is limited to NR_CPUS. Introduce ipi_mask which allows us to address >> cpu range that is higher than NR_CPUS which is required for drivers to send >> IPIs for coprocessor that are outside Linux CPU range. > I have second thoughts on this. > > cpumask is indeed limited to NR_CPUS or in case of CPUMASK_ON_STACK > limited to nr_cpu_ids. > > But, that's not an issue for that coprocessor case. Let's assume you > have 16 Linux CPUs and 4 coprocessors. So you set the number of > possible cpus (NR_CPUS) to 20. That makes the cpumask sizeof 20. > > The boot-process sets the number of available cpus to 16. So the > Linux side will never try to access anything beyond cpu15. > > But you can spare that extra mask magic and simply use cpumask. Sorry > that I did not think about that earlier. > > Yes it would be much better to reuse it but wouldn't the runtime checks against nr_cpu_ids create problems especially when CPUMASK_ON_STACK is defined? Thanks, Qais From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailapp01.imgtec.com ([195.59.15.196]:47257 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27006763AbbK3LsIPIcHP (ORCPT ); Mon, 30 Nov 2015 12:48:08 +0100 Subject: Re: [PATCH v2 04/19] genirq: Add new struct ipi_mask and helper functions References: <1448453217-3874-1-git-send-email-qais.yousef@imgtec.com> <1448453217-3874-5-git-send-email-qais.yousef@imgtec.com> From: Qais Yousef Message-ID: <565C3771.7040202@imgtec.com> Date: Mon, 30 Nov 2015 11:48:01 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, jason@lakedaemon.net, marc.zyngier@arm.com, jiang.liu@linux.intel.com, ralf@linux-mips.org, linux-mips@linux-mips.org Message-ID: <20151130114801.kYnkd2HDqChcgAqoa3JLNgeVOZSnxRRkosexbGxbmNM@z> On 11/30/2015 11:20 AM, Thomas Gleixner wrote: > On Wed, 25 Nov 2015, Qais Yousef wrote: >> cpumask is limited to NR_CPUS. Introduce ipi_mask which allows us to address >> cpu range that is higher than NR_CPUS which is required for drivers to send >> IPIs for coprocessor that are outside Linux CPU range. > I have second thoughts on this. > > cpumask is indeed limited to NR_CPUS or in case of CPUMASK_ON_STACK > limited to nr_cpu_ids. > > But, that's not an issue for that coprocessor case. Let's assume you > have 16 Linux CPUs and 4 coprocessors. So you set the number of > possible cpus (NR_CPUS) to 20. That makes the cpumask sizeof 20. > > The boot-process sets the number of available cpus to 16. So the > Linux side will never try to access anything beyond cpu15. > > But you can spare that extra mask magic and simply use cpumask. Sorry > that I did not think about that earlier. > > Yes it would be much better to reuse it but wouldn't the runtime checks against nr_cpu_ids create problems especially when CPUMASK_ON_STACK is defined? Thanks, Qais