Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1230304

Re: crisv32 runtime failure in -next due to 'page-flags: define behavior SL*B-related flags on compound pages'

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: crisv32 runtime failure in -next due to 'page-flags: define behavior SL*B-related flags on compound pages'
Date 2015-09-22 17:20 +0200
Message-ID <qbxwl-DB-7@gated-at.bofh.it> (permalink)
References <qbvNU-6Aq-35@gated-at.bofh.it> <qbwgW-78r-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Sep 22, 2015 at 03:57:06PM +0200, Hans-Peter Nilsson wrote:
> > From: "Kirill A. Shutemov" <kirill@shutemov.name>
> > Date: Tue, 22 Sep 2015 15:27:51 +0200
> 
> > On Tue, Sep 22, 2015 at 02:50:19PM +0200, Hans-Peter Nilsson wrote:
> > > That element (the struct) needs *explicit* padding or alignment
> > > to the required multiplicity of bytes for anyone to portably be
> > > able to imply something other than "byte alignment" for the
> > > layout of it, as elements of an array, across systems.  Use
> > > dummy elements or a compiler construct like __attribute__
> > > ((__aligned__ (...))) per kernel policy or taste.  I'd recommend
> > > specifying the alignment, so TRT will happen for it when it in
> > > turn is an element of an otherwise unpadded struct.
> 
> > I see. I would say it's very risky ABI choice, but okay.
> > 
> > What was the reason behind? I don't understand it.
> 
> It was made some 20+ years ago, some of the reason being (here's
> the irony) compatibility with a toolchain for another
> architecture, popular at the time, now forgotten.
> Another reason (IIRC) was that it saves space. :)
> 
> > Is it free to make misaligned memory access on CRIS?
> 
> Within a cache-line for CRIS v32, it's free.
> 
> > What about atomicity? How it works for misaligned accesses?
> 
> Good spotting.  No system with page layouts fixed at size
> multiples (all are, it'd be crazy to split pages as low as byte
> boundaries) can support naturally-misaligned atomic accesses.
> 
> Therefore elements with access expecting atomicity, have be
> decorated with alignment-inducing attributes, for portability,
> e.g. to work for CRIS.  In userspace, I can at times get away
> with calling a special function with a process-wide lock, in
> those cases where the upstream project is unlikely to timely
> understand e.g. that a naked "int" is not naturally aligned.
> 
> > The patch below fixes issue for me.
> 
> Thanks.
> 
> > I'm not sure if we want to ask for alignment to sizeof(long).
> > aligned(2) works too.
> 
> I guess you hit the right spot, but I'd think people would be
> more comfortable with aligning to sizeof (void *).

I would indeed prefer sizeof(void *).

						Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

crisv32 runtime failure in -next due to 'page-flags: define behavior  SL*B-related flags on compound pages' Guenter Roeck <linux@roeck-us.net> - 2015-09-17 18:30 +0200
  Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-18 16:30 +0200
    Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Jesper Nilsson <jesper.nilsson@axis.com> - 2015-09-18 17:00 +0200
      Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Guenter Roeck <linux@roeck-us.net> - 2015-09-18 17:20 +0200
        Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-21 18:00 +0200
          Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Guenter Roeck <linux@roeck-us.net> - 2015-09-22 03:20 +0200
            Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-22 14:10 +0200
              Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Mikael Starvik <mikael.starvik@axis.com> - 2015-09-22 14:20 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Hans-Peter Nilsson <hans-peter.nilsson@axis.com> - 2015-09-22 15:00 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-22 15:30 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Hans-Peter Nilsson <hans-peter.nilsson@axis.com> - 2015-09-22 16:00 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-09-22 17:20 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-22 17:40 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-09-22 17:50 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-09-23 13:00 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Guenter Roeck <linux@roeck-us.net> - 2015-09-23 17:10 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-09-24 07:00 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' Hans-Peter Nilsson <hans-peter.nilsson@axis.com> - 2015-09-22 18:20 +0200
                Re: crisv32 runtime failure in -next due to 'page-flags: define  behavior SL*B-related flags on compound pages' "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-09-22 18:40 +0200

csiph-web