public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Alignment of bitmaps for ext2_set_bit et al.
@ 2004-08-19 11:16 Paul Mackerras
  2004-08-19 11:22 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Mackerras @ 2004-08-19 11:16 UTC (permalink / raw)
  To: akpm, viro; +Cc: Olof Johansson, linux-kernel

What can we assume about the alignment of the bitmap pointer passed to
the ext2_{set,clear}_bit_atomic functions?  Can we assume that they
will be aligned to an long boundary (8 bytes on 64-bit)?

Olof has made a patch that uses atomics for these on ppc64 rather than
locking and unlocking a lock, but it will only work correctly if the
bitmap is always 8-byte aligned.

Paul.

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

* Re: Alignment of bitmaps for ext2_set_bit et al.
  2004-08-19 11:16 Alignment of bitmaps for ext2_set_bit et al Paul Mackerras
@ 2004-08-19 11:22 ` Andrew Morton
  2004-08-19 14:42   ` David S. Miller
  2004-08-19 20:39   ` Olof Johansson
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2004-08-19 11:22 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: viro, olof, linux-kernel

Paul Mackerras <paulus@samba.org> wrote:
>
> What can we assume about the alignment of the bitmap pointer passed to
> the ext2_{set,clear}_bit_atomic functions?  Can we assume that they
> will be aligned to an long boundary (8 bytes on 64-bit)?

For ext2 and ext3 it's safe to assume that they are 1024-byte aligned.

But it's possible that other filesystems are using these (awfully named)
functions.

Well.  I doubt if anyone is using the _atomic versions yet.

> Olof has made a patch that uses atomics for these on ppc64 rather than
> locking and unlocking a lock, but it will only work correctly if the
> bitmap is always 8-byte aligned.

Sounds sane, as long as you get firmly notified when a poorly-aligned
address is fed in.

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

* Re: Alignment of bitmaps for ext2_set_bit et al.
  2004-08-19 11:22 ` Andrew Morton
@ 2004-08-19 14:42   ` David S. Miller
  2004-08-19 20:39   ` Olof Johansson
  1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-08-19 14:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: paulus, viro, olof, linux-kernel

On Thu, 19 Aug 2004 04:22:34 -0700
Andrew Morton <akpm@osdl.org> wrote:

> Paul Mackerras <paulus@samba.org> wrote:
> >
> > What can we assume about the alignment of the bitmap pointer passed to
> > the ext2_{set,clear}_bit_atomic functions?  Can we assume that they
> > will be aligned to an long boundary (8 bytes on 64-bit)?
> 
> For ext2 and ext3 it's safe to assume that they are 1024-byte aligned.
> 
> But it's possible that other filesystems are using these (awfully named)
> functions.

FWIW, I've been using 4-byte word atomics for those routines
on sparc64 and have never gotten an unaligned trap for it yet.

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

* Re: Alignment of bitmaps for ext2_set_bit et al.
  2004-08-19 11:22 ` Andrew Morton
  2004-08-19 14:42   ` David S. Miller
@ 2004-08-19 20:39   ` Olof Johansson
  1 sibling, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2004-08-19 20:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Paul Mackerras, viro, linux-kernel

Andrew Morton wrote:

>Paul Mackerras <paulus@samba.org> wrote:
>  
>
>>Olof has made a patch that uses atomics for these on ppc64 rather than
>>locking and unlocking a lock, but it will only work correctly if the
>>bitmap is always 8-byte aligned.
>>    
>>
>
>Sounds sane, as long as you get firmly notified when a poorly-aligned
>address is fed in.
>  
>
The notification is in the form of an unalignment trap resulting in a 
panic, is that firm enough? :-)


-Olof

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

end of thread, other threads:[~2004-08-19 20:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-19 11:16 Alignment of bitmaps for ext2_set_bit et al Paul Mackerras
2004-08-19 11:22 ` Andrew Morton
2004-08-19 14:42   ` David S. Miller
2004-08-19 20:39   ` Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox