lkml.org 
[lkml]   [2003]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] mm/slab.c, kernel <2.4.20>
/**
* --readme--
* make a better initial value for i, which will
reduce the number of
while loop.
* the change can be proved mathematically:
*
* i*size + L1_CACHE_ALIGN(base+i*extra) <= wastage
* ==> i*size + base + i*extra <= wastage
* ==> solve about equation about i
* ==> i <= (wastage - base) / (size + extra)
*
* Chen Shang
* shangcs@yahoo.com
*/

--- slab.c 2003-02-08 04:26:50.000000000 -0500
+++ slab.c 2003-02-08 04:26:14.000000000 -0500
@@ -397,7 +397,7 @@
base = sizeof(slab_t);
extra = sizeof(kmem_bufctl_t);
}
- i = 0;
+ i = (wastage - base) / (size + extra);
while (i*size + L1_CACHE_ALIGN(base+i*extra) <=
wastage)
i++;
if (i > 0)
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.022 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site