Re: [PATCH] genirq: Keep affinity_hint unchanged if it has a value

From: Yajun Deng
Date: Wed Mar 12 2025 - 06:28:41 EST


March 12, 2025 at 5:10 PM, "Thomas Gleixner" <tglx@xxxxxxxxxxxxx mailto:tglx@xxxxxxxxxxxxx?to=%22Thomas%20Gleixner%22%20%3Ctglx%40linutronix.de%3E > wrote:


>
> On Wed, Mar 12 2025 at 03:20, Yajun Deng wrote:
>
> >
> > March 11, 2025 at 10:14 PM, "Thomas Gleixner" <tglx@xxxxxxxxxxxxx> wrote:
> >
> > >
> > > > For example, if affinity_hint points to smp_affinity, smp_affinity
> > > > is changed by the user, and affinity_hint would chang. affinity_hint
> > > > couldn't as a hint to the user, it should keep the value if it has.
> > >
> > > What is 'smp_affinity'?
> > >
> > It's 'desc->irq_common_data.affinity'.
> >
> Which has no business to end up in the affinity hint.
>
>
> >
> > >
> > > I really fail to understand the problem you are trying to solve.
> > >
> > irq_update_affinity_hint(irq, desc->irq_common_data.affinity);
> >
> > As in this code, this means affinity_hint points to smp_affinity.
> >
> This code does not exist and no driver should ever invoke
> irq_update_affinity_hint() that way. The hint is a cpu mask managed by
> the driver and not something the driver pulls out of a data structure
> which it has no business to fiddle with.
>

Okay, I got it. Thank you!

> Thanks
>
> tglx
>