Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Sep 2023 22:25:39 +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:  <095B47B6-A6EE-4AC7-A91B-3E12E72B0CE6@FreeBSD.org>
In-Reply-To: <FE1791B6-C020-4578-B924-7002B2B3FDA9@FreeBSD.org>
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> <FE1791B6-C020-4578-B924-7002B2B3FDA9@FreeBSD.org>

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

--Apple-Mail=_4172FBA6-63CD-4596-B5A3-95D6667CC331
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



> On Sep 9, 2023, at 10:13 PM, Zhenlei Huang <zlei@FreeBSD.org> wrote:
>=20
>=20
>=20
>> On Sep 8, 2023, at 2:19 AM, Brooks Davis <brooks@freebsd.org =
<mailto: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 =
<mailto: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.
>=20
> No, we do NOT loss the run order.
>=20
> 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.
>=20
> That is somewhat not as flexible as previous sysinit array, or current =
`sysinit_done_list`.
>=20
> So IMO `sysinit_done_list` is still useful only for debugging, either =
DDB or kgdb.

Think about it twice. End user may have custom kernel config. It can be =
much useful when this system=20
has buggy sysinit order (not caught during dev / test), then a =
`sysinit_done_list` can ease the debugging
greatly.=20

>=20
>>=20
>> -- Brooks
>=20
> Best regards,
> Zhenlei




--Apple-Mail=_4172FBA6-63CD-4596-B5A3-95D6667CC331
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 9, 2023, at 10:13 PM, Zhenlei Huang &lt;<a =
href=3D"mailto:zlei@FreeBSD.org" class=3D"">zlei@FreeBSD.org</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><meta =
charset=3D"UTF-8" class=3D""><div style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; 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""><br =
class=3D"Apple-interchange-newline"><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""><span class=3D"" =
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;">On Wed, Sep 06, 2023 at =
06:46:59PM -0700, Colin Percival wrote:</span><br class=3D"" =
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;"><blockquote type=3D"cite" class=3D"" style=3D"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;">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 class=3D"" 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;"><span class=3D"" 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;">IMO =
loss of the run order in a dump was a (minor) regression so =
this</span><br class=3D"" 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;"><span class=3D"" 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;">should =
be unconditionally available.</span><br class=3D"" 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;"></div></blockquote><div class=3D""><br =
class=3D""></div><div class=3D"">No, we do NOT loss the run =
order.</div><div class=3D""><br class=3D""></div><div class=3D"">Given a =
kernel dump, we known its git commit hash, then the order of all sysinit =
is determined, unless</div><div class=3D"">we have non-stable sort =
of&nbsp;<span class=3D"" style=3D"caret-color: rgb(0, 0, =
0);">sysinits.</span></div><div class=3D""><span class=3D"" =
style=3D"caret-color: rgb(0, 0, 0);"><br class=3D""></span></div><div =
class=3D"">That is somewhat not as flexible as previous&nbsp;<span =
class=3D"" style=3D"caret-color: rgb(0, 0, 0);">sysinit array, or =
current `sysinit_done_list`.</span></div><div class=3D""><span class=3D"" =
style=3D"caret-color: rgb(0, 0, 0);"><br class=3D""></span></div><div =
class=3D""><span class=3D"" style=3D"caret-color: rgb(0, 0, =
0);">So&nbsp;</span><span class=3D"" style=3D"caret-color: rgb(0, 0, =
0);">IMO</span>&nbsp;<span class=3D"" style=3D"caret-color: rgb(0, 0, =
0);">`</span><span class=3D"" style=3D"caret-color: rgb(0, 0, =
0);">sysinit_done_list` is still useful only for debugging, either DDB =
or kgdb.</span></div></div></div></blockquote><div><br =
class=3D""></div><div>Think about it twice.&nbsp;<span =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D"">End =
user may&nbsp;</span><span style=3D"caret-color: rgb(0, 0, 0); color: =
rgb(0, 0, 0);" class=3D"">have custom kernel config.&nbsp;</span>It can =
be much useful when this system&nbsp;</div><div>has buggy sysinit order =
(not caught during dev / test), then a `sysinit_done_list` can ease the =
debugging</div><div>greatly.&nbsp;</div><br class=3D""><blockquote =
type=3D"cite" class=3D""><div class=3D""><div style=3D"caret-color: =
rgb(0, 0, 0); font-family: Helvetica; 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""><br class=3D""><blockquote =
type=3D"cite" class=3D""><div class=3D""><br class=3D"" =
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;"><span class=3D"" 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;">-- =
Brooks</span></div></blockquote></div><br class=3D"" style=3D"caret-color:=
 rgb(0, 0, 0); font-family: Helvetica; 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;"><div class=3D"" style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; 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;"><div class=3D"">Best regards,</div><div =
class=3D"">Zhenlei</div></div></div></blockquote></div><br class=3D""><div=
 class=3D"">
<div><br class=3D""></div>

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

--Apple-Mail=_4172FBA6-63CD-4596-B5A3-95D6667CC331--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?095B47B6-A6EE-4AC7-A91B-3E12E72B0CE6>