Article View: muc.lists.netbsd.source-changes
Article #14Re: CVS commit: src/sys/dev/usb
From: Jason Thorpe
Date: Fri, 23 Oct 2026 16:07
Date: Fri, 23 Oct 2026 16:07
139 lines
11640 bytes
11640 bytes
--Apple-Mail=_1BC5A5A0-949F-4BED-8D67-4E7D234B438D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
> On Oct 23, 2026, at 8:33=E2=80=AFAM, Taylor R Campbell =
<riastradh@NetBSD.org> wrote:
>=20
> Maybe PR_ZERO should be an option to pool_cache_init rather than to
> pool_cache_get? (And pool_cache_get should assert that it is _not_
> set. Also pool_cache_init can assert that ctor/dtor is mutually
> exclusive with PR_ZERO.)
Alternatively, there could be a magic constructor function value that =
could specify zero-on-allocate, since PR_ZERO and having a constructor =
are really mutually-exclusive. =20
int
pool_cache_ctor_zero(void *arg __unused, void *obj __unused, int flags =
__unused)
{
return 0;
}
=E2=80=A6then in pool_cache_get_paddr(), before =E2=80=9Cobject=E2=80=9D =
is successfully returned:
If (__predict_false(pc->pc_ctor =3D=3D pool_cache_ctor_zero) {
memset(object, 0, pp->pp_pool->pr_reqsize);
}
Could even specify a magic destructor if you want to zero-on-free (e.g. =
security-sensitive uses).
-- thorpej
--Apple-Mail=_1BC5A5A0-949F-4BED-8D67-4E7D234B438D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
<html aria-label=3D"message body"><head><meta http-equiv=3D"content-type" =
content=3D"text/html; charset=3Dutf-8"></head><body =
style=3D"overflow-wrap: break-word; -webkit-nbsp-mode: space; =
line-break: after-white-space;"><br =
id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On Oct 23, 2026, at 8:33=E2=80=AFAM, Taylor R =
Campbell <riastradh@NetBSD.org> wrote:</div><br =
class=3D"Apple-interchange-newline"><div><meta charset=3D"UTF-8"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">Maybe PR_ZERO should be an option to =
pool_cache_init rather than to</span><br style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
orphans: 2; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration-line: none; =
text-decoration-thickness: auto; text-decoration-style: solid;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">pool_cache_get? (And pool_cache_get =
should assert that it is _not_</span><br style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
orphans: 2; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration-line: none; =
text-decoration-thickness: auto; text-decoration-style: solid;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">set. Also pool_cache_init can assert =
that ctor/dtor is mutually</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
orphans: 2; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration-line: none; =
text-decoration-thickness: auto; text-decoration-style: solid;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">exclusive with PR_ZERO.)</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration-line: none; =
text-decoration-thickness: auto; text-decoration-style: =
solid;"></div></blockquote></div><div><br></div><div>Alternatively, =
there could be a magic constructor function value that could specify =
zero-on-allocate, since PR_ZERO and having a constructor are really =
mutually-exclusive. =
</div><div><br></div><div>int</div><div>pool_cache_ctor_zero(void =
*arg __unused, void *obj __unused, int flags =
__unused)</div><div>{</div><div> return =
0;</div><div>}</div><div><br></div><div>=E2=80=A6then in =
pool_cache_get_paddr(), before =E2=80=9Cobject=E2=80=9D is successfully =
returned:</div><div><br></div><div> If =
(__predict_false(pc->pc_ctor =3D=3D pool_cache_ctor_zero) =
{</div><div> memset(object, 0, =
pp->pp_pool-><font face=3D"Menlo"><span style=3D"font-size: =
11px;">pr_reqsize);</span></font></div><div><font face=3D"Menlo"><span =
style=3D"font-size: 11px;"> =
}</span></font></div><div><br></div><div>Could even specify a magic =
destructor if you want to zero-on-free (e.g. security-sensitive =
uses).</div><br><div>
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
font-variant-ligatures: normal; font-variant-alternates: normal; =
font-variant-numeric: normal; font-variant-east-asian: normal; =
font-variant-position: normal; font-weight: normal; line-height: normal; =
border-spacing: 0px; -webkit-text-decorations-in-effect: none;"><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">-- thorpej</div></span>
</div>
<br></body></html>=
--Apple-Mail=_1BC5A5A0-949F-4BED-8D67-4E7D234B438D--
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID:
<74B6EB23-3B52-402A-BF60-6640A4412FBB@me.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mailReferences:
<20261023153346.77F5884DB6@mail.netbsd.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail From: Jason Thorpe <thorpej@me.com> Newsgroups: muc.lists.netbsd.source-changes Subject: Re: CVS commit: src/sys/dev/usb Date: Fri, 23 Oct 2026 09:07:24 -0700 Organization: Newsgate at muc.de e.V. Sender: source-changes-d-owner@NetBSD.org Approved: news-admin@muc.de Distribution: world Message-ID: <74B6EB23-3B52-402A-BF60-6640A4412FBB@me.com> References: <20261023153346.77F5884DB6@mail.netbsd.org> MIME-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_1BC5A5A0-949F-4BED-8D67-4E7D234B438D" Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="61451"; mail-complaints-to="news-admin@muc.de" Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (2048-bit key) header.d=me.com X-ICL-RepId: 01a16984-8f0c-7688-b1d7-8f99141b358a X-ICL-Out-Info: HUtFAUMEWwJACUgATUQeDx5WFlZNRAJCTQhPHVwGRQNGC1YBWQJLVxQEDFsCRRtXGnkVVkNUBF9QXxwOAFJFUR9UWEEOCl4SGFwUXFBYHkYSVg1dCRkaQV5QG18CQg8cE1YVEx1DGQ8rCEoEQwdFAl4LJRMJU1ZfFRcbXAAXBlsUBEQEWXVddzILSx5edV4AXQ1IASwaKXRGCVUFWwNbc0QNSQErdSlyHVxWUAJaVRIEQAhWUF4IXh9MHA== Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1792771659; x=1824307659; bh=hpxqJLkAWdJBtSkLd1ND49azObTrhRX+hcHUj/NMFqc=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To:x-icloud-hme; b=N7N44D27XEYZ1m7So4URHhTec0KCUdP/YmWDK30OnROfMiUi0u0eDy++iVio926h2plkm/AfK3q8eomTQ5Goad/B/Fyrz3uHyDJNHvMOJCZdVkrmPl+DMvbUtDVBqmZ4j8ovFdYPj6K9Gx0TDLv4W6trqW9OVIzBP+nifKHrOK9AIWTS2iH1YjwJhKY9JDGNKmV9aNL3vHTKrwifrAiJiAa7eYUorPVmQP0PzpvaloLIWQy4w+vxlcmHJrsqlOwR6D0gOBXnjCxT0RSj/yMX1jIdHowAT2HJ6w6Ma575vmI/SB4llyr2TkVtz0NajnOnG3TLaCrtvdC0u//bVpIWnQ== In-Reply-To: <20261023153346.77F5884DB6@mail.netbsd.org> X-Proofpoint-GUID: fWYdaJjTv6iF1CVgkoj8qIqINbX86eV0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDIzMDA2MyBTYWx0ZWRfX/Jda8btKVLXN HjXdaVcbNMlrTjcLtRIJm8BqiPasFBp9oL+A5ZIkW3ehqfdTJvqVuRKThm80zHQKuK56AqZZr2H V0vqXzCOGpVAWyMN2PYM7/s9EvAAtzp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