Messages in this thread | | | Date | Tue, 09 Nov 1999 16:36:25 -0500 | From | Jeff Garzik <> | Subject | Re: PATCH 2.3.26: kmalloc GFP_ZERO |
| |
Andrea Arcangeli wrote: > > On Tue, 9 Nov 1999 yodaiken@chelm.cs.nmt.edu wrote: > > >> Are you still talking about a cache of zeroed pages? Looks a bad idea to > >> me. > > > >The numbers say otherwise. > > So you are benchmarking a machine that spend time in the idle task. > > If you benchmarked a kernel compile make sure to compile with: > > make MAKE='make -j4' -j4 bzImage > > Then the numbers will agree with me (if you won't hit swap). Also make > sure to apply my SMP scheduler patch in the aa patches. > > >The idle task will build a cache of zeroed pages. If nothing is in the > >cache, you pay the standard cost. > > You'll also pay the check to see if the pool is empty before doing the > memset by hand. You'll take the slow path in the case worth to optimize.
If you add "kcalloc" instead of hacking "kmalloc" as I did, drivers wanting zeroed pages make the conscious decision of calling another function, with a potentially slower path.
Such a split would also make it easier to enumerate architecture-dependent paths. For some architectures may choose the default -- kmalloc+memset -- and other archs can choose a page-zeroing idle task, all without affecting kmalloc/kmem_cache_alloc
-- Jeff Garzik | Just once, I wish we would encounter Building 1024 | an alien menace that wasn't immune to MandrakeSoft, Inc. | bullets. -- The Brigadier, "Dr. Who"
- 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/
| |