Page MenuHomeFreeBSD
Feed Advanced Search

Yesterday

kib updated the diff for D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.

Move vm_check_pg_zero code from vm_map_insert() into vm_object_coalesce().

Wed, Nov 26, 10:57 PM
kib added inline comments to D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
Wed, Nov 26, 10:55 PM
kib accepted D53913: strfmon: Fix negative sign handling for C locale.
Wed, Nov 26, 8:03 PM
kib accepted D53938: linker: Avoid invoking eventhandlers on incompletely loaded files.
Wed, Nov 26, 7:59 PM
kib accepted D53913: strfmon: Fix negative sign handling for C locale.
Wed, Nov 26, 5:07 PM
kib accepted D53911: strfmon: Add tests for Austin Group Defect 1199.
Wed, Nov 26, 5:05 PM
kib accepted D53912: strfmon: EINVAL if the '+' flag and both signs are empty.
Wed, Nov 26, 5:03 PM
kib added inline comments to D53912: strfmon: EINVAL if the '+' flag and both signs are empty.
Wed, Nov 26, 11:56 AM
kib added a comment to D53911: strfmon: Add tests for Austin Group Defect 1199.

Would you add a link to the actual defect page? Is it public?

Wed, Nov 26, 10:11 AM
kib accepted D53902: LinuxKPI: pci: undo the pci_resource_len() check in lkpi_pci_request_region().
Wed, Nov 26, 10:08 AM
kib added inline comments to D53845: kqueue(9): document f_copy.
Wed, Nov 26, 8:40 AM
kib accepted D53845: kqueue(9): document f_copy.
Wed, Nov 26, 8:39 AM

Tue, Nov 25

kib updated the diff for D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.

In the checker, check that the pager does not contain pages.

Tue, Nov 25, 4:28 PM
kib added a comment to D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
In D53891#1231400, @kib wrote:
In D53891#1231399, @alc wrote:

Can you elaborate on what you saw when debugging this problem? In particular, whether the map entries had OBJ_ONEMAPPING set? In principle, the ref_count and size shouldn't be a concern if the object has OBJ_ONEMAPPING set. For example, suppose there is an anonymous mapping (with OBJ_ONEMAPPING set) for the range [A, D). Further, suppose we punch a hole in the middle of that mapping, by calling munmap() on the range [B, C) where A < B < C < D. Now, we have two mappings, [A, B) and [C, D), that both reference the original object, and that object should still have OBJ_ONEMAPPING set. Because OBJ_ONEMAPPING is set, the munmap() should have freed any physical pages and swap space from the object that fell within the range [B, C). So, if a new anonymous mapping is created starting at either B or D, we should be able to safely coalesce it.

I did not have access to the object state there (all debugging was done remotely).

The situation you described is one of the cases that concerned me. I am not sure that we have a guarantee that doing the coalesce on the object with OBJ_ONEMAPPING flag but ref_count > 1 would not corrupt some other mapping. We need to do vm_object_page_remove(), and in principle that could remove pages which belong to other fragment.

I believe OBJ_ONEMAPPING means, "each page in the object is mapped at most once", so in the case you describe, OBJ_ONEMAPPING should not be set to begin with.

Tue, Nov 25, 4:28 PM
kib added inline comments to D53845: kqueue(9): document f_copy.
Tue, Nov 25, 8:44 AM
kib added inline comments to D53845: kqueue(9): document f_copy.
Tue, Nov 25, 8:42 AM

Mon, Nov 24

kib updated the diff for D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.

The rest of the changes.

Mon, Nov 24, 6:15 PM
kib reopened D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
Mon, Nov 24, 6:11 PM
kib committed rG72a447d0bc76: vm_object_page_remove(): clear pager even if there is no resident pages (authored by kib).
vm_object_page_remove(): clear pager even if there is no resident pages
Mon, Nov 24, 6:09 PM
kib closed D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
Mon, Nov 24, 6:09 PM
kib added a comment to D53845: kqueue(9): document f_copy.
In D53845#1231594, @imp wrote:

update per review...
... hope to get feedback on whether I should mention attach/detach here or not.

Mon, Nov 24, 5:05 PM
kib added inline comments to D53896: snd_hdsp*: Fix M_NOWAIT malloc(9) calls.
Mon, Nov 24, 2:07 PM
kib committed rG0628c252bd16: rtld: fix powerpc build (authored by kib).
rtld: fix powerpc build
Mon, Nov 24, 1:54 PM
kib added a comment to D53896: snd_hdsp*: Fix M_NOWAIT malloc(9) calls.

https://reviews.freebsd.org/D53896

Mon, Nov 24, 1:07 PM
kib added a comment to D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.

After another day of extensive testing, I can confirm that everything is working properly.

I'm happy to perform additional debugging to clarify the problematic condition, should you find it helpful.
Would you like a dump of the affected object for the newly added goto remove_pager case? Or anything else?

Mon, Nov 24, 8:51 AM

Sun, Nov 23

kib added a comment to D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
In D53891#1231399, @alc wrote:

Can you elaborate on what you saw when debugging this problem? In particular, whether the map entries had OBJ_ONEMAPPING set? In principle, the ref_count and size shouldn't be a concern if the object has OBJ_ONEMAPPING set. For example, suppose there is an anonymous mapping (with OBJ_ONEMAPPING set) for the range [A, D). Further, suppose we punch a hole in the middle of that mapping, by calling munmap() on the range [B, C) where A < B < C < D. Now, we have two mappings, [A, B) and [C, D), that both reference the original object, and that object should still have OBJ_ONEMAPPING set. Because OBJ_ONEMAPPING is set, the munmap() should have freed any physical pages and swap space from the object that fell within the range [B, C). So, if a new anonymous mapping is created starting at either B or D, we should be able to safely coalesce it.

Sun, Nov 23, 10:44 PM
kib updated the diff for D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.

Drop KASSERT() checking the layout in vm_object_coalesce(). It really outlived its usefulness.

Sun, Nov 23, 4:04 PM
kib retitled D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages from Fixes for dreaded assert in jemalloc page allocator (AKA mmap(MAP_ANON) providing non-zeroed pages) to Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
Sun, Nov 23, 9:53 AM
kib requested review of D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
Sun, Nov 23, 9:51 AM

Fri, Nov 21

kib committed rGd8bfcacd12ab: vm_fault: add a verifier that the PG_ZERO page is indeed zeroed (authored by kib).
vm_fault: add a verifier that the PG_ZERO page is indeed zeroed
Fri, Nov 21, 3:03 PM
kib committed rGb9fc7628dbb2: vm_page_free_prep(): convert PG_ZERO zeroed page check to use sf_buf (authored by kib).
vm_page_free_prep(): convert PG_ZERO zeroed page check to use sf_buf
Fri, Nov 21, 3:03 PM
kib closed D53850: More checks for PG_ZERO pages.
Fri, Nov 21, 3:03 PM
kib updated the diff for D53850: More checks for PG_ZERO pages.

Move control var and sysctl under INVARIANTS.

Fri, Nov 21, 2:51 PM
kib accepted D53855: sound: Retire snd_mtx* wrappers.
Fri, Nov 21, 2:49 PM
kib updated the diff for D53850: More checks for PG_ZERO pages.

Move to INVARIANTS and sysctl debug.vm_check_pg_zero to control.

Fri, Nov 21, 2:26 PM
kib added a comment to D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering.

Since there were no more active discussion, and there was some argument against removal of the compat code, I decided to go with the initial patch that just moved the powerpc rtld code into MD location. If there appear some consensus about removing AT_OLD_* for powerpc, the trivial patches can be re-created.

Fri, Nov 21, 1:37 PM
kib committed rGb2b3d2a962eb: rtld-elf: move powerpc-specific auxv compat code into arch hook (authored by kib).
rtld-elf: move powerpc-specific auxv compat code into arch hook
Fri, Nov 21, 1:34 PM
kib closed D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering.
Fri, Nov 21, 1:34 PM
kib accepted D53854: sound: Merge chn_intr() with chn_intr_locked().
Fri, Nov 21, 11:08 AM
kib added inline comments to D53851: sound: Simplify locking in sysctl_dev_pcm_bitperfect().
Fri, Nov 21, 11:07 AM
kib added inline comments to D53851: sound: Simplify locking in sysctl_dev_pcm_bitperfect().
Fri, Nov 21, 10:02 AM
kib requested review of D53850: More checks for PG_ZERO pages.
Fri, Nov 21, 9:01 AM
kib committed rG0d8535e7724a: exterror.9 man page (authored by kib).
exterror.9 man page
Fri, Nov 21, 8:42 AM

Thu, Nov 20

kib added inline comments to D53845: kqueue(9): document f_copy.
Thu, Nov 20, 4:58 PM
kib committed rG39cad8402d19: max_align_t: apply alignof to 'long double' for long double alignment (authored by kib).
max_align_t: apply alignof to 'long double' for long double alignment
Thu, Nov 20, 4:53 PM
kib closed D53826: max_align_t: apply alignof to 'long double' for long double alignment.
Thu, Nov 20, 4:52 PM
kib accepted D53666: sound: Fix KASSERT panics in chn_read() and chn_write().
Thu, Nov 20, 3:10 PM
kib accepted D53823: add types: (u)int64ptr_t.
Thu, Nov 20, 12:28 PM
kib added inline comments to D53823: add types: (u)int64ptr_t.
Thu, Nov 20, 11:57 AM
kib accepted D53820: sys/_types.h: define fallback __(u)intcap_t.
Thu, Nov 20, 11:54 AM
kib accepted D53819: sys/_types.h: define __(u)int(f)ptr_t for CHERI.
Thu, Nov 20, 11:53 AM
kib added a comment to D53819: sys/_types.h: define __(u)int(f)ptr_t for CHERI.

And where is __intcap_t defined? Is it provided by some MD include, like machine/_types.h?

Thu, Nov 20, 8:45 AM
kib accepted D53818: sys/_types.h: centralize __vm_offset_t and __vm_size_t definitions.
Thu, Nov 20, 8:42 AM
kib added a comment to D53823: add types: (u)int64ptr_t.

There should be a description of the intended type use somewhere, even if only as a comment in the header. It is non-standard, and its proper usage should be documented instead of being a knowledge.

Thu, Nov 20, 8:40 AM

Wed, Nov 19

kib requested review of D53826: max_align_t: apply alignof to 'long double' for long double alignment.
Wed, Nov 19, 2:53 PM
kib added inline comments to D53821: sys/_types.h: add void * to __max_align_t.
Wed, Nov 19, 2:50 PM
kib accepted D53817: new type: ptraddr_t.
Wed, Nov 19, 2:04 PM
kib accepted D53822: sys/_types.h: add __intptr_t to __mbstate_t.
Wed, Nov 19, 1:52 PM
kib accepted D53821: sys/_types.h: add void * to __max_align_t.
Wed, Nov 19, 1:51 PM
kib accepted D53820: sys/_types.h: define fallback __(u)intcap_t.
Wed, Nov 19, 1:47 PM
kib added a comment to D53817: new type: ptraddr_t.

So may be do not expose ptraddr_t yet, until it is finalized? If they choose (slightly) different semantic, we would have a huge problem.

Wed, Nov 19, 1:41 PM
kib resigned from D53657: libc: implement C23 <stdbit.h> functions.
Wed, Nov 19, 12:21 PM
kib added a comment to D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering.
In D53801#1229342, @kib wrote:

After thinking about this code some more, I realized that it probably should be removed altogether. Basically, it is there to allow to run newer binaries (rtld/libsys) on older (pre-AT_ renumbering) kernels. This was done in ~2019, and arguably outlived even the limited usefulness it had at the time of the commit.

I'm not sure this analysis is entirely correct. __elfN(powerpc_copyout_auxargs) will use the old numbering if the binary is old (but not so old it doesn't have an OSREL embedded). What I'm not sure about is if this will happen with a new rtld and old binary or just with an old static binary.

Wed, Nov 19, 10:16 AM
kib added a reviewer for D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering: brooks.
Wed, Nov 19, 8:33 AM
kib updated the diff for D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering.
Wed, Nov 19, 5:59 AM
kib added a comment to D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering.

On second read through, caught a couple of code issues that don't affect functionality. Once those are fixed this looks good.

Wed, Nov 19, 5:58 AM
kib added inline comments to D53657: libc: implement C23 <stdbit.h> functions.
Wed, Nov 19, 2:19 AM
kib updated the diff for D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering.

Stub all arches

Wed, Nov 19, 2:04 AM
kib accepted D53657: libc: implement C23 <stdbit.h> functions.
Wed, Nov 19, 1:50 AM

Tue, Nov 18

kib requested review of D53801: rtld-elf and libsys: remove old forward-compat code for powerpc auxv renumbering.
Tue, Nov 18, 11:08 AM
kib closed D53798: exterror.9: explain buffers and bios usage of extended errors.
Tue, Nov 18, 5:36 AM
kib committed rGc0a38339fec3: exterror.9: explain buffers and bios usage of extended errors (authored by kib).
exterror.9: explain buffers and bios usage of extended errors
Tue, Nov 18, 5:36 AM
kib updated the diff for D53798: exterror.9: explain buffers and bios usage of extended errors.

Remove the sentence.

Tue, Nov 18, 5:24 AM
kib added inline comments to D53798: exterror.9: explain buffers and bios usage of extended errors.
Tue, Nov 18, 4:58 AM
kib updated the diff for D53798: exterror.9: explain buffers and bios usage of extended errors.

pauamma' fixes

Tue, Nov 18, 4:45 AM
kib added inline comments to D53798: exterror.9: explain buffers and bios usage of extended errors.
Tue, Nov 18, 4:45 AM
kib requested review of D53798: exterror.9: explain buffers and bios usage of extended errors.
Tue, Nov 18, 4:25 AM
kib accepted D53762: kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK).
Tue, Nov 18, 4:01 AM
kib committed rGf363f4a8fa8b: kern_thread: thread_suspend_check(1) must never suspend (authored by kib).
kern_thread: thread_suspend_check(1) must never suspend
Tue, Nov 18, 3:39 AM
kib committed rG48c288443822: kern_thread: thread_suspend_check(1) must never suspend (authored by kib).
kern_thread: thread_suspend_check(1) must never suspend
Tue, Nov 18, 3:38 AM

Mon, Nov 17

kib added inline comments to D53762: kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK).
Mon, Nov 17, 7:29 PM
kib added inline comments to D53762: kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK).
Mon, Nov 17, 6:24 PM
kib accepted D53762: kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK).
Mon, Nov 17, 3:51 PM

Sun, Nov 16

kib added inline comments to D53761: sh: Don't assume EINTR means SIGALRM.
Sun, Nov 16, 11:11 AM
kib added inline comments to D53761: sh: Don't assume EINTR means SIGALRM.
Sun, Nov 16, 10:58 AM

Sat, Nov 15

kib accepted D53774: inotify: Work around the vput() bug directly.
Sat, Nov 15, 6:07 PM
kib added a comment to D53736: sound: Simplify logic in dsp_io_ops().
In D53736#1227774, @kib wrote:
In D53736#1227693, @kib wrote:

What is channel->pid? Where is it got assigned?

From the commit message:

channel->pid (as well as channel->comm) is always assigned in dsp_chn_alloc().

I will correct the message to say pcm_channel->pid, which is the actual struct's name.

This is not what I am asking about. Why do you need to save the pid, and how do you use it?

Both the pid and process name are mostly cosmetic, and are used in sndctl(8), /dev/sndstat and in some OSSv4 structures. It is just so that the user can easily tell which channel(s) belong to which processes.

Sat, Nov 15, 1:34 PM
kib added a comment to D53666: sound: Fix KASSERT panics in chn_read() and chn_write().
In D53666#1226867, @kib wrote:
  1. Calling close(2) on the device: I'm not sure about this one. Is it possible that close(2) and read(2)/write(2) can run concurrently?

Yes, close(2) and io syscalls can be run in parallel. But the file is only closed (as in d_close for devfs, or cdevpriv destroy) when the file ref count goes to zero. Since both read(2) and close(2) take the reference, effectively the file deallocation occurs by the syscall that fdrop() it the last.

Right, so dsp_close() can de-allocate the channel (and as a result, the buffer) if it's a virtual channel (see vchan_destroy()). Would this be a problem here? If yes, I suppose we could an an inprog barrier in dsp_close() as well?

Sat, Nov 15, 1:24 PM
kib added a comment to D53736: sound: Simplify logic in dsp_io_ops().
In D53736#1227693, @kib wrote:

What is channel->pid? Where is it got assigned?

From the commit message:

channel->pid (as well as channel->comm) is always assigned in dsp_chn_alloc().

I will correct the message to say pcm_channel->pid, which is the actual struct's name.

Sat, Nov 15, 1:21 PM
kib added a comment to D53736: sound: Simplify logic in dsp_io_ops().

What is channel->pid? Where is it got assigned?

Sat, Nov 15, 2:22 AM
kib added inline comments to D53762: kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK).
Sat, Nov 15, 2:06 AM
kib added a comment to D53761: sh: Don't assume EINTR means SIGALRM.

What would happen if a catch-able signal was delivered right before we entered select? Would the read built-in become blocked until timeout occurred then? [If yes, this is pre-existing issue in the code, I am only curious there]

Sat, Nov 15, 1:54 AM

Fri, Nov 14

kib committed rG0eca7fa1c96f: exterror.9 man page (authored by kib).
exterror.9 man page
Fri, Nov 14, 2:34 PM
kib closed D53589: exterror.9 man page.
Fri, Nov 14, 2:34 PM
kib updated the diff for D53589: exterror.9 man page.

pauamma corrections

Fri, Nov 14, 1:58 PM
kib updated the diff for D53589: exterror.9 man page.

emaste suggestions.
Removed 'would' for 'identifies'

Fri, Nov 14, 1:37 PM
kib added inline comments to D53589: exterror.9 man page.
Fri, Nov 14, 1:35 PM
kib updated the diff for D53589: exterror.9 man page.

Strip the license text

Fri, Nov 14, 1:28 PM
kib added inline comments to D53589: exterror.9 man page.
Fri, Nov 14, 1:15 PM
kib updated the summary of D53589: exterror.9 man page.
Fri, Nov 14, 9:24 AM