[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200828055603.GA5814@yilunxu-OptiPlex-7050>
Date: Fri, 28 Aug 2020 13:56:03 +0800
From: Xu Yilun <yilun.xu@...el.com>
To: Moritz Fischer <mdf@...nel.org>
Cc: David Laight <David.Laight@...lab.com>,
"linux-fpga@...r.kernel.org" <linux-fpga@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"trix@...hat.com" <trix@...hat.com>,
"lgoncalv@...hat.com" <lgoncalv@...hat.com>
Subject: Re: [PATCH v4 1/4] fpga: dfl: change data type of feature id to u16
On Wed, Aug 19, 2020 at 09:14:31PM -0700, Moritz Fischer wrote:
> On Thu, Aug 13, 2020 at 05:04:09PM +0800, Xu Yilun wrote:
> > On Thu, Aug 13, 2020 at 08:28:05AM +0000, David Laight wrote:
> > > From: Xu Yilun
> > > > Sent: 13 August 2020 08:59
> > > > On Wed, Aug 12, 2020 at 08:52:39AM +0000, David Laight wrote:
> > > > > From: Moritz Fischer
> > > > > > Sent: 12 August 2020 04:56
> > > > > >
> > > > > > On Mon, Aug 10, 2020 at 10:41:10AM +0800, Xu Yilun wrote:
> > > > > > > The feature id is stored in a 12 bit field in DFH. So a u16 variable is
> > > > > > > enough for feature id.
> > > > > > >
> > > > > > > This patch changes all feature id related places to fit u16.
> > > > >
> > > > > How much bigger does it make the kernel?
> > > >
> > > > The patch changes the definition of feature id from u64 to u16, and will
> > > > make the kernel slightly smaller.
> > >
> > > Unlikely.
> > > Most of the structures will gain a 'pad' field.
> > > Using u16 for function parameters and results almost certainly
> > > requires instructions to mask the value.
> > > Any arithmetic on u16 will require masking instructions on
> > > (probably) all architectures except x86.
> > >
> > > Using 'unsigned int' is probably best.
> > >
> > > u16 is never a good idea unless you are defining enough
> > > of them in a structure (eg as an array) to reduce the
> > > structure size below some threshold.
> > > (Or are matching some hardware layout.)
> >
> > I got it. Thanks for your detailed explanation. I think we may change them to
> > u32. Is it the same case for u8? Think we may also change the dfl_device_id.type.
> >
> >
> > Hi Moritz:
> >
> > The patch is applied to for-next, is it possible we recall it, or we
> > make another fix after it?
> >
> > Thanks,
> > Yilun.
>
> Sorry for the delay, can you send a follow-up please?
Hi moritz:
I think I don't have to change it now. As discussed with David, these
fields aren't often accessed. So it should be OK.
Thanks,
Yilun.
>
> Cheers,
> Moritz
Powered by blists - more mailing lists