All of lore.kernel.org
 help / color / mirror / Atom feed
* mips requires alignment for ext2_*_bit functions
@ 2002-03-28 23:43 Dale Farnsworth
  2002-03-29  9:20 ` Oleg Drokin
  0 siblings, 1 reply; 3+ messages in thread
From: Dale Farnsworth @ 2002-03-28 23:43 UTC (permalink / raw)
  To: reiserfs-list

We see immediate alignment failures using reiserfs on mips systems.

The problems go away with the following patch.

-Dale Farnsworth



Index: linux/include/linux/reiserfs_fs.h
===================================================================
RCS file: /cvsdev/hhl-2.4.17/linux/include/linux/reiserfs_fs.h,v
retrieving revision 1.3
diff -u -r1.3 reiserfs_fs.h
--- linux/include/linux/reiserfs_fs.h	2002/01/10 19:46:23	1.3
+++ linux/include/linux/reiserfs_fs.h	2002/03/27 21:59:07
@@ -847,7 +847,7 @@
 #define DEH_Visible 2
 
 /* 64 bit systems (and the S/390) need to be aligned explicitly -jdm */
-#if BITS_PER_LONG == 64 || defined(__s390__) || defined(__hppa__)
+#if BITS_PER_LONG == 64 || defined(__s390__) || defined(__hppa__) || defined(__mips__)
 #   define ADDR_UNALIGNED_BITS  (3)
 #endif
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mips requires alignment for ext2_*_bit functions
  2002-03-28 23:43 mips requires alignment for ext2_*_bit functions Dale Farnsworth
@ 2002-03-29  9:20 ` Oleg Drokin
  2002-03-29 17:10   ` Dale Farnsworth
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Drokin @ 2002-03-29  9:20 UTC (permalink / raw)
  To: Dale Farnsworth; +Cc: reiserfs-list

Hello!

On Thu, Mar 28, 2002 at 04:43:54PM -0700, Dale Farnsworth wrote:

> We see immediate alignment failures using reiserfs on mips systems.
> The problems go away with the following patch.

Thank you for the report.

The question is should all MIPS processors be threated this way or
is there are smaller subset that suffers from this problems
(and I believe kernel should allow unaligned accesses from inside of the kernel
itself (by emulating perhaps). That's what I learned from lkml recently)

> -#if BITS_PER_LONG == 64 || defined(__s390__) || defined(__hppa__)
> +#if BITS_PER_LONG == 64 || defined(__s390__) || defined(__hppa__) || defined(__mips__)

Bye,
    Oleg

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mips requires alignment for ext2_*_bit functions
  2002-03-29  9:20 ` Oleg Drokin
@ 2002-03-29 17:10   ` Dale Farnsworth
  0 siblings, 0 replies; 3+ messages in thread
From: Dale Farnsworth @ 2002-03-29 17:10 UTC (permalink / raw)
  To: Oleg Drokin; +Cc: Dale Farnsworth, reiserfs-list

On Fri, Mar 29, 2002 at 12:20:34PM +0300, Oleg Drokin wrote:
> Hello!
> 
> On Thu, Mar 28, 2002 at 04:43:54PM -0700, Dale Farnsworth wrote:
> 
> > We see immediate alignment failures using reiserfs on mips systems.
> > The problems go away with the following patch.
> 
> Thank you for the report.
> 
> The question is should all MIPS processors be threated this way or
> is there are smaller subset that suffers from this problems
> (and I believe kernel should allow unaligned accesses from inside of the kernel
> itself (by emulating perhaps). That's what I learned from lkml recently)
> 
> > -#if BITS_PER_LONG == 64 || defined(__s390__) || defined(__hppa__)
> > +#if BITS_PER_LONG == 64 || defined(__s390__) || defined(__hppa__) || defined(__mips__)
> 
> Bye,
>     Oleg

Hi Oleg,

Indeed, if unaligned accesses were supported for all accesses across all
archectures, we wouldn't need this #if at all.

Reiserfs uses ext2_set_bit()*.  There is no requirement for this
operation to be atomic.  However, some architectures, including s390 
and little-endian mips, implement it by calling test_and_set_bit(),
which is atomic.  On little-endian mips, test_and_set_bit() uses
the ll and sc instructions which have alignment requirements and
there is no way to efficiently emulate unaligned versions.

* Similarly for ext2_clear_bit(), and ext2_test_bit().

While it may be better in the long run to modify the ext2_*_bit()
functions, adding __mips__ to the current list is expedient and
consistent with the BITS_PER_LONG==64, __s390__, and __hppa__ cases.

-Dale

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-29 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-28 23:43 mips requires alignment for ext2_*_bit functions Dale Farnsworth
2002-03-29  9:20 ` Oleg Drokin
2002-03-29 17:10   ` Dale Farnsworth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.