From: Qais Yousef <qais.yousef@imgtec.com>
To: Thomas Gleixner <tglx@linutronix.de>
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>
Subject: Re: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask
Date: Tue, 13 Oct 2015 15:26:22 +0100 [thread overview]
Message-ID: <561D148E.9020208@imgtec.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1510131517080.25029@nanos>
On 10/13/2015 02:26 PM, Thomas Gleixner wrote:
> On Tue, 13 Oct 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.
>>
>> Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
>> ---
>> include/linux/irq.h | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/include/linux/irq.h b/include/linux/irq.h
>> index 11bf09288ddb..4b537e4d393b 100644
>> --- a/include/linux/irq.h
>> +++ b/include/linux/irq.h
>> @@ -125,6 +125,21 @@ enum {
>> struct msi_desc;
>> struct irq_domain;
>>
>> + /**
>> + * struct ipi_mask - IPI mask information
>> + * @cpumask: bitmap of cpumasks
>> + * @nbits: number of bits in cpumask
>> + * @global: whether the mask is SMP IPI ie: subset of cpu_possible_mask or not
>> + *
>> + * ipi_mask is similar to cpumask, but it provides nbits that's configurable
>> + * rather than fixed to NR_CPUS.
>> + */
>> +struct ipi_mask {
>> + unsigned long *cpumask;
>> + unsigned int nbits;
>> + bool global;
>> +};
> Can you make that:
>
> struct ipi_mask {
> unsigned int nbits;
> bool global;
> unsigned long cpu_bitmap[];
> };
>
> That allows you to allocate the data structure in one go. So the
> ipi_mask in irq_data_common becomes a pointer which is only filled in
> when ipi_mask is actually used.
>
> Note, I renamed cpumask to cpu_bitmap to avoid confusion with
> cpumasks.
>
> We also want a helper function
>
> struct cpumask *irq_data_get_ipi_mask(struct irq_data *data);
>
> so we can use normal cpumask operations for the majority of cases.
>
>
Will do.
Thanks,
Qais
WARNING: multiple messages have this Message-ID (diff)
From: Qais Yousef <qais.yousef@imgtec.com>
To: Thomas Gleixner <tglx@linutronix.de>
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
Subject: Re: [RFC v2 PATCH 03/14] irq: add new struct ipi_mask
Date: Tue, 13 Oct 2015 15:26:22 +0100 [thread overview]
Message-ID: <561D148E.9020208@imgtec.com> (raw)
Message-ID: <20151013142622.K6afWpwRwyrBBP_Njyz86DJHmYB3XImjKezM3tNn1uI@z> (raw)
In-Reply-To: <alpine.DEB.2.11.1510131517080.25029@nanos>
On 10/13/2015 02:26 PM, Thomas Gleixner wrote:
> On Tue, 13 Oct 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.
>>
>> Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
>> ---
>> include/linux/irq.h | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/include/linux/irq.h b/include/linux/irq.h
>> index 11bf09288ddb..4b537e4d393b 100644
>> --- a/include/linux/irq.h
>> +++ b/include/linux/irq.h
>> @@ -125,6 +125,21 @@ enum {
>> struct msi_desc;
>> struct irq_domain;
>>
>> + /**
>> + * struct ipi_mask - IPI mask information
>> + * @cpumask: bitmap of cpumasks
>> + * @nbits: number of bits in cpumask
>> + * @global: whether the mask is SMP IPI ie: subset of cpu_possible_mask or not
>> + *
>> + * ipi_mask is similar to cpumask, but it provides nbits that's configurable
>> + * rather than fixed to NR_CPUS.
>> + */
>> +struct ipi_mask {
>> + unsigned long *cpumask;
>> + unsigned int nbits;
>> + bool global;
>> +};
> Can you make that:
>
> struct ipi_mask {
> unsigned int nbits;
> bool global;
> unsigned long cpu_bitmap[];
> };
>
> That allows you to allocate the data structure in one go. So the
> ipi_mask in irq_data_common becomes a pointer which is only filled in
> when ipi_mask is actually used.
>
> Note, I renamed cpumask to cpu_bitmap to avoid confusion with
> cpumasks.
>
> We also want a helper function
>
> struct cpumask *irq_data_get_ipi_mask(struct irq_data *data);
>
> so we can use normal cpumask operations for the majority of cases.
>
>
Will do.
Thanks,
Qais
next prev parent reply other threads:[~2015-10-13 14:26 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 10:16 [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 01/14] irq: add new IRQ_DOMAIN_FLAGS_IPI Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 02/14] irq: add GENERIC_IRQ_IPI Kconfig symbol Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 03/14] irq: add new struct ipi_mask Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 13:26 ` Thomas Gleixner
2015-10-13 14:26 ` Qais Yousef [this message]
2015-10-13 14:26 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 04/14] irq: add a new irq_send_ipi() to irq_chip Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 05/14] irq: add struct ipi_mask to irq_data Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 12:36 ` kbuild test robot
2015-10-13 12:36 ` kbuild test robot
2015-10-14 14:50 ` Davidlohr Bueso
2015-10-14 15:46 ` Qais Yousef
2015-10-14 15:46 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 06/14] irq: add struct ipi_mapping and its helper functions Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 13:31 ` Thomas Gleixner
2015-10-13 14:30 ` Qais Yousef
2015-10-13 14:30 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 07/14] irq: add a new generic IPI reservation code to irq core Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:56 ` kbuild test robot
2015-10-13 10:56 ` kbuild test robot
2015-10-13 10:56 ` kbuild test robot
2015-10-13 10:56 ` kbuild test robot
2015-10-13 13:37 ` Thomas Gleixner
2015-10-13 14:38 ` Qais Yousef
2015-10-13 14:38 ` Qais Yousef
2015-10-28 15:46 ` Qais Yousef
2015-10-28 15:46 ` Qais Yousef
2015-10-29 10:39 ` Qais Yousef
2015-10-29 10:39 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 08/14] irq: implement irq_send_ipi Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 11:12 ` kbuild test robot
2015-10-13 11:12 ` kbuild test robot
2015-10-13 11:29 ` kbuild test robot
2015-10-13 11:29 ` kbuild test robot
2015-10-13 13:40 ` Thomas Gleixner
2015-10-13 14:41 ` Qais Yousef
2015-10-13 14:41 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 09/14] MIPS: add support for generic SMP IPI support Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 13:48 ` Thomas Gleixner
2015-10-13 14:43 ` Qais Yousef
2015-10-13 14:43 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 10/14] MIPS: make smp CMP, CPS and MT use the new generic IPI functions Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 13:49 ` Thomas Gleixner
2015-10-13 14:46 ` Qais Yousef
2015-10-13 14:46 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 11/14] MIPS: delete smp-gic.c Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 12/14] irqchip: mips-gic: add a IPI hierarchy domain Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 13/14] irqchip: mips-gic: implement the new irq_send_ipi Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 14/14] irqchip: mips-gic: remove IPI init code Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 13:53 ` [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Thomas Gleixner
2015-10-13 14:48 ` Qais Yousef
2015-10-13 14:48 ` Qais Yousef
2015-10-13 17:24 ` Sergei Shtylyov
2015-10-13 17:27 ` Thomas Gleixner
2015-10-14 15:04 ` Davidlohr Bueso
2015-10-14 15:49 ` Qais Yousef
2015-10-14 15:49 ` Qais Yousef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=561D148E.9020208@imgtec.com \
--to=qais.yousef@imgtec.com \
--cc=jason@lakedaemon.net \
--cc=jiang.liu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=marc.zyngier@arm.com \
--cc=ralf@linux-mips.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.