[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <840b32a0-9346-4576-97ba-17af12eb4db4@molgen.mpg.de>
Date: Mon, 4 Nov 2024 10:09:30 +0100
From: Paul Menzel <pmenzel@...gen.mpg.de>
To: David Laight <David.Laight@...LAB.COM>,
Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: Michal Schmidt <mschmidt@...hat.com>, intel-wired-lan@...ts.osuosl.org,
netdev@...r.kernel.org, pawel.chmielewski@...el.com,
sridhar.samudrala@...el.com, jacob.e.keller@...el.com,
pio.raczynski@...il.com, konrad.knitter@...el.com, marcin.szycik@...el.com,
wojciech.drewek@...el.com, nex.sw.ncis.nat.hpm.dev@...el.com,
przemyslaw.kitszel@...el.com, jiri@...nulli.us, horms@...nel.org
Subject: Small Integers: Big Penalty (was: [Intel-wired-lan] [iwl-next v6 2/9]
ice: devlink PF MSI-X max and min parameter)
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.
Kind regards,
Paul
[1]: https://notabs.org/coding/smallIntsBigPenalty.htm
Powered by blists - more mailing lists