All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Jakub Sitnicki <jakub@cloudflare.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@cloudflare.com,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Subject: Re: [PATCH] genirq: Own affinity hint
Date: Wed, 25 Oct 2023 22:10:41 +0200	[thread overview]
Message-ID: <878r7q5upq.ffs@tglx> (raw)
In-Reply-To: <20231025141517.375378-1-jakub@cloudflare.com>

On Wed, Oct 25 2023 at 16:15, Jakub Sitnicki wrote:
> @@ -55,26 +55,33 @@ static int alloc_masks(struct irq_desc *desc, int node)
>  {
>  	if (!zalloc_cpumask_var_node(&desc->irq_common_data.affinity,
>  				     GFP_KERNEL, node))
> -		return -ENOMEM;
> +		goto err_affinity;
> +	if (!zalloc_cpumask_var_node(&desc->irq_common_data.affinity_hint,
> +				     GFP_KERNEL, node))

This gets allocated for every interrupt descriptor but only a few or
even none will ever use it. Seriously no.

> +		goto err_affinity_hint;
>  
>  #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
>  	if (!zalloc_cpumask_var_node(&desc->irq_common_data.effective_affinity,
> -				     GFP_KERNEL, node)) {
> -		free_cpumask_var(desc->irq_common_data.affinity);
> -		return -ENOMEM;
> -	}
> +				     GFP_KERNEL, node))
> +		goto err_effective_affinity;
>  #endif
>  
>  #ifdef CONFIG_GENERIC_PENDING_IRQ
> -	if (!zalloc_cpumask_var_node(&desc->pending_mask, GFP_KERNEL, node)) {
> -#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
> -		free_cpumask_var(desc->irq_common_data.effective_affinity);
> -#endif
> -		free_cpumask_var(desc->irq_common_data.affinity);
> -		return -ENOMEM;
> -	}
> +	if (!zalloc_cpumask_var_node(&desc->pending_mask, GFP_KERNEL, node))
> +		goto err_pending_mask;
>  #endif
>  	return 0;
> +
> +err_pending_mask:

How is this supposed to compile with CONFIG_GENERIC_PENDING_IRQ=n ?

> +#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
> +	free_cpumask_var(desc->irq_common_data.effective_affinity);
> +#endif
> +err_effective_affinity:

and this with CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=n ?

Thanks,

        tglx

  parent reply	other threads:[~2023-10-25 20:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 14:15 [PATCH] genirq: Own affinity hint Jakub Sitnicki
2023-10-25 18:48 ` kernel test robot
2023-10-25 20:10 ` Thomas Gleixner [this message]
2023-10-26 13:05   ` Jakub Sitnicki
2023-10-26 12:34 ` kernel test robot

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=878r7q5upq.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=jakub@cloudflare.com \
    --cc=kernel-team@cloudflare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xuanzhuo@linux.alibaba.com \
    /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.