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

[-- Attachment #1 --]


> On Sep 8, 2023, at 2:19 AM, Brooks Davis <brooks@freebsd.org> wrote:
> 
> 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
>>>> 
>>>>    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.
>>> 
>>> So the `sysinit_done_list` is for DDB only.
>> 
>> Well... sort of.  You can open up kgdb and run 'p sysinit_done_list'.
>> 
>>>> static STAILQ_HEAD(sysinitlist, sysinit) sysinit_list;
>>>> +static struct sysinitlist sysinit_done_list =
>>>> +    STAILQ_HEAD_INITIALIZER(sysinit_done_list);
>>> 
>>> 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.
> 
> 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.

> 
> -- Brooks

Best regards,
Zhenlei


[-- Attachment #2 --]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 8, 2023, at 2:19 AM, Brooks Davis &lt;<a href="mailto:brooks@freebsd.org" class="">brooks@freebsd.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="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="">On Wed, Sep 06, 2023 at 06:46:59PM -0700, Colin Percival wrote:</span><br style="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=""><blockquote type="cite" style="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="">On 9/6/23 18:12, Zhenlei Huang wrote:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On Sep 7, 2023, at 2:37 AM, Colin Percival &lt;<a href="mailto:cperciva@FreeBSD.org" class="">cperciva@FreeBSD.org</a>&gt; wrote:<br class="">&nbsp;&nbsp;&nbsp;init_main: Record completed SYSINITs<br class=""><br class="">&nbsp;&nbsp;&nbsp;When removing them from sysinit_list, append them to sysinit_done_list;<br class="">&nbsp;&nbsp;&nbsp;print this list from 'show sysinit' along with the list of future<br class="">&nbsp;&nbsp;&nbsp;sysinits.<br class=""></blockquote><br class="">So the `sysinit_done_list` is for DDB only.<br class=""></blockquote><br class="">Well... sort of. &nbsp;You can open up kgdb and run 'p sysinit_done_list'.<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">static STAILQ_HEAD(sysinitlist, sysinit) sysinit_list;<br class="">+static struct sysinitlist sysinit_done_list =<br class="">+ &nbsp;&nbsp;&nbsp;STAILQ_HEAD_INITIALIZER(sysinit_done_list);<br class=""></blockquote><br class="">Then it should be wrapped around with #ifdef DDB and #endif<br class=""></blockquote>I considered that, but since we're literally talking about 2 pointers of<br class="">memory I figured it wasn't worth making it conditional.<br class=""></blockquote><br style="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=""><span style="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="">IMO loss of the run order in a dump was a (minor) regression so this</span><br style="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=""><span style="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="">should be unconditionally available.</span><br style="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=""></div></blockquote><div><br class=""></div><div>No, we do NOT loss the run order.</div><div><br class=""></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="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">sysinits.</span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div>That is somewhat not as flexible as previous&nbsp;<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">sysinit array, or current `sysinit_done_list`.</span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">So&nbsp;</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">IMO</span>&nbsp;<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">`</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">sysinit_done_list` is still useful only for debugging, either DDB or kgdb.</span></div><br class=""><blockquote type="cite" class=""><div class=""><br style="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=""><span style="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="">-- Brooks</span></div></blockquote></div><br class=""><div class="">
<div>Best regards,</div><div>Zhenlei</div>

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

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