public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	mm-commits-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: + kernel-add-common-infrastructure-for-unaligned-access.patch added to -mm tree
Date: Tue, 15 Apr 2008 08:07:53 -0700	[thread overview]
Message-ID: <1208272073.11920.74.camel@brick> (raw)
In-Reply-To: <1208261668.9212.18.camel-ZP4jZrcIevRpWr+L1FloEB2eb7JE58TQ@public.gmane.org>

On Tue, 2008-04-15 at 13:14 +0100, David Woodhouse wrote:
> On Mon, 2008-04-14 at 15:14 -0700, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org wrote:
> > 
> > Currently there are five implementations:
> > 1) packed_struct.h: C-struct based, from asm-generic/unaligned.h
> > 2) le_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
> > 3) be_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
> > 4) memmove.h: taken from multiple implementations in tree
> > 5) access_ok.h: taken from x86 and others, unaligned access is ok.
> > 
> > All of the new implementations checks for sizes not equal to 1,2,4,8
> > and will fail to link.
> 
> This seems like overkill to me. Can't we just use the packed struct
> version? GCC should then to the right thing for all architectures.
> 

> And couldn't these be macros rather than relying on a boatload of
> infrastructure?


The reason I kept the byte-shifting versions around was that for
arches that need special handling of unaligned access, they could
do the byteshifting manually and get the unaligned access 'for free'
as it were.  The packed struct implementation works fine for the
same endianness, but I tried to make this as little of a change for
each arch as a consolidation step...which is why I kept the
memmove variant.  We can discuss moving arches over to other
implementations after the fact.

Cheers,

Harvey

WARNING: multiple messages have this Message-ID (diff)
From: Harvey Harrison <harvey.harrison@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: akpm@linux-foundation.org, mm-commits@vger.kernel.org,
	linux-arch@vger.kernel.org
Subject: Re: + kernel-add-common-infrastructure-for-unaligned-access.patch added to -mm tree
Date: Tue, 15 Apr 2008 08:07:53 -0700	[thread overview]
Message-ID: <1208272073.11920.74.camel@brick> (raw)
Message-ID: <20080415150753.Rmlsnkb7Kh86L3yvAvpEwCAENQNgweiJLo0-Dq6bZ3Y@z> (raw)
In-Reply-To: <1208261668.9212.18.camel@pmac.infradead.org>

On Tue, 2008-04-15 at 13:14 +0100, David Woodhouse wrote:
> On Mon, 2008-04-14 at 15:14 -0700, akpm@linux-foundation.org wrote:
> > 
> > Currently there are five implementations:
> > 1) packed_struct.h: C-struct based, from asm-generic/unaligned.h
> > 2) le_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
> > 3) be_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
> > 4) memmove.h: taken from multiple implementations in tree
> > 5) access_ok.h: taken from x86 and others, unaligned access is ok.
> > 
> > All of the new implementations checks for sizes not equal to 1,2,4,8
> > and will fail to link.
> 
> This seems like overkill to me. Can't we just use the packed struct
> version? GCC should then to the right thing for all architectures.
> 

> And couldn't these be macros rather than relying on a boatload of
> infrastructure?


The reason I kept the byte-shifting versions around was that for
arches that need special handling of unaligned access, they could
do the byteshifting manually and get the unaligned access 'for free'
as it were.  The packed struct implementation works fine for the
same endianness, but I tried to make this as little of a change for
each arch as a consolidation step...which is why I kept the
memmove variant.  We can discuss moving arches over to other
implementations after the fact.

Cheers,

Harvey




  parent reply	other threads:[~2008-04-15 15:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14 22:14 + kernel-add-common-infrastructure-for-unaligned-access.patch added to -mm tree akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b
2008-04-14 22:14 ` akpm
     [not found] ` <200804142214.m3EMET5L029431-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-15 12:14   ` David Woodhouse
2008-04-15 12:14     ` David Woodhouse
     [not found]     ` <1208261668.9212.18.camel-ZP4jZrcIevRpWr+L1FloEB2eb7JE58TQ@public.gmane.org>
2008-04-15 15:07       ` Harvey Harrison [this message]
2008-04-15 15:07         ` Harvey Harrison
2008-04-15 16:12         ` David Woodhouse
2008-04-15 16:12           ` David Woodhouse
     [not found]           ` <1208275927.9212.58.camel-ZP4jZrcIevRpWr+L1FloEB2eb7JE58TQ@public.gmane.org>
2008-04-15 17:24             ` Harvey Harrison
2008-04-15 17:24               ` Harvey Harrison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1208272073.11920.74.camel@brick \
    --to=harvey.harrison-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mm-commits-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox