Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Nov 2019 15:23:17 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Gary Jennejohn <gljennjohn@gmail.com>
Cc:        Michael Gmelin <freebsd@grem.de>, "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>,  "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: Killing Giant for 13
Message-ID:  <CANCZdfoOXXd88kaJtkHfkfmdCkv2WnoXZBNedjyEOb8jxGK==A@mail.gmail.com>
In-Reply-To: <20191126194750.3ff939c3@ernst.home>
References:  <CANCZdfr0CpDBQ6QWJ_CTtOLW6EwAke_Vr_imqa5=GBzRAoa6eA@mail.gmail.com> <201911260917.xAQ9Hcf1001914@gndrsh.dnsmgr.net> <CANCZdfowGPBgp14aaJ15GnYOkRb_C91AeRqFY-axqu%2BCOScz8w@mail.gmail.com> <20191126193555.047a63cf@bsd64.grem.de> <20191126194750.3ff939c3@ernst.home>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 26, 2019 at 11:47 AM Gary Jennejohn <gljennjohn@gmail.com>
wrote:

> On Tue, 26 Nov 2019 19:35:55 +0100
> Michael Gmelin <freebsd@grem.de> wrote:
>
> > On Tue, 26 Nov 2019 11:21:20 -0700
> > Warner Losh <imp@bsdimp.com> wrote:
> >
> >
> > > However, the hpt27xx driver turns out not to be Giant locked on
> > > versions of FreeBSD >= 10. So it's off the list.
> >
> > Is that a real list that could be made publicly available, so users can
> > check if any of the hardware they use will be affected?
> >
>
> cd /usr/src/sys
> grep -Rl D_NEEDGIANT (assuming the user has the right permissions)
>
> Drivers which use GIANT have this somewhere in their code.
>
> I found 30 C file hits in HEAD.
>

Yea, about 25 drivers, 5 of which look to be trivial to change over, some
already have. It used to be the case that all dev_t's in the tree were
marked NEEDGIANT because they did things like check permissions or other
such things that required Giant and this was easier than narrowing it down
to just the little bit of code that needed it...

And then there's all the interrupt handlers that aren't marked MPSAFE...
how to grep for that? I think I may invent a NEEDS_GIANT sort of thing in
preference to MPSAFE.

And then there's sysctl proc handlers not marked safe. Same notion as the
interrupt handlers.

And finally all the direct use of the Giant lock, most of which I'll
replace by a bus_lock()/bus_unlock() API, or are for the kbd / console mess
(which I'll likely replace with another wrapper), and then the odd driver
that needs Giant for some reason (I think there's 2 or 3 of these).

That's the audit I wanted to get done before posting next steps.

Warner



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