linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/24] Introduce little endian bitops
@ 2011-01-16 13:08 Akinobu Mita
  2011-01-16 13:08 ` [PATCH v4 01/24] bitops: merge little and big endian definisions in asm-generic/bitops/le.h Akinobu Mita
                   ` (24 more replies)
  0 siblings, 25 replies; 51+ messages in thread
From: Akinobu Mita @ 2011-01-16 13:08 UTC (permalink / raw)
  To: linux-kernel, linux-arch, akpm
  Cc: Akinobu Mita, Linus Torvalds, Russell King, Arnd Bergmann

The little-endian bitops patch series version 4 is available in the git
repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/mita/linux-2.6.git le-bitops-v4

Linus found the little-endian bitops patch series annoying for two reasons:

> - The naming.
>
>   Hiding that "little-endian" part in the middle of the name is just odd. 

This problem is fixed by changing to the post-fix notation
(e.g. s/test_le_bit/test_bit_le/)

>  - The change of prototype. This is replacing a function that just took a 
>    "void *" or something like that, but it replaces it with something that 
>    takes a "unsigned long *". Resulting in a patch like this:
> 
> > --- a/include/linux/ext3_fs.h~ext3-use-little-endian-bitops
> > +++ a/include/linux/ext3_fs.h
> > @@ -418,13 +418,18 @@ struct ext3_inode {
> >  #define EXT2_MOUNT_DATA_FLAGS		EXT3_MOUNT_DATA_FLAGS
> >  #endif
> >  
> > -#define ext3_set_bit			ext2_set_bit
> > +#define ext3_set_bit(nr, addr)	\
> > +	__test_and_set_le_bit((nr), (unsigned long *)(addr))
> 
> Where for the life of me I can't say that I think the new code is better 
> than the old code. Quite the reverse.

This problem is not touched.

ext2_set_bit and other ext2_*_bit functions took a "void *", but
they implicitly need a long aligned address.
Because almost all architectures defined them as

#define ext2_set_bit(nr, addr) \
       __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)

The little-endian bitops takes a "unsigned long *" because
it can ensure the correct result only for a long aligned address.
It is better than ext2 bitops which takes a "void *" but it can't
ensure the correct result for an unaligned address.

So the explicit cast is better than no cast that implicitly needs
aligned address.

Adding new bitops like *_bit_le_unaligned(int nr, void *addr) may be
usefull.  But using such bitops here introduces unwanted overhead.

Changelog:

 * v4
 - change to the post-fix notation e.g. s/test_le_bit/test_bit_le/
 - introduce CONFIG_GENERIC_FIND_BIT_LE
 - fix m68knommu build
 - fix inefficienct find_first_zero_le_bit()

 * v3
 - add Acked-by: lines

 * v2
(cover letter for v2 was not delivered to any mailing lists I've CCed may be
due to Too many recipients to the message)
 - fix argument of test_and_{set,clear}_le_bit() for s390, arm, m68k
 - move ext2 bitops to fs/ext2/ext2.h, not include/linux/ext2_fs.h
 - fix m68k minix bitops incorrect conversion noticed by Andreas Schwab
 - rewrite minix bitops removal patch based on the suggestion by Arnd

This patch series introduces little-endian bit operations in asm/bitops.h
for all architectures and converts all ext2 non-atomic and minix bit
operations to use little-endian bit operations.  It enables us to remove
ext2 non-atomic and minix bit operations from asm/bitops.h.  The reason
they should be removed from asm/bitops.h is as follows:

For ext2 non-atomic bit operations, they are used for little-endian byte
order bitmap access by some filesystems and modules.  But using ext2_*()
functions on a module other than ext2 filesystem makes some feel strange.
The other problem is that they take a "void *" but implicitly need a long
aligned address.

For minix bit operations, they are only used by minix filesystem and are
useless by other modules.  Because byte order of inode and block bitmap is
different on each architecture.

Akinobu Mita (24):
  bitops: merge little and big endian definisions in
    asm-generic/bitops/le.h
  asm-generic: rename generic little-endian bitops functions
  powerpc: introduce little-endian bitops
  s390: introduce little-endian bitops
  arm: introduce little-endian bitops
  m68k: introduce little-endian bitops
  bitops: introduce CONFIG_GENERIC_FIND_BIT_LE
  m68knommu: introduce little-endian bitops
  bitops: introduce little-endian bitops for most architectures
  rds: stop including asm-generic/bitops/le.h
  kvm: stop including asm-generic/bitops/le.h
  asm-generic: use little-endian bitops
  ext3: use little-endian bitops
  ext4: use little-endian bitops
  ocfs2: use little-endian bitops
  nilfs2: use little-endian bitops
  reiserfs: use little-endian bitops
  udf: use little-endian bitops
  ufs: use little-endian bitops
  md: use little-endian bit operations
  dm: use little-endian bit operations
  bitops: remove ext2 non-atomic bitops from asm/bitops.h
  m68k: remove inline asm from minix_find_first_zero_bit
  bitops: remove minix bitops from asm/bitops.h

 arch/alpha/include/asm/bitops.h              |    4 +-
 arch/arm/include/asm/bitops.h                |   50 ++++++--------
 arch/avr32/include/asm/bitops.h              |    3 +-
 arch/avr32/kernel/avr32_ksyms.c              |    4 +-
 arch/avr32/lib/findbit.S                     |    4 +-
 arch/blackfin/include/asm/bitops.h           |    3 +-
 arch/cris/include/asm/bitops.h               |    3 +-
 arch/frv/Kconfig                             |    4 +
 arch/frv/include/asm/bitops.h                |    4 +-
 arch/h8300/Kconfig                           |    4 +
 arch/h8300/include/asm/bitops.h              |    3 +-
 arch/ia64/include/asm/bitops.h               |    3 +-
 arch/m32r/Kconfig                            |    4 +
 arch/m32r/include/asm/bitops.h               |    3 +-
 arch/m68k/include/asm/bitops_mm.h            |   89 ++++++++++----------------
 arch/m68k/include/asm/bitops_no.h            |   28 +++++----
 arch/microblaze/Kconfig                      |    3 +
 arch/mips/Kconfig                            |    4 +
 arch/mips/include/asm/bitops.h               |    3 +-
 arch/mn10300/include/asm/bitops.h            |    3 +-
 arch/parisc/Kconfig                          |    4 +
 arch/parisc/include/asm/bitops.h             |    4 +-
 arch/powerpc/Kconfig                         |    4 +
 arch/powerpc/include/asm/bitops.h            |   53 ++++------------
 arch/s390/include/asm/bitops.h               |   45 ++++++++------
 arch/sh/Kconfig                              |    3 +
 arch/sh/include/asm/bitops.h                 |    3 +-
 arch/sparc/Kconfig                           |    4 +
 arch/sparc/include/asm/bitops_32.h           |    3 +-
 arch/sparc/include/asm/bitops_64.h           |    4 +-
 arch/tile/include/asm/bitops.h               |    3 +-
 arch/x86/include/asm/bitops.h                |    4 +-
 arch/xtensa/Kconfig                          |    3 +
 arch/xtensa/include/asm/bitops.h             |    3 +-
 drivers/md/bitmap.c                          |    6 +-
 drivers/md/dm-log.c                          |    8 +-
 fs/ext2/ext2.h                               |   11 +++
 fs/ext4/ext4.h                               |   18 ++++--
 fs/minix/Kconfig                             |    8 ++
 fs/minix/minix.h                             |   79 +++++++++++++++++++++++
 fs/nilfs2/alloc.h                            |    3 +-
 fs/ocfs2/ocfs2.h                             |   13 ++--
 fs/udf/balloc.c                              |   11 ++-
 fs/ufs/util.h                                |    2 +-
 include/asm-generic/bitops.h                 |    3 +-
 include/asm-generic/bitops/ext2-atomic.h     |    4 +-
 include/asm-generic/bitops/ext2-non-atomic.h |   20 ------
 include/asm-generic/bitops/le.h              |   60 ++++++++----------
 include/asm-generic/bitops/minix-le.h        |   17 -----
 include/asm-generic/bitops/minix.h           |   15 ----
 include/linux/ext3_fs.h                      |   15 +++--
 include/linux/reiserfs_fs.h                  |   34 ++++++----
 lib/Kconfig                                  |    3 +
 lib/Makefile                                 |    1 +
 lib/find_next_bit.c                          |   12 ++--
 net/rds/cong.c                               |    8 +--
 virt/kvm/kvm_main.c                          |    3 +-
 57 files changed, 378 insertions(+), 342 deletions(-)
 delete mode 100644 include/asm-generic/bitops/ext2-non-atomic.h
 delete mode 100644 include/asm-generic/bitops/minix-le.h
 delete mode 100644 include/asm-generic/bitops/minix.h

-- 
1.7.3.4

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

end of thread, other threads:[~2011-01-18  9:49 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-16 13:08 [PATCH v4 00/24] Introduce little endian bitops Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 01/24] bitops: merge little and big endian definisions in asm-generic/bitops/le.h Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 02/24] asm-generic: rename generic little-endian bitops functions Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 03/24] powerpc: introduce little-endian bitops Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 04/24] s390: " Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 05/24] arm: " Akinobu Mita
2011-01-16 17:51   ` Russell King
2011-01-16 17:51     ` Russell King
2011-01-17  2:36     ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 06/24] m68k: " Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 07/24] bitops: introduce CONFIG_GENERIC_FIND_BIT_LE Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 08/24] m68knommu: introduce little-endian bitops Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 09/24] bitops: introduce little-endian bitops for most architectures Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 21:18   ` H. Peter Anvin
2011-01-17 10:01   ` Hans-Christian Egtvedt
2011-01-17 10:01     ` Hans-Christian Egtvedt
2011-01-16 13:08 ` [PATCH v4 10/24] rds: stop including asm-generic/bitops/le.h Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 11/24] kvm: " Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 12/24] asm-generic: use little-endian bitops Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 13/24] ext3: " Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 14/24] ext4: " Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 15/24] ocfs2: " Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 16/24] nilfs2: " Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 17/24] reiserfs: " Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 18/24] udf: " Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 19/24] ufs: " Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 20/24] md: use little-endian bit operations Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 21/24] dm: " Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 22/24] bitops: remove ext2 non-atomic bitops from asm/bitops.h Akinobu Mita
2011-01-16 13:08   ` Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 23/24] m68k: remove inline asm from minix_find_first_zero_bit Akinobu Mita
2011-01-16 13:08 ` [PATCH v4 24/24] bitops: remove minix bitops from asm/bitops.h Akinobu Mita
2011-01-16 18:57 ` [PATCH v4 00/24] Introduce little endian bitops Linus Torvalds
2011-01-16 18:57   ` Linus Torvalds
2011-01-17  2:37   ` Akinobu Mita
2011-01-17  2:50     ` Linus Torvalds
2011-01-17  9:34       ` Russell King
2011-01-17  9:34         ` Russell King
2011-01-18  9:49         ` Akinobu Mita
2011-01-18  9:49           ` Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).