Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-10-04 Thread Alexey Brodkin
Hi Peter, On Mon, 2018-07-09 at 17:53 +0300, Alexey Brodkin wrote: > Hi Peter, > > On Mon, 2018-07-09 at 16:49 +0200, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 02:33:26PM +, Alexey Brodkin wrote: > > > > In fact, since alloc_dr() uses kmalloc() to allocate the entire thing, > > > > it

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Vineet Gupta
On 07/09/2018 09:10 AM, David Laight wrote: > From: Mark Rutland >> Sent: 09 July 2018 16:49 >> >> On Mon, Jul 09, 2018 at 05:45:21PM +0200, Peter Zijlstra wrote: >>> On Mon, Jul 09, 2018 at 05:34:27PM +0200, Peter Zijlstra wrote: On Mon, Jul 09, 2018 at 04:29:58PM +0100, Mark Rutland wrote: >

RE: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread David Laight
From: Mark Rutland > Sent: 09 July 2018 16:49 > > On Mon, Jul 09, 2018 at 05:45:21PM +0200, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 05:34:27PM +0200, Peter Zijlstra wrote: > > > On Mon, Jul 09, 2018 at 04:29:58PM +0100, Mark Rutland wrote: > > > > Shouldn't that be 8? AFAICT, __alignof__

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Mark Rutland
On Mon, Jul 09, 2018 at 05:45:21PM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 05:34:27PM +0200, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 04:29:58PM +0100, Mark Rutland wrote: > > > Shouldn't that be 8? AFAICT, __alignof__(unsigned long long) is 8 on > > > x86_32: > > > > Curio

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 05:34:27PM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 04:29:58PM +0100, Mark Rutland wrote: > > Shouldn't that be 8? AFAICT, __alignof__(unsigned long long) is 8 on > > x86_32: > > Curious, I wonder why we put that align in atomic64_32 then. Shiny, look at this

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 04:29:58PM +0100, Mark Rutland wrote: > Shouldn't that be 8? AFAICT, __alignof__(unsigned long long) is 8 on > x86_32: Curious, I wonder why we put that align in atomic64_32 then. ___ linux-snps-arc mailing list linux-snps-arc@li

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Mark Rutland
On Mon, Jul 09, 2018 at 04:49:25PM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 02:33:26PM +, Alexey Brodkin wrote: > > > In fact, since alloc_dr() uses kmalloc() to allocate the entire thing, > > > it is impossible to guarantee a larger alignment than kmalloc does. > > > > Well but

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 02:33:26PM +, Alexey Brodkin wrote: > > In fact, since alloc_dr() uses kmalloc() to allocate the entire thing, > > it is impossible to guarantee a larger alignment than kmalloc does. > > Well but 4-bytes [which is critical for atomic64_t] should be much less > than a sa

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 03:02:08PM +, David Laight wrote: > Mostly related to the fpu - probably including the fpu save area. So for the FPU save area in particular I know we play some horrific games. As to the rest I really dont know. I wouldn't mind it being changed, but from a cursory loo

RE: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread David Laight
From: Peter Zijlstra > Sent: 09 July 2018 15:49 > On Mon, Jul 09, 2018 at 02:33:26PM +, Alexey Brodkin wrote: > > > In fact, since alloc_dr() uses kmalloc() to allocate the entire thing, > > > it is impossible to guarantee a larger alignment than kmalloc does. > > > > Well but 4-bytes [which is

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Alexey Brodkin
Hi Peter, On Mon, 2018-07-09 at 16:49 +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 02:33:26PM +, Alexey Brodkin wrote: > > > In fact, since alloc_dr() uses kmalloc() to allocate the entire thing, > > > it is impossible to guarantee a larger alignment than kmalloc does. > > > > Well

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Alexey Brodkin
Hi Peter, On Mon, 2018-07-09 at 16:10 +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 04:07:17PM +0200, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > > > --- a/drivers/base/devres.c > > > +++ b/drivers/base/devres.c > > > @@ -24,8 +24,12 @@ stru

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 04:07:17PM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > > --- a/drivers/base/devres.c > > +++ b/drivers/base/devres.c > > @@ -24,8 +24,12 @@ struct devres_node { > > > > struct devres { > > struct devres_node

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Geert Uytterhoeven
On Mon, Jul 9, 2018 at 4:04 PM Mark Rutland wrote: > On Mon, Jul 09, 2018 at 03:54:09PM +0200, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > > > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > > > index f98a097e73f2..d65327cb83c9 100644 >

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Alexey Brodkin
Hi Peter, On Mon, 2018-07-09 at 15:54 +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > > index f98a097e73f2..d65327cb83c9 100644 > > --- a/drivers/base/devres.c > > +++ b/drivers/base/dev

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > --- a/drivers/base/devres.c > +++ b/drivers/base/devres.c > @@ -24,8 +24,12 @@ struct devres_node { > > struct devres { > struct devres_node node; > - /* -- 3 pointers */ > - unsigned long long

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Mark Rutland
On Mon, Jul 09, 2018 at 03:54:09PM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > > index f98a097e73f2..d65327cb83c9 100644 > > --- a/drivers/base/devres.c > > +++ b/drivers/base/devres.

Re: [PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 04:45:50PM +0300, Alexey Brodkin wrote: > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > index f98a097e73f2..d65327cb83c9 100644 > --- a/drivers/base/devres.c > +++ b/drivers/base/devres.c > @@ -24,8 +24,12 @@ struct devres_node { > > struct devres { >

[PATCH v3] devres: Explicitly align datai[] to 64-bit

2018-07-09 Thread Alexey Brodkin
data[] must be 64-bit aligned even on 32-bit architectures because it might be accessed by instructions that require aligned memory arguments. One example is "atomic64_t" type accessed by special atomic instructions which may read/write entire 64-bit word. Atomic instructions are a bit special co