From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 734 invoked from network); 14 Feb 2000 08:25:29 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 14 Feb 2000 08:25:29 -0000 Received: from mailext03.compaq.com (mailext03.compaq.com [207.18.199.41]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id DAA12316 for ; Mon, 14 Feb 2000 03:25:29 -0500 Received: by mailext03.compaq.com (Postfix, from userid 12345) id E46421520DA; Mon, 14 Feb 2000 02:25:23 -0600 (CST) Received: from mailint02.im.hou.compaq.com (mailint02.compaq.com [207.18.199.35]) by mailext03.compaq.com (Postfix) with ESMTP id E093E148506 for ; Mon, 14 Feb 2000 02:25:23 -0600 (CST) Received: by mailint02.im.hou.compaq.com (Postfix, from userid 12345) id 1AF50BC4CB; Sun, 13 Feb 2000 23:04:48 -0600 (CST) Received: from pdgsrv.mro.dec.com (pdgsrv.mro.dec.com [16.34.112.86]) by mailint02.im.hou.compaq.com (Postfix) with ESMTP id C4F11B2A44 for ; Sun, 13 Feb 2000 23:04:47 -0600 (CST) Received: from alpha2.estabrook.org by pdgsrv.mro.dec.com; (8.8.8/1.1.8.2/13Dec96-1209PM) id AAA11361; Mon, 14 Feb 2000 00:04:52 -0500 (EST) Received: from alpha2.estabrook.org (localhost [127.0.0.1]) by alpha2.estabrook.org (8.9.3/8.9.3) with ESMTP id AAA02511 for ; Mon, 14 Feb 2000 00:07:07 -0500 Message-Id: <200002140507.AAA02511@alpha2.estabrook.org> X-Mailer: exmh version 2.0.3 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: axp-list To: axp-list@redhat.com From: Jay.Estabrook@compaq.com Subject: Re: how to simulate an unaligned ldl_l In-reply-to: Your message of Sun, 13 Feb 2000 18:20:48 -0500. Mime-Version: 1.0 Content-Type: text/plain Date: Mon, 14 Feb 2000 00:07:05 -0500 Sender: Jay.Estabrook@compaq.com >>> "Ross A. Knepper" said: > > i've been looking at porting reiserfs to alpha. unfortunately, it has a > bunch of unaligned data accesses. naturally, intel doesnt care. on > alpha, most unaligned LDx/STx instructions are emulated by a software > trap (outside the kernel that is -- i don't know about inside). however, > this is not the case with the load_locked and store_conditional > instructions. Uh, oh... :-\ > i'm looking at a number of routines that use these instructions for > atomicity, via clear_bit(), set_bit(), etc. in asm/bitops.h. is there any > clever way to circumvent this problem? the only hack i can think of at > the moment is to use ldl_u to extract it, put it into an aligned longword > buffer and do the ldl_l on that address instead. i feel like i'd have to > be insane to try this, however :) > > anybody had this problem before? found a solution? The only solution is to align those accesses. The load_locked and store_conditional *MUST* be used with aligned operands, otherwise what they are attempting to do (protect change of state from SMP meddling) cannot be relied on. And I believe strongly that this will be a problem on other architectures beside Alpha. You must convince the authors to rework the data structures to size and align the important fields correctly for operation on other platorms than INTEL. --Jay++ --------------------------------------------------------------- Jay A Estabrook Alpha Engineering - LINUX Compaq Computer Corp. - MRO1-2/K20 (508) 467-2080 200 Forest Street, Marlboro MA 01752 Jay.Estabrook@compaq.com ---------------------------------------------------------------