Re: GCC proposal for "@" asm constraint

From: Andrea Arcangeli (andrea@suse.de)
Date: Fri Sep 22 2000 - 13:42:55 EST


On Fri, Sep 22, 2000 at 11:08:21AM -0700, Linus Torvalds wrote:
> The same is true in the filesystems - many of them want to change block or
> inode allocation bitmap bits, but they have to hold a lock anyway (usually
> the kernel lock in addition to the superblock lock.

The patch addresses the filesystems case introducing __set_bit,
__test_and_clear_bit and __test_and_set_bit and it infact starts the split
of the bitops.

In the patch the __*_bit non atomic API isn't fully implemented though
(__clear_bit, __test_and_change_bit are missing for example) and no common code
is using the current __*_bit nonatomic variant of the bitops directly anyway.
The fs happens to use it because of the minix_* ext2_* macros in the arch
specific part). Finishing implementing the nonatomic bitops is very easy and I
agree it's good idea (I'll soon upload an incremental patch to implement the
few missing __*_bit calls) and then the common code (like the alloc/free as you
pointed out) can start using the __ variant to allow the compiler not to trash
registers and to skip SMP locks when not necessary.

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:27 EST