[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CO1PR11MB50893FEBA44135EB812682C9D6522@CO1PR11MB5089.namprd11.prod.outlook.com>
Date: Tue, 5 Nov 2024 22:36:21 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>, Paul Menzel
<pmenzel@...gen.mpg.de>
CC: David Laight <David.Laight@...lab.com>, "Drewek, Wojciech"
<wojciech.drewek@...el.com>, "Szycik, Marcin" <marcin.szycik@...el.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "Knitter, Konrad"
<konrad.knitter@...el.com>, "Chmielewski, Pawel"
<pawel.chmielewski@...el.com>, "horms@...nel.org" <horms@...nel.org>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"pio.raczynski@...il.com" <pio.raczynski@...il.com>, "Samudrala, Sridhar"
<sridhar.samudrala@...el.com>, "jiri@...nulli.us" <jiri@...nulli.us>,
"Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>
Subject: RE: [Intel-wired-lan] Small Integers: Big Penalty
> -----Original Message-----
> From: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
> Sent: Monday, November 4, 2024 3:25 AM
> To: Paul Menzel <pmenzel@...gen.mpg.de>
> Cc: David Laight <David.Laight@...lab.com>; Drewek, Wojciech
> <wojciech.drewek@...el.com>; Szycik, Marcin <marcin.szycik@...el.com>;
> netdev@...r.kernel.org; Knitter, Konrad <konrad.knitter@...el.com>;
> Chmielewski, Pawel <pawel.chmielewski@...el.com>; horms@...nel.org; intel-
> wired-lan@...ts.osuosl.org; pio.raczynski@...il.com; Samudrala, Sridhar
> <sridhar.samudrala@...el.com>; Keller, Jacob E <jacob.e.keller@...el.com>;
> jiri@...nulli.us; Kitszel, Przemyslaw <przemyslaw.kitszel@...el.com>
> Subject: Re: [Intel-wired-lan] Small Integers: Big Penalty
>
> On Mon, Nov 04, 2024 at 10:12:14AM +0100, Paul Menzel wrote:
> > [Cc: -nex.sw.ncis.nat.hpm.dev@...el.com (550 #5.1.0 Address rejected.)]
> >
> > Am 04.11.24 um 10:09 schrieb Paul Menzel:
> > > Dear David, dear Michal,
> > >
> > >
> > > Am 04.11.24 um 09:51 schrieb David Laight:
> > > > From: Michal Swiatkowski
> > > > > Sent: 04 November 2024 07:03
> > > > ...
> > > > > > The type of the devlink parameters msix_vec_per_pf_{min,max} is
> > > > > > specified as u32, so you must use value.vu32 everywhere you work with
> > > > > > them, not vu16.
> > > > > >
> > > > >
> > > > > I will change it.
> > > >
> > > > You also need a pretty good reason to use u16 anywhere at all.
> > > > Just because the domain of the value is small doesn't mean the
> > > > best type isn't [unsigned] int.
> > > >
> > > > Any arithmetic (particularly on non x86) is likely to increase
> > > > the code size above any perceived data saving.
> > >
> > > In 2012 Scott Duplichan wrote *Small Integers: Big Penalty* [1]. Of
> > > course you always should measure yourself.
> > >
>
> Yeah, I chose it, because previously it was stored in u16. I will change
> it to u32 too, as it is stored in structure that doesn't really need to
> be small.
>
> Thanks for comments and link to the article.
> Michal
>
Yea.. ice driver code has a bad habit of using smaller size values in structures when its unnecessary.
Powered by blists - more mailing lists