Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Nov 2003 23:38:06 +0100
From:      Max Laier <max@love2party.net>
To:        current@freebsd.org
Subject:   zone(9) is broken on SMP?!
Message-ID:  <112547218.20031126233806@love2party.net>

index | next in thread | raw e-mail

[-- Attachment #1 --]
If I build attached kmod and kldload/-unload it on a GENERIC kernel w/
SMP & apic it'll error out:
"Zone was not empty (xx items).  Lost X pages of memory."

w/o SMP & apic the problem disappears.

This is on a p4 HTT, but seems reproducible on "proper" SMP systems as
well. UP systems don't show it however.

Can somebody please try and report? Thanks!

-- 
Best regards,
 Max                          mailto:max@love2party.net
[-- Attachment #2 --]
KMOD=	umatest

SRCS = uma_test.c

.include <bsd.kmod.mk>
[-- Attachment #3 --]
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/queue.h>
#include <vm/uma.h>

struct umat_item {
	char data[20];
} *ui;

uma_zone_t	umat_zone;

static int
umat_modevent(module_t mod, int type, void *data)
{
	int error = 0;

	switch (type) {
	case MOD_LOAD:
		umat_zone = uma_zcreate("UMA test zone",
		    sizeof(struct umat_item),
		    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
		if (umat_zone == NULL)
			error = ENOMEM;
		ui = uma_zalloc(umat_zone, M_NOWAIT);
		if (ui == NULL)
			error = ENOMEM;
		break;
	case MOD_UNLOAD:
		uma_zfree(umat_zone, ui);
		uma_zdestroy(umat_zone);
		break;
	default:
		error = EINVAL;
		break;
	}
	
	return error;
}

static moduledata_t umat_mod = {
	"umatest",
	umat_modevent,
	0,
};

DECLARE_MODULE(umatest, umat_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?112547218.20031126233806>