From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <440DA9C6.3080702@lanl.gov> Date: Tue, 7 Mar 2006 08:41:58 -0700 From: Ronald G Minnich User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] structure allocation. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 0da98d50-ead1-11e9-9d60-3106f5b1d025 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