linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jia He <hejianet@gmail.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Jia He <jia.he@hxt-semitech.com>
Subject: Re: [PATCH] irqchip/gic-v3-its: add allocation max order limitation for lpi_id_bits
Date: Mon, 27 Aug 2018 09:41:04 +0800	[thread overview]
Message-ID: <81286c7a-8e16-0925-7646-7d422d10114f@gmail.com> (raw)
In-Reply-To: <868t4tx88w.wl-marc.zyngier@arm.com>

Hi Marc
Thanks for the comments

On 8/27/2018 3:01 AM, Marc Zyngier Wrote:
> [I'm travelling, so expect some major delays in responding to email]
> 
> Hi Jia,
> 
> On Sun, 26 Aug 2018 10:00:51 +0100,
> Jia He <hejianet@gmail.com> wrote:
>>
>> There is a WARN_ON when my QDF2400 server boots up (pagesize is 4k)
> 
> [snip]
> 
>> In its_alloc_lpi_tables, lpi_id_bits is 24, without this patch,
>> its_allocate_prop_table will try to allocate 16M(order 12 if
>> pagesize=4k). Thus it causes the WARN_ON.
> 
> Gah! QDF and its 24bit INTIDs... Making life hell for everyone ;-)
> 
> Sorry for breaking it.

np, maybe QDF2400 is a little bit special

> 
>>
>> This patch fixes it by limiting the lpi_id_bits.
>>
>> Signed-off-by: Jia He <jia.he@hxt-semitech.com>
>> ---
>>  drivers/irqchip/irq-gic-v3-its.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
>> index 316a575..79e6993 100644
>> --- a/drivers/irqchip/irq-gic-v3-its.c
>> +++ b/drivers/irqchip/irq-gic-v3-its.c
>> @@ -1624,8 +1624,11 @@ static void its_free_prop_table(struct page *prop_page)
>>  static int __init its_alloc_lpi_tables(void)
>>  {
>>  	phys_addr_t paddr;
>> +	u32 max_bits;	 /*max order limitation in alloc_page*/
>>  
>> -	lpi_id_bits = GICD_TYPER_ID_BITS(gic_rdists->gicd_typer);
>> +	max_bits = PAGE_SHIFT + MAX_ORDER - 1;
>> +	lpi_id_bits = min_t(u32, max_bits,
>> +			GICD_TYPER_ID_BITS(gic_rdists->gicd_typer));
>>  	gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT);
>>  	if (!gic_rdists->prop_page) {
>>  		pr_err("Failed to allocate PROPBASE\n");
>> -- 
>> 1.8.3.1
>>
> 
> I find it rather odd that we end-up with different interrupt ranges
> depending on the CPU page size. Also, allocating that much memory for
> LPIs is rather pointless, as we actually have a pretty low limit of
> interrupts the system can deal with (see IRQ_BITMAP_BITS, which is
> slightly more than 8k). I've so far seen *one* request to push it up,
> but I doubt that it is a real use case.
> 
> Capping lpi_id_bits at 16 (which is what we had before) is plenty,
> will save a some memory, and gives some margin before we need to push
> it up again.

Do you want me to revert commit fe8e93504 to cap the lpi_id_bits
to no greater than ITS_MAX_LPI_NRBITS(16) instead this patch?
-- 
Cheers,
Jia

  reply	other threads:[~2018-08-27  1:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26  9:00 [PATCH] irqchip/gic-v3-its: add allocation max order limitation for lpi_id_bits Jia He
2018-08-26 19:01 ` Marc Zyngier
2018-08-27  1:41   ` Jia He [this message]
2018-08-27  9:09     ` Marc Zyngier

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=81286c7a-8e16-0925-7646-7d422d10114f@gmail.com \
    --to=hejianet@gmail.com \
    --cc=jason@lakedaemon.net \
    --cc=jia.he@hxt-semitech.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).