Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Apr 2015 13:15:01 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r280799 - head/sys/dev/ath
Message-ID:  <1754332.VQBJusLPhT@ralph.baldwin.cx>
In-Reply-To: <CAJ-Vmo=X2goTD8rdOK=sbWTNGmeAb=ddcHb6Rz7OsfoEBT2jKA@mail.gmail.com>
References:  <201503282341.t2SNfOZc032386@svn.freebsd.org> <2308891.2rLa0R7ktj@ralph.baldwin.cx> <CAJ-Vmo=X2goTD8rdOK=sbWTNGmeAb=ddcHb6Rz7OsfoEBT2jKA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, March 30, 2015 01:54:30 PM Adrian Chadd wrote:
> On 30 March 2015 at 13:32, John Baldwin <jhb@freebsd.org> wrote:
> > On Monday, March 30, 2015 10:10:43 AM Adrian Chadd wrote:
> >> Yes, because it's before the dynamic hint stuff starts up. (kern.hintmode.)
> >>
> >> Hints don't show up in kenv on the mips boards until I set the sysctl
> >> to the "import them now!" setting.
> >
> > Everything in if_ath.c happens well after SYSINITs are going.  Are you
> > explicitly forcing hintmode to 1 in your kernel config?  At least on
> > x86 it always is zero and always pulls from kenv.
> >
> > If this is magic that config does when you have static hints, then why
> > not have init_dynamic_kenv() call into subr_hints.c to pull all the
> > static hints into the kenv right away?  SI_SUB_KMEM is way, way before
> > any device drivers start doing anything.
> 
> This is on MIPS and not on x86. And yes, I checked - both arge and ath
> probe/attach get called with no hints in kenv (ie, static hints) and I
> don't recall the hintmode being explicitly set in a config file.
> 
> I'd love to make it work via hints calls; it'd significantly simplify things.

Note that all the hints processing is MI, so MIPS vs x86 shouldn't matter in
theory.

I think hintmode gets set to 1 "magically" by config if your kernel config
includes static hints.  (Looks like this is true, config will add
'hintmode = 1' in the hints.c it generates.)

I think what we should do is change the kenv code to basically do the equivalent
of forcing hintsmode to 2 once the dynamic kenv is ready (it has a SYSINIT for
this).  If you do that, I think it means you can remove the sysctl as it's
more or less useless then.  It will increase RAM usage a bit as you will have
the duplicate copy of hints in kenv, but hints aren't very large to begin
with.

You could also at that point replace hintsmode with a simple boolean
"use_static_hints" that gets cleared by the SYSINIT that fires to convert
static hints to kenv once dynamic kenv is ready.

-- 
John Baldwin



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