Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Apr 2014 11:21:04 -1000 (HST)
From:      Jeff Roberson <jroberson@jroberson.net>
To:        Navdeep Parhar <np@FreeBSD.org>
Cc:        freebsd-hackers@freebsd.org, Jeff Roberson <jeff@FreeBSD.org>
Subject:   Re: vmem(9) with M_FIRSTFIT
Message-ID:  <alpine.BSF.2.00.1404161120400.69862@desktop>
In-Reply-To: <534EF4DD.4000200@FreeBSD.org>
References:  <534EF4DD.4000200@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 16 Apr 2014, Navdeep Parhar wrote:

> I'm trying to use vmem with M_FIRSTFIT strategy but it causes an
> assertion failure in vmem_xalloc.  The problem is that qc_import sets
> M_BESTFIT in the flags passed to it before passing them on to
> vmem_xalloc.  vmem_xalloc then complains because both FIRSTFIT and
> BESTFIT are set.
>
> Does anyone know why qc_import insists on M_BESTFIT?  Is it safe to
> change it as shown here?

Likely just an oversight on my part.

>
> if ((flags & VMEM_FITMASK) == 0)
> 	flags |= M_BESTFIT;

This seems fine.

Jeff

>
> Regards,
> Navdeep
>
>
> (kgdb) p panicstr
> $4 = 0xffffffff814ed960 "Assertion strat == M_BESTFIT || strat ==
> M_FIRSTFIT failed at /usr/src/sys/kern/subr_vmem.c:1113"
> (kgdb) bt
> ...
> #10 0xffffffff808e2a38 in kassert_panic (fmt=<value optimized out>) at
> /usr/src/sys/kern/kern_shutdown.c:644
> #11 0xffffffff80931ac4 in vmem_xalloc (vm=0xfffff800cc1dd000,
> size0=<value optimized out>, align=0, phase=0,
>    nocross=0, minaddr=0, maxaddr=<value optimized out>, flags=<value
> optimized out>, addrp=0x12)
>    at /usr/src/sys/kern/subr_vmem.c:1113
> #12 0xffffffff80933bcc in qc_import (arg=0xfffff800cc1dd488,
> store=0xfffff800475a6418, cnt=125,
>    flags=<value optimized out>) at /usr/src/sys/kern/subr_vmem.c:507
> #13 0xffffffff80b5ee00 in uma_zalloc_arg (zone=0xfffff8001345d480,
> udata=0x0, flags=4097)
>    at /usr/src/sys/vm/uma_core.c:2535
> #14 0xffffffff809319e9 in vmem_alloc (vm=0xfffff800cc1dd000, size=<value
> optimized out>, flags=4097,
>    addrp=0xfffffe0238422868) at uma.h:336
> #15 0xffffffff809a955c in do_setopt_tx_throttle (so=0xfffff80047b95000,
> sopt=<value optimized out>)
>    at /usr/src/sys/net/flow_throttle.c:379
> ...
>



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