[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878r7q5upq.ffs@tglx>
Date: Wed, 25 Oct 2023 22:10:41 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Jakub Sitnicki <jakub@...udflare.com>
Cc: linux-kernel@...r.kernel.org, kernel-team@...udflare.com,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Subject: Re: [PATCH] genirq: Own affinity hint
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
Powered by blists - more mailing lists