Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > muc.lists.netbsd.source-changes > #156248 > unrolled thread

Re: CVS commit: src/sys/dev/usb

Started byGreg Troxel <gdt@lexort.com>
First post2026-10-24 10:37 -0400
Last post2026-10-24 13:32 -0400
Articles 3 — 2 participants

Back to article view | Back to muc.lists.netbsd.source-changes

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: CVS commit: src/sys/dev/usb Greg Troxel <gdt@lexort.com> - 2026-10-24 10:37 -0400
    Re: CVS commit: src/sys/dev/usb Jason Thorpe <thorpej@me.com> - 2026-10-24 10:46 -0400
      Re: CVS commit: src/sys/dev/usb Greg Troxel <gdt@lexort.com> - 2026-10-24 13:32 -0400

#156248 — Re: CVS commit: src/sys/dev/usb

FromGreg Troxel <gdt@lexort.com>
Date2026-10-24 10:37 -0400
SubjectRe: CVS commit: src/sys/dev/usb
Message-ID<rmijyn788ra.fsf@s1.lexort.com>
Jason Thorpe <thorpej@me.com> writes:

>> On Oct 22, 2026, at 7:23 PM, Taylor R Campbell <riastradh@netbsd.org> wrote:
>> 
>> I think this change may not be correct.  I don't think pool_cache_get
>> respects PR_ZERO.  Perhaps we should add an assertion about this and
>> audit the system for it (or make it work by judiciously adding a
>> memset if PR_ZERO is passed).
>
> pool_cache_get() is intended to return constructed objects.  I guess making it support PR_ZERO is OK so long as the cache doesn’t specify a constructor function, and should blow up on incompatible arguments if it does have one.

That's a really good point.  I had forgotten the wisdom of the original
papers.

I wonder if it's basically an error to have a pool cache without a
constructor (semantically).    I suppose "all zeros if there is no
constructor" is perhaps a reasonable sort-of-constructor, as in "safe
state before real construction".

What does openindiana/illumos  do here?


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [next] | [standalone]


#156249

FromJason Thorpe <thorpej@me.com>
Date2026-10-24 10:46 -0400
Message-ID<19325F52-6F66-46DE-BECC-9723B50C7FAB@me.com>
In reply to#156248
> On Oct 24, 2026, at 10:37 AM, Greg Troxel <gdt@lexort.com> wrote:
> 
> I wonder if it's basically an error to have a pool cache without a
> constructor (semantically).    I suppose "all zeros if there is no
> constructor" is perhaps a reasonable sort-of-constructor, as in "safe
> state before real construction".
> 
> What does openindiana/illumos  do here?

It is not an error to not use a constructor -<em-dash>- esp considering that the general memory allocator is built on top of pool_cache.

IIRC, the original Solaris behavior was “uninitialized if no constructor specified”.  I would not advocate for “always zero-init if no constructor” because that could be wasteful.  I’d rather have it be an explicit ask when the pool_cache is initialized.

-- thorpej


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [prev] | [next] | [standalone]


#156250

FromGreg Troxel <gdt@lexort.com>
Date2026-10-24 13:32 -0400
Message-ID<rmibj8j80o1.fsf@s1.lexort.com>
In reply to#156249
Jason Thorpe <thorpej@me.com> writes:

>> What does openindiana/illumos  do here?
>
> It is not an error to not use a constructor -<em-dash>- esp considering that the general memory allocator is built on top of pool_cache.
>
> IIRC, the original Solaris behavior was “uninitialized if no
> constructor specified”.  I would not advocate for “always zero-init if
> no constructor” because that could be wasteful.  I’d rather have it be
> an explicit ask when the pool_cache is initialized.

That sounds reasonable.   It seems like asking for zero and a
constructor should KASSERT and if not DIAGNOSTIC be an error.


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

[toc] | [prev] | [standalone]


Back to top | Article view | muc.lists.netbsd.source-changes


csiph-web