Date: Thu, 5 Jul 2007 07:30:12 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 122915 for review Message-ID: <200707050730.l657UCTc017254@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122915 Change 122915 by kmacy@kmacy_vt-x:opentoe_init on 2007/07/05 07:29:17 add interface to support physically contiguous backend allocator for zones Affected files ... .. //depot/projects/opentoe/sys/vm/uma.h#2 edit .. //depot/projects/opentoe/sys/vm/uma_core.c#4 edit Differences ... ==== //depot/projects/opentoe/sys/vm/uma.h#2 (text+ko) ==== @@ -483,6 +483,8 @@ void uma_zone_set_freef(uma_zone_t zone, uma_free freef); +void uma_zone_set_contig(uma_zone_t zone); + /* * These flags are setable in the allocf and visable in the freef. */ ==== //depot/projects/opentoe/sys/vm/uma_core.c#4 (text+ko) ==== @@ -957,6 +957,31 @@ return (p); } +static void * +uma_zone_contig_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) +{ + int malloc_flags; + + *flags = UMA_SLAB_PRIV; + malloc_flags = (wait ? M_WAITOK : M_NOWAIT); + + return (contigmalloc(bytes, M_DEVBUF, malloc_flags, 0x0ULL, + 0xffffffffffffULL, 1, 0)); +} + +static void +uma_zone_contig_free(void *mem, int size, u_int8_t flags) +{ + contigfree(mem, size, M_DEVBUF); +} + +void +uma_zone_set_contig(uma_zone_t zone) +{ + uma_zone_set_allocf(zone, uma_zone_contig_alloc); + uma_zone_set_freef(zone, uma_zone_contig_free); + +} /* * Allocates a number of pages from within an object *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707050730.l657UCTc017254>