mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Yunfeng Ye <yeyunfeng@huawei.com>
Cc: linux-kernel@vger.kernel.org, Shiyuan Hu <hushiyuan@huawei.com>,
	Hewenliang <hewenliang4@huawei.com>
Subject: Re: [PATCH] genirq/proc: Show percpu irq affinity
Date: Thu, 13 Aug 2020 10:27:53 +0200	[thread overview]
Message-ID: <874kp754s6.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <fcb0ae13-95b0-37d3-c1f9-44727e0f2ce8@huawei.com>

Yunfeng Ye <yeyunfeng@huawei.com> writes:

> When the "affinity=" cmdline parameter is configured,

There is no such parameter.

> the interrupt affinity displayed in the proc directory does not match
> with that of the the percu interrupt, and the percu interrupt uses
> desc->percu_affinity.

And when the non-existing parameter is not on the command line then
irq->affinity is showing the correct value magically?

Definitely not: It's unconditionally showing irq->affinity and that is
pretty unlikely to match irq->percpu_affinity in any case.

> diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
> index 32c071d7bc03..b9d0fa87b4b4 100644
> --- a/kernel/irq/proc.c
> +++ b/kernel/irq/proc.c
> @@ -52,6 +52,8 @@ static int show_irq_affinity(int type, struct seq_file *m)
>  	case AFFINITY:
>  	case AFFINITY_LIST:
>  		mask = desc->irq_common_data.affinity;
> +		if (irqd_is_per_cpu(&desc->irq_data))
> +			mask = desc->percpu_affinity;

This breaks all architecture which mark interrupts as per CPU without
using the partition mechanism resulting in a NULL pointer dereference.

Thanks,

        tglx

  reply	other threads:[~2020-08-13  8:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10  2:29 Yunfeng Ye
2020-08-13  8:27 ` Thomas Gleixner [this message]
2020-08-22  9:33   ` Yunfeng Ye
2020-08-22 11:35     ` Thomas Gleixner
2020-08-25  9:39       ` Yunfeng Ye

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=874kp754s6.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=hewenliang4@huawei.com \
    --cc=hushiyuan@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yeyunfeng@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®