All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Zarochentsev <zam@namesys.com>
To: Jake Maciejewski <maciejej@msoe.edu>
Cc: reiserfs-list@namesys.com
Subject: Re: AMD64 progress?
Date: Fri, 14 Jan 2005 23:17:51 +0300	[thread overview]
Message-ID: <20050114201751.GB5883@backtop.namesys.com> (raw)
In-Reply-To: <1105594407.32495.8.camel@gentoo>

On Wed, Jan 12, 2005 at 11:33:27PM -0600, Jake Maciejewski wrote:
> There was mention of Namesys getting an AMD64 machine. Do you guys have
> it yet? Has there been any progress on my reiser4 bug(s), particularly
> the "reiser4_find_next_zero_bit(bnode_working_data(bnode), end_offset,
> start_offset) >= end_offset" problem?

can you test the following patch? I know that amd64 does not require
strong word aligment, but may be amd64 bitops coded in assembler 
do that?

===== plugin/space/bitmap.c 1.185 vs edited =====
--- 1.185/plugin/space/bitmap.c	Sun Dec  5 19:49:52 2004
+++ edited/plugin/space/bitmap.c	Fri Jan 14 23:15:53 2005
@@ -57,13 +57,15 @@
 
 #define CHECKSUM_SIZE    4
 
+#define BYTES_PER_LONG   (sizeof(long))
+
 #if BITS_PER_LONG == 64
 #  define LONG_INT_SHIFT (6)
 #else
 #  define LONG_INT_SHIFT (5)
 #endif
 
-#define LONG_INT_MASK (BITS_PER_LONG - 1)
+#define LONG_INT_MASK (BITS_PER_LONG - 1UL)
 
 typedef unsigned long ulong_t;
 
@@ -182,12 +184,41 @@
 
 #include <asm/bitops.h>
 
+#if BITS_PER_LONG == 64
+
+#define OFF(addr)  (((ulong_t)(addr) & (BYTES_PER_LONG - 1)) << 3)
+#define BASE(addr) ((ulong_t*) ((ulong_t)(addr) & ~(BYTES_PER_LONG - 1)))
+
+static inline void reiser4_set_bit(int nr, void * addr)
+{
+	ext2_set_bit(nr + OFF(addr), BASE(addr));
+}
+
+static inline void reiser4_clear_bit(int nr, void * addr)
+{
+	ext2_clear_bit(nr + OFF(addr), BASE(addr));
+}
+
+static inline int reiser4_test_bit(int nr, void * addr)
+{
+	return ext2_test_bit(nr + OFF(addr), BASE(addr));
+}
+static inline int reiser4_find_next_zero_bit(void * addr, int maxoffset, int offset) 
+{
+	int off = OFF(addr);
+
+	return ext2_find_next_zero_bit(BASE(addr), maxoffset + off, offset + off) - off;
+}
+
+#else
+
 #define reiser4_set_bit(nr, addr)    ext2_set_bit(nr, addr)
 #define reiser4_clear_bit(nr, addr)  ext2_clear_bit(nr, addr)
 #define reiser4_test_bit(nr, addr)  ext2_test_bit(nr, addr)
 
 #define reiser4_find_next_zero_bit(addr, maxoffset, offset) \
 ext2_find_next_zero_bit(addr, maxoffset, offset)
+#endif
 
 /* Search for a set bit in the bit array [@start_offset, @max_offset[, offsets
  * are counted from @addr, return the offset of the first bit if it is found,



  parent reply	other threads:[~2005-01-14 20:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-13  5:33 AMD64 progress? Jake Maciejewski
2005-01-14  0:03 ` David Masover
2005-01-14 20:17 ` Alex Zarochentsev [this message]
2005-01-14 22:58   ` Jake Maciejewski
2005-01-16  2:26   ` Isaac Chanin
2005-02-07 13:29     ` Alex Zarochentsev
2005-02-07 19:34       ` Jake Maciejewski
2005-02-07 19:51         ` Alex Zarochentsev
2005-02-08 18:25           ` Jake Maciejewski
2005-02-08 19:12             ` Alex Zarochentsev
2005-02-08 20:49               ` Jake Maciejewski
2005-02-08 20:29       ` Isaac Chanin

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=20050114201751.GB5883@backtop.namesys.com \
    --to=zam@namesys.com \
    --cc=maciejej@msoe.edu \
    --cc=reiserfs-list@namesys.com \
    /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 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.