Re: PATCH: Improvements in shrink_mmap and kswapd

From: Roger Larsson (roger.larsson@norran.net)
Date: Sat Jun 17 2000 - 18:30:17 EST


> diff -urN --exclude-from=/home/lfcia/quintela/work/kernel/exclude base/include/asm-i386/bitops.h working/include/asm-i386/bitops.h
> --- base/include/asm-i386/bitops.h Sat Jun 17 23:37:03 2000
> +++ working/include/asm-i386/bitops.h Sat Jun 17 23:52:49 2000
> @@ -29,6 +29,7 @@
> extern void change_bit(int nr, volatile void * addr);
> extern int test_and_set_bit(int nr, volatile void * addr);
> extern int test_and_clear_bit(int nr, volatile void * addr);
> +extern int test_and_test_and_clear_bit(int nr, volatile void * addr);
> extern int test_and_change_bit(int nr, volatile void * addr);
> extern int __constant_test_bit(int nr, const volatile void * addr);
> extern int __test_bit(int nr, volatile void * addr);
> @@ -87,6 +88,13 @@
> :"=r" (oldbit),"=m" (ADDR)
> :"Ir" (nr));
> return oldbit;
> +}
> +
> +extern __inline__ int test_and_test_and_clear_bit(int nr, volatile void *addr)
> +{
> + if(!(((unsigned long)addr) & (1<<nr)))
> + return 0;
> + return test_and_clear_bit(nr,addr);
> }

This does not look correct. It basically tests if the ADDRESS has bit
#nr set...

Shouldn't it be
+ if(!(((unsigned long)*addr) & (1<<nr)))

/RogerL

--
Home page:
  http://www.norran.net/nra02596/

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



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:15 EST