From owner-freebsd-current Wed Feb 19 0:14:38 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A670A37B401 for ; Wed, 19 Feb 2003 00:14:35 -0800 (PST) Received: from phk.freebsd.dk (phk.freebsd.dk [212.242.86.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7801143F3F for ; Wed, 19 Feb 2003 00:14:34 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by phk.freebsd.dk (8.12.6/8.12.6) with ESMTP id h1J8EU6E089495 for ; Wed, 19 Feb 2003 08:14:30 GMT (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id h1J8ETOx076450 for ; Wed, 19 Feb 2003 09:14:30 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: current@freebsd.org Subject: Re: cvs commit: src/sys/alpha/alpha busdma_machdep.c src/sys/alpha/osf1 imgact_osf1.c osf1_misc.c src/sys/cam cam_periph.c cam_sim.c cam_xpt.c src/sys/cam/scsi scsi_cd.c scsi_ch.c scsi_da.c scsi_low.c scsi_sa.c scsi_target.c src/sys/coda cnode.h ... From: phk@phk.freebsd.dk In-Reply-To: Your message of "Tue, 18 Feb 2003 21:47:47 PST." <200302190547.h1J5ll1J064169@repoman.freebsd.org> Date: Wed, 19 Feb 2003 09:14:29 +0100 Message-ID: <76449.1045642469@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <200302190547.h1J5ll1J064169@repoman.freebsd.org>, Warner Losh write s: >imp 2003/02/18 21:47:47 PST > > Modified files: > [... everything ...] > uma_core.c vm_map.c vm_object.c > Log: > Back out M_* changes, per decision of the TRB. > > Approved by: trb The attached patch will print a backtrace if any calls to malloc fail to have either M_WAITOK or M_NOWAIT. Please put this patch in your tree and help fix any issues. So far (10 minutes) my disk-less testbox has found no issues. Poul-Henning Index: kern/kern_malloc.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_malloc.c,v retrieving revision 1.116 diff -u -r1.116 kern_malloc.c --- kern/kern_malloc.c 19 Feb 2003 05:47:25 -0000 1.116 +++ kern/kern_malloc.c 19 Feb 2003 07:55:19 -0000 @@ -167,11 +167,21 @@ #endif register struct malloc_type *ksp = type; + indx = flags & (M_WAITOK | M_NOWAIT); + if (indx == M_NOWAIT) { + /* OK */ + } else if (indx == M_WAITOK) { + /* OK */ + } else { + printf("Missing M_WAITOK flag\n"); + backtrace(); + flags |= M_WAITOK; + } #if 0 if (size == 0) Debugger("zero size malloc"); #endif - if (!(flags & M_NOWAIT)) + if (flags & M_WAITOK) KASSERT(curthread->td_intr_nesting_level == 0, ("malloc(M_WAITOK) in interrupt context")); if (size <= KMEM_ZMAX) { Index: sys/malloc.h =================================================================== RCS file: /home/ncvs/src/sys/sys/malloc.h,v retrieving revision 1.70 diff -u -r1.70 malloc.h --- sys/malloc.h 19 Feb 2003 05:47:45 -0000 1.70 +++ sys/malloc.h 19 Feb 2003 07:58:41 -0000 @@ -46,11 +46,11 @@ /* * flags to malloc. */ -#define M_WAITOK 0x0000 #define M_NOWAIT 0x0001 /* do not block */ -#define M_USE_RESERVE 0x0002 /* can alloc out of reserve memory */ -#define M_ZERO 0x0004 /* bzero the allocation */ -#define M_NOVM 0x0008 /* don't ask VM for pages */ +#define M_WAITOK 0x0002 /* do not block */ +#define M_ZERO 0x0100 /* bzero the allocation */ +#define M_NOVM 0x0200 /* don't ask VM for pages */ +#define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ #define M_MAGIC 877983977 /* time when first defined :-) */ -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message