On Sat, 2009-01-24 at 09:36 +0200, Pekka Enberg wrote:Pekka, Sorry for the late update. The default order of kmalloc-8192 on 2*4 stoakley is really an issue of calculate_order. slab_size order name ------------------------------------------------- 4096 3 sgpool-128 8192 2 kmalloc-8192 16384 3 kmalloc-16384 kmalloc-8192's default order is smaller than sgpool-128's. On 4*4 tigerton machine, a similiar issue appears on another kmem_cache. Function calculate_order uses 'min_objects /= 2;' to shrink. Plus size calculation/checking in slab_order, sometimes above issue appear. Below patch against 2.6.29-rc2 fixes it. I checked the default orders of all kmem_cache and they don't become smaller than before. So the patch wouldn't hurt performance. Signed-off-by Zhang Yanmin <yanmin.zhang@linux.intel.com> --- diff -Nraup linux-2.6.29-rc2/mm/slub.c linux-2.6.29-rc2_slubcalc_order/mm/slub.c --- linux-2.6.29-rc2/mm/slub.c 2009-02-11 00:49:48.000000000 -0500 +++ linux-2.6.29-rc2_slubcalc_order/mm/slub.c 2009-02-12 00:08:24.000000000 -0500 @@ -1856,6 +1856,7 @@ static inline int calculate_order(int si min_objects = slub_min_objects; if (!min_objects) min_objects = 4 * (fls(nr_cpu_ids) + 1); + min_objects = min(min_objects, (PAGE_SIZE << slub_max_order)/size); while (min_objects > 1) { fraction = 16; while (fraction >= 4) { @@ -1865,7 +1866,7 @@ static inline int calculate_order(int si return order; fraction /= 2; } - min_objects /= 2; + min_objects --; } /* -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Frans Pop | top displaying 9999% CPU usage |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Chuck Ebbert | Why do so many machines need "noapic"? |
| Andy Whitcroft | clam |
git: | |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Christoph Lameter | Network latency regressions from 2.6.22 to 2.6.29 |
