[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNutdXlS5R/0rqqH@smile.fi.intel.com>
Date: Tue, 15 Aug 2023 19:53:09 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Yury Norov <yury.norov@...il.com>
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 1/4] genirq/irq_sim: dispose of remaining mappings before
removing the domain
On Tue, Aug 15, 2023 at 09:09:10AM -0700, Yury Norov wrote:
> On Tue, Aug 15, 2023 at 01:38:49PM +0300, Andy Shevchenko wrote:
> > On Sat, Aug 12, 2023 at 09:44:54PM +0200, Bartosz Golaszewski wrote:
...
> > > @@ -16,12 +17,14 @@ struct irq_sim_work_ctx {
> > > unsigned int irq_count;
> > > unsigned long *pending;
> > > struct irq_domain *domain;
> > > + struct list_head irqs;
> > > };
> > >
> > > struct irq_sim_irq_ctx {
> > > int irqnum;
> > > bool enabled;
> > > struct irq_sim_work_ctx *work_ctx;
> >
> > > + struct list_head siblings;
> >
> > You can reduce the code size by moving this to be the first member.
> > Not sure about struct irq_sim_work_ctx, you can play with bloat-o-meter.
>
> Pahole you meant?
No. I meant bloat-o-meter.
...
> But as Bartosz said in the other email, "it's just good practice
> resulting from years of" kernel coding to have:
> - members declared strongly according to the logic of the code, and
> if no strong preference:
> - list head be the first element of the structure, to let compiler
> avoid generating offsets when traversing lists;
Exactly.
> - put elements of greater size at the beginning, so no holes will be
> emitted like in the example above.
>
> So I'd suggest:
>
> struct irq_sim_irq_ctx {
> struct list_head siblings;
> struct irq_sim_work_ctx *work_ctx;
> int irqnum;
> bool enabled;
> }
Yes, I like this.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists