From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id C68142F113 for ; Wed, 25 Jul 2001 16:42:00 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f6PKZgl04585 for axp-list@listman.redhat.com; Wed, 25 Jul 2001 16:35:42 -0400 Received: from ml.comspec.com (IDENT:root@ml.comspec.com [192.139.80.27]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f6PKZfg04581 for ; Wed, 25 Jul 2001 16:35:42 -0400 Received: from romeo.iplink.net ([206.108.4.57]:49168 "EHLO Iplink.net") by ml.comspec.com with ESMTP id ; Wed, 25 Jul 2001 16:41:38 -0400 Message-ID: <3B5F2EFD.1440F426@Iplink.net> Date: Wed, 25 Jul 2001 15:41:33 -0500 From: alvin Organization: Interlink Connectivity Inc. X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.14-6.0 alpha) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Unaligned accesses References: <3B5E197B.50ED0967@iplink.net> <20010725114713.C17679@linux04.mro.cpqcorp.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: Jay Estabrook wrote: > > On Tue, Jul 24, 2001 at 08:57:31PM -0400, alvin wrote: > > > > I have noticed some problem with accessing unaligned data. > > > > I have an application that has a bunch of accesses to shorts in a byte > > array. Not seeing any more alignment errors from the kernel I assumed > > that all was ok due to the fact that althought it is a byte array it > > seemed to be short aligned... > > > > Well this turns out to be wrong. forcing alignment and doing memcpy's > > made my problems go away. > > You didn't describe the problem you were having... I have a network application (l2tpd) that uses a lot of htons and ntohs conversions back to back and on buffers that seem not to be naturally aligned. I am running out of time before my holidays so I will not be able to verify this but my feeling is that if there are a number of unaligned accesses that are back to back that is when the code breaks. The effect that I am seeing is that a 2 byte variable is not getting both bytes updated reliably. This problem appears or goes away depending on the alignment of the data. > > I was under the impression that the: > > 1) OS/Palcode handled unaligned accessed as a fault and although there > > is a performance penalty, that is all. > > That should be right. > > > 2) The kernel generated an error message for unaligned accesses. > > It generates some informational messages, but not one for every > unaligned access (if it did, there'd be a flood for the more serious > transgressors). Ahhhhhhhh the light goes on. Silly me I thought that since I have seen messages and fixing the code makes them go away that all the problems were tagged. Any quick pointer to the rule that is used for deciding what to flag and not? > So, a little more about the problem you saw, and the machine you are > running on, please... I am running this on 2 systems a UP1100(last to show the problem) and a noname. They are running serial consoles with RedHat 6.2 and kernel version: Linux version 2.2.19-6.2.1 (root@sws1) (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #6 Thu Jul 5 02:22:34 EDT 2001 This has a number of small patches for VLAN support and autodetect raid support otherwise they are clean. -- Alvin Starr || voice: (416)585-9971 Interlink Connectivity || fax: (416)585-9974 alvin@iplink.net ||