[PATCH] micro-opt DEBUG_ADD_PAGE

From: Hugh Dickins (hugh@veritas.com)
Date: Wed Feb 07 2001 - 13:00:40 EST


On Tue, 6 Feb 2001, Linus Torvalds wrote:
> > - if (bh->b_size % correct_size) {
> > + if (bh->b_size != correct_size) {
>
> Actually, I'd rather leave it in, but speed it up with the saner and
> faster if (bh->b_size & (correct_size-1)) {

Micro-optimization season?

--- linux-2.4.2-pre1/include/linux/swap.h Wed Feb 7 15:21:13 2001
+++ linux/include/linux/swap.h Wed Feb 7 17:21:25 2001
@@ -200,8 +200,8 @@
  * with the pagemap_lru_lock held!
  */
 #define DEBUG_ADD_PAGE \
- if (PageActive(page) || PageInactiveDirty(page) || \
- PageInactiveClean(page)) BUG();
+ if ((page)->flags & ((1<<PG_active)|(1<<PG_inactive_dirty)| \
+ (1<<PG_inactive_clean))) BUG();
 
 #define ZERO_PAGE_BUG \
         if (page_count(page) == 0) BUG();

-
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 : Wed Feb 07 2001 - 21:00:27 EST