Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Sep 2023 22:13:46 +0800
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        Colin Percival <cperciva@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: 1926d5cef6ea - main - init_main: Record completed SYSINITs
Message-ID:  <FE1791B6-C020-4578-B924-7002B2B3FDA9@FreeBSD.org>
In-Reply-To: <ZPoUK6UOd7S4T1Vo@spindle.one-eyed-alien.net>
References:  <202309061837.386Ib5AK086264@gitrepo.freebsd.org> <5BC96D9F-E4C4-4D34-B7B3-41576AD296DA@FreeBSD.org> <dc68e74c-43ff-31ad-42f8-6790eddc0301@freebsd.org> <ZPoUK6UOd7S4T1Vo@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_CD835773-8AD4-41BF-9806-5410F5B78A3A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



> On Sep 8, 2023, at 2:19 AM, Brooks Davis <brooks@freebsd.org> wrote:
>=20
> On Wed, Sep 06, 2023 at 06:46:59PM -0700, Colin Percival wrote:
>> On 9/6/23 18:12, Zhenlei Huang wrote:
>>>> On Sep 7, 2023, at 2:37 AM, Colin Percival <cperciva@FreeBSD.org> =
wrote:
>>>>    init_main: Record completed SYSINITs
>>>>=20
>>>>    When removing them from sysinit_list, append them to =
sysinit_done_list;
>>>>    print this list from 'show sysinit' along with the list of =
future
>>>>    sysinits.
>>>=20
>>> So the `sysinit_done_list` is for DDB only.
>>=20
>> Well... sort of.  You can open up kgdb and run 'p sysinit_done_list'.
>>=20
>>>> static STAILQ_HEAD(sysinitlist, sysinit) sysinit_list;
>>>> +static struct sysinitlist sysinit_done_list =3D
>>>> +    STAILQ_HEAD_INITIALIZER(sysinit_done_list);
>>>=20
>>> Then it should be wrapped around with #ifdef DDB and #endif
>> I considered that, but since we're literally talking about 2 pointers =
of
>> memory I figured it wasn't worth making it conditional.
>=20
> IMO loss of the run order in a dump was a (minor) regression so this
> should be unconditionally available.

No, we do NOT loss the run order.

Given a kernel dump, we known its git commit hash, then the order of all =
sysinit is determined, unless
we have non-stable sort of sysinits.

That is somewhat not as flexible as previous sysinit array, or current =
`sysinit_done_list`.

So IMO `sysinit_done_list` is still useful only for debugging, either =
DDB or kgdb.

>=20
> -- Brooks

Best regards,
Zhenlei


--Apple-Mail=_CD835773-8AD4-41BF-9806-5410F5B78A3A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On Sep 8, 2023, at 2:19 AM, Brooks Davis &lt;<a =
href=3D"mailto:brooks@freebsd.org" class=3D"">brooks@freebsd.org</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><meta =
charset=3D"UTF-8" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 13px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">On Wed, Sep 06, 2023 at 06:46:59PM -0700, Colin Percival =
wrote:</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><blockquote type=3D"cite" style=3D"font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D"">On =
9/6/23 18:12, Zhenlei Huang wrote:<br class=3D""><blockquote type=3D"cite"=
 class=3D""><blockquote type=3D"cite" class=3D"">On Sep 7, 2023, at 2:37 =
AM, Colin Percival &lt;<a href=3D"mailto:cperciva@FreeBSD.org" =
class=3D"">cperciva@FreeBSD.org</a>&gt; wrote:<br =
class=3D"">&nbsp;&nbsp;&nbsp;init_main: Record completed SYSINITs<br =
class=3D""><br class=3D"">&nbsp;&nbsp;&nbsp;When removing them from =
sysinit_list, append them to sysinit_done_list;<br =
class=3D"">&nbsp;&nbsp;&nbsp;print this list from 'show sysinit' along =
with the list of future<br class=3D"">&nbsp;&nbsp;&nbsp;sysinits.<br =
class=3D""></blockquote><br class=3D"">So the `sysinit_done_list` is for =
DDB only.<br class=3D""></blockquote><br class=3D"">Well... sort of. =
&nbsp;You can open up kgdb and run 'p sysinit_done_list'.<br =
class=3D""><br class=3D""><blockquote type=3D"cite" class=3D""><blockquote=
 type=3D"cite" class=3D"">static STAILQ_HEAD(sysinitlist, sysinit) =
sysinit_list;<br class=3D"">+static struct sysinitlist sysinit_done_list =
=3D<br class=3D"">+ =
&nbsp;&nbsp;&nbsp;STAILQ_HEAD_INITIALIZER(sysinit_done_list);<br =
class=3D""></blockquote><br class=3D"">Then it should be wrapped around =
with #ifdef DDB and #endif<br class=3D""></blockquote>I considered that, =
but since we're literally talking about 2 pointers of<br class=3D"">memory=
 I figured it wasn't worth making it conditional.<br =
class=3D""></blockquote><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 13px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, =
0); font-family: Menlo-Regular; font-size: 13px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">IMO loss of the run order in a dump was a (minor) regression =
so this</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">should be =
unconditionally available.</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 13px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""></div></blockquote><div><br =
class=3D""></div><div>No, we do NOT loss the run order.</div><div><br =
class=3D""></div><div>Given a kernel dump, we known its git commit hash, =
then the order of all sysinit is determined, unless</div><div>we have =
non-stable sort of&nbsp;<span style=3D"caret-color: rgb(0, 0, 0); color: =
rgb(0, 0, 0);" class=3D"">sysinits.</span></div><div><span =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D""><br =
class=3D""></span></div><div>That is somewhat not as flexible as =
previous&nbsp;<span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0);" class=3D"">sysinit array, or current =
`sysinit_done_list`.</span></div><div><span style=3D"caret-color: rgb(0, =
0, 0); color: rgb(0, 0, 0);" class=3D""><br =
class=3D""></span></div><div><span style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0);" class=3D"">So&nbsp;</span><span =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" =
class=3D"">IMO</span>&nbsp;<span style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0);" class=3D"">`</span><span style=3D"caret-color: =
rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D"">sysinit_done_list` is =
still useful only for debugging, either DDB or kgdb.</span></div><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 13px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">-- =
Brooks</span></div></blockquote></div><br class=3D""><div class=3D"">
<div>Best regards,</div><div>Zhenlei</div>

</div>
<br class=3D""></body></html>=

--Apple-Mail=_CD835773-8AD4-41BF-9806-5410F5B78A3A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE1791B6-C020-4578-B924-7002B2B3FDA9>