9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ronald G Minnich <rminnich@lanl.gov>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] structure allocation.
Date: Tue,  7 Mar 2006 08:41:58 -0700	[thread overview]
Message-ID: <440DA9C6.3080702@lanl.gov> (raw)
In-Reply-To: <fa0b319554446f7fb9c720fab239eb31@collyer.net>

geoff@collyer.net wrote:
> I suspect that the difference in time to access unaligned packed data
> vs. aligned data is irrelevant when compared with the general
> complexity of running a modern host adaptor.
>

It can get worse. Clever use of align and packed resulted, in Xen, in
longword accesses which were odd-byte-aligned half the time, odd-short
aligned 1/4 the time; i.e., misaligned 3/4 of the time. All this from a
goal to be efficient! I kind of wonder how much this packed/aligned
mania results in unaligned accesses in the end ...

This did get fixed. But it's a real warning against the kind of
cleverness that people resort to with gcc nowadays -- just wander
through the linux kernel sometime -- grep unlikely if you wish.

> It sounds like the folks who designed the dac960 either didn't think
> much about how drivers would access it, or they were hog wild over
> gcc's packed data attribute (does microsoft's compiler have something
> similar?).
>

Packed has been around in compilers for realtime and embedded for 30
years -- dare I admit to using it at some time? Nah. You were none of
you born then anyway, so you can't prove a thing. That code is on a
magtape in a landfill somewhere in Pennsylvania.

ron


  reply	other threads:[~2006-03-07 15:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-07  2:30 erik quanstrom
2006-03-07  2:37 ` geoff
2006-03-07  3:00   ` erik quanstrom
2006-03-07  3:11     ` Russ Cox
2006-03-07  4:13     ` geoff
2006-03-07 15:41       ` Ronald G Minnich [this message]
2006-03-07 15:53         ` C H Forsyth
2006-03-08  0:06         ` erik quanstrom
2006-03-08  2:21           ` Ronald G Minnich
2006-03-08  2:50             ` geoff
2006-03-08  4:10               ` Bruce Ellis
2006-03-08  4:37                 ` Russ Cox
2006-03-08  4:55                   ` Bruce Ellis
2006-03-08  5:03                     ` Russ Cox
2006-03-08  5:05                       ` Bruce Ellis
2006-03-08  5:09                         ` Russ Cox
2006-03-08  5:12                           ` Bruce Ellis
2006-03-08 12:11               ` Brantley Coile
2006-03-07 17:47       ` Bakul Shah
2006-03-07  9:23     ` Charles Forsyth
2006-03-07 11:54       ` erik quanstrom
2006-03-07 13:55         ` jmk
     [not found]       ` <000501c641de$afc905d0$14aaa8c0@utelsystems.local>
2006-03-07 14:21         ` "Nils O. Selåsdal"
2006-03-07 14:30           ` uriel
2006-03-07 14:43             ` Russ Cox
2006-03-07 14:48             ` C H Forsyth
2006-03-08  0:28           ` erik quanstrom

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=440DA9C6.3080702@lanl.gov \
    --to=rminnich@lanl.gov \
    --cc=9fans@cse.psu.edu \
    /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;
as well as URLs for NNTP newsgroup(s).