Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Nov 2024 09:12:13 +0100 (CET)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Mark Johnston <markj@FreeBSD.org>
Cc:        dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 195402c5c5b7 - main - busdma_bounce: Replace a SYSINIT with static initializations
Message-ID:  <705420107.1610.1731399133226@localhost>
In-Reply-To: <202411120201.4AC21wNW023064@gitrepo.freebsd.org>
References:  <202411120201.4AC21wNW023064@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_1609_384912247.1731399133058
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Out of curiosity, what is the "why" of this commit?

Regards,
Ronald.

 
Van: Mark Johnston <markj@FreeBSD.org>
Datum: dinsdag, 12 november 2024 03:01
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: 195402c5c5b7 - main - busdma_bounce: Replace a SYSINIT with static initializations
> 
> The branch main has been updated by markj:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=195402c5c5b7b3236c0680f06b60b7f9465982c8
> 
> commit 195402c5c5b7b3236c0680f06b60b7f9465982c8
> Author:     Mark Johnston <markj@FreeBSD.org>
> AuthorDate: 2024-11-12 01:57:35 +0000
> Commit:     Mark Johnston <markj@FreeBSD.org>
> CommitDate: 2024-11-12 01:57:35 +0000
> 
>     busdma_bounce: Replace a SYSINIT with static initializations
>     
>     No functional change intended.
>     
>     MFC after:      1 week
> ---
>  sys/kern/subr_busdma_bounce.c | 18 +++++-------------
>  1 file changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/sys/kern/subr_busdma_bounce.c b/sys/kern/subr_busdma_bounce.c
> index a27bc423c23a..60fe2fc6b2a6 100644
> --- a/sys/kern/subr_busdma_bounce.c
> +++ b/sys/kern/subr_busdma_bounce.c
> @@ -86,11 +86,14 @@ struct bounce_zone {
>  };
>  
>  static struct mtx bounce_lock;
> +MTX_SYSINIT(bounce_lock, &bounce_lock, "bounce pages lock", MTX_DEF);
>  static int total_bpages;
>  static int busdma_zonecount;
>  
> -static STAILQ_HEAD(, bounce_zone) bounce_zone_list;
> -static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist;
> +static STAILQ_HEAD(, bounce_zone) bounce_zone_list =
> +    STAILQ_HEAD_INITIALIZER(bounce_zone_list);
> +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist =
> +    STAILQ_HEAD_INITIALIZER(bounce_map_callbacklist);
>  
>  static MALLOC_DEFINE(M_BOUNCE, "bounce", "busdma bounce pages");
>  
> @@ -130,17 +133,6 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags)
>     return (0);
>  }
>  
> -static void
> -init_bounce_pages(void *dummy __unused)
> -{
> -
> -   total_bpages = 0;
> -   STAILQ_INIT(&bounce_zone_list);
> -   STAILQ_INIT(&bounce_map_callbacklist);
> -   mtx_init(&bounce_lock, "bounce pages lock", NULL, MTX_DEF);
> -}
> -SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL);
> -
>  static struct sysctl_ctx_list *
>  busdma_sysctl_tree(struct bounce_zone *bz)
>  {
>  
> 
> 
> 

 
------=_Part_1609_384912247.1731399133058
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html><head></head><body>Out of curiosity, what is the "why" of this commit?<br>
<br>
Regards,<br>
Ronald.<br>
<br>
&nbsp;
<p><strong>Van:</strong> Mark Johnston &lt;markj@FreeBSD.org&gt;<br>
<strong>Datum:</strong> dinsdag, 12 november 2024 03:01<br>
<strong>Aan:</strong> src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org<br>
<strong>Onderwerp:</strong> git: 195402c5c5b7 - main - busdma_bounce: Replace a SYSINIT with static initializations</p>

<blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px">
<div class="MessageRFC822Viewer" id="P">
<div class="TextPlainViewer" id="P.P">The branch main has been updated by markj:<br>
<br>
URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=195402c5c5b7b3236c0680f06b60b7f9465982c8">https://cgit.FreeBSD.org/src/commit/?id=195402c5c5b7b3236c0680f06b60b7f9465982c8</a><br>;
<br>
commit 195402c5c5b7b3236c0680f06b60b7f9465982c8<br>
Author: &nbsp;&nbsp;&nbsp;&nbsp;Mark Johnston &lt;markj@FreeBSD.org&gt;<br>
AuthorDate: 2024-11-12 01:57:35 +0000<br>
Commit: &nbsp;&nbsp;&nbsp;&nbsp;Mark Johnston &lt;markj@FreeBSD.org&gt;<br>
CommitDate: 2024-11-12 01:57:35 +0000<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;busdma_bounce: Replace a SYSINIT with static initializations<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;No functional change intended.<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;MFC after: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 week<br>
---<br>
&nbsp;sys/kern/subr_busdma_bounce.c | 18 +++++-------------<br>
&nbsp;1 file changed, 5 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/sys/kern/subr_busdma_bounce.c b/sys/kern/subr_busdma_bounce.c<br>
index a27bc423c23a..60fe2fc6b2a6 100644<br>
--- a/sys/kern/subr_busdma_bounce.c<br>
+++ b/sys/kern/subr_busdma_bounce.c<br>
@@ -86,11 +86,14 @@ struct bounce_zone {<br>
&nbsp;};<br>
&nbsp;<br>
&nbsp;static struct mtx bounce_lock;<br>
+MTX_SYSINIT(bounce_lock, &amp;bounce_lock, "bounce pages lock", MTX_DEF);<br>
&nbsp;static int total_bpages;<br>
&nbsp;static int busdma_zonecount;<br>
&nbsp;<br>
-static STAILQ_HEAD(, bounce_zone) bounce_zone_list;<br>
-static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist;<br>
+static STAILQ_HEAD(, bounce_zone) bounce_zone_list =<br>
+ &nbsp;&nbsp;&nbsp;STAILQ_HEAD_INITIALIZER(bounce_zone_list);<br>
+static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist =<br>
+ &nbsp;&nbsp;&nbsp;STAILQ_HEAD_INITIALIZER(bounce_map_callbacklist);<br>
&nbsp;<br>
&nbsp;static MALLOC_DEFINE(M_BOUNCE, "bounce", "busdma bounce pages");<br>
&nbsp;<br>
@@ -130,17 +133,6 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags)<br>
&nbsp;&nbsp;&nbsp;&nbsp;return (0);<br>
&nbsp;}<br>
&nbsp;<br>
-static void<br>
-init_bounce_pages(void *dummy __unused)<br>
-{<br>
-<br>
- &nbsp;&nbsp;total_bpages = 0;<br>
- &nbsp;&nbsp;STAILQ_INIT(&amp;bounce_zone_list);<br>
- &nbsp;&nbsp;STAILQ_INIT(&amp;bounce_map_callbacklist);<br>
- &nbsp;&nbsp;mtx_init(&amp;bounce_lock, "bounce pages lock", NULL, MTX_DEF);<br>
-}<br>
-SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL);<br>
-<br>
&nbsp;static struct sysctl_ctx_list *<br>
&nbsp;busdma_sysctl_tree(struct bounce_zone *bz)<br>
&nbsp;{<br>
&nbsp;</div>

<hr></div>
</blockquote>
<br>
&nbsp;</body></html>
------=_Part_1609_384912247.1731399133058--



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