Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (636 w, 19 h)

Recent Activity

Today

kib added inline comments to D58405: unix: allow `connectat(2)` to name the peer socket by descriptor.
Sat, Jul 25, 2:07 AM

Yesterday

kib accepted D58443: kqueue: Add a helper macro for sleeping on in-flux knotes.
Fri, Jul 24, 11:46 PM
kib accepted D58447: umtx: Do not make an exiting thread the owner of a PI mutex.
Fri, Jul 24, 11:45 PM
kib accepted D58385: pwait: Test the new -r option.
Fri, Jul 24, 10:02 PM
kib added a comment to D58264: processes: add zombie references, each of them prevents reap.
In D58264#1339790, @kib wrote:
In D58264#1339300, @kib wrote:

The proposal is:

  • if child was forked, the parent is guaranteed that waitpid() returns the exit status after the child exit.

Makes sense.

  • If child was pdforked, waitpid does not see the child.

This changes existing semantics, right? Why is that ok?

IMO it is illogical. I think that waitpid() was enabled as a desperate measure due to lack of pdwait() and trouble implementing it.
But ok, I think I see how to still allow waitpid(). The proposed semantic is that waitpid() is allowed once, but is not required for reaping, and does not cause reaping. The child is reaped when the procdesc is pdwait-ed or closed still. This is done with 'weak' references.

  • if there are procdescs on the child (does not matter, was the child forked or pdforked), we guarantee that exactly one pdwait() on some of the procdescs returns the exit status.

I'm dumb: why can't they all return the exit status? p_xexit is not cleared after it is read.

May be it is me who is dumb, but I do not see then when to reap? The problem is that it is impossible to distinguish between filedesc and file. For instance, I might set a flag on the file referencing procdesc that pdwait() was done on it. But this means that dup-ed file descriptor cannot pdwait().

This behavior would be very confusing, I do not know how to specify it without specifying the implementation.

Again, I sense I am misunderstanding something basic, but: only let the (real) parent reap. Whether it used fork() or pdfork() does not matter, only the parent can decide whether to reap. Any procdesc holder can use pdwait() to collect the instantaneous status, or to block until the parent reaps. Once the parent reaps, procdesc_reap() turns all procdescs into tombstones.

Fri, Jul 24, 9:37 PM
kib added a comment to D58445: kqueue: Add a helper macro for sleeping on in-flux knotes.

Is this a dup?

Fri, Jul 24, 9:30 PM
kib accepted D58443: kqueue: Add a helper macro for sleeping on in-flux knotes.
Fri, Jul 24, 9:29 PM
kib accepted D58060: exterr(9): add a few tests of new message formats.
Fri, Jul 24, 8:24 PM
kib added a comment to D58402: kqueue: Allocate marker knotes on the stack.

I tried with 3 pages and got a huge number of test failures, and the VM became unresponsive. I don't know why. Maybe GET_STACK_USAGE() is returning false in some paths where it did not before, and it's causing problems. I will try to debug further.

I still don't know what's going on, but if I boot a VM with kstack_pages=3 and run tests in /usr/tests/libexec/tftpd, they all fail.

Sorry, this was user error (I accidentally overrode some other tunables when I set kern.kstack_pages, specifically net.inet.ip.fw.default_to_accept=1).

I tried running the test suite again with kstack_pages=3 and it seems ok. I can try the openzfs test suite too, but it takes a long time to run.

Fri, Jul 24, 8:22 PM
kib accepted D58433: kthread: Fix a thread leak.
Fri, Jul 24, 8:04 PM
kib accepted D58413: uexterror_gettext: add tests for invalid formats.
Fri, Jul 24, 8:01 PM
kib accepted D58313: kqueue: Add NOTE_REAP.
Fri, Jul 24, 7:55 PM
kib added inline comments to D58059: runtime: add the ability to set exterrors in userspace.
Fri, Jul 24, 7:53 PM
kib accepted D58237: exterror(9): dynamic kernel categories.
Fri, Jul 24, 7:51 PM
kib accepted D58412: kdump(1): minimally adapt to exterror category sources.
Fri, Jul 24, 7:49 PM
kib accepted D58238: uexterr_gettext(3): support dynamic kernel categories.
Fri, Jul 24, 3:13 AM
kib added inline comments to D58237: exterror(9): dynamic kernel categories.
Fri, Jul 24, 3:13 AM
kib added a comment to D58402: kqueue: Allocate marker knotes on the stack.

I tried on my crash box which is netbooted.

Fri, Jul 24, 2:44 AM
kib accepted D58413: uexterror_gettext: add tests for invalid formats.
Fri, Jul 24, 12:03 AM

Thu, Jul 23

kib closed D58393: getpgrp(2), getsid(2): allow to call on zombies.
Thu, Jul 23, 11:53 PM
kib accepted D58393: getpgrp(2), getsid(2): allow to call on zombies.
Thu, Jul 23, 11:53 PM
kib committed rG8f320c2bc473: getpgrp(2), getsid(2): allow to call on zombies (authored by kib).
getpgrp(2), getsid(2): allow to call on zombies
Thu, Jul 23, 11:51 PM
kib added inline comments to D58405: unix: allow `connectat(2)` to name the peer socket by descriptor.
Thu, Jul 23, 11:40 PM
kib accepted D58314: pwait: Optionally wait until process is reaped.
Thu, Jul 23, 11:34 PM
kib added inline comments to D58385: pwait: Test the new -r option.
Thu, Jul 23, 11:32 PM
kib accepted D58059: runtime: add the ability to set exterrors in userspace.
Thu, Jul 23, 11:10 PM
kib accepted D58058: exterr: relax format restrictions.
Thu, Jul 23, 11:08 PM
kib added inline comments to D58412: kdump(1): minimally adapt to exterror category sources.
Thu, Jul 23, 11:04 PM
kib added a comment to D58402: kqueue: Allocate marker knotes on the stack.

My reading of the graph you posted is that we never exceed 2 pages. So reducing the stack to 3 pages should be fine for this workload, while reducing to two is probably not going to work. Am I correct?

Thu, Jul 23, 10:55 PM
kib accepted D58313: kqueue: Add NOTE_REAP.
Thu, Jul 23, 10:49 PM
kib added inline comments to D58396: procdesc: Remove dead code.
Thu, Jul 23, 3:20 PM
kib added inline comments to D58397: kevent: Disallow certain filter types in capability mode.
Thu, Jul 23, 3:18 PM
kib updated the diff for D58393: getpgrp(2), getsid(2): allow to call on zombies.

Initialize error.

Thu, Jul 23, 3:13 PM
kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.

Fix locking in procdecs_close() for zombies case.

Thu, Jul 23, 4:00 AM
kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.

Rebase on top of D58407

Thu, Jul 23, 2:34 AM
kib requested review of D58407: pdwait(2): change handling of the exited processes.
Thu, Jul 23, 2:32 AM
kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.

Add weak zombie references that allow waitpid() but do not block reaping.

Thu, Jul 23, 1:30 AM
kib added a comment to D58264: processes: add zombie references, each of them prevents reap.
In D58264#1339300, @kib wrote:

The proposal is:

  • if child was forked, the parent is guaranteed that waitpid() returns the exit status after the child exit.

Makes sense.

  • If child was pdforked, waitpid does not see the child.

This changes existing semantics, right? Why is that ok?

Thu, Jul 23, 1:29 AM
kib accepted D58396: procdesc: Remove dead code.
Thu, Jul 23, 12:49 AM
kib added a comment to D58397: kevent: Disallow certain filter types in capability mode.

This would prevent a process from tracking itself using EVFILT_PROC. Not sure how useful it is, but maybe it makes sense to add an exception for ident == getpid().

Yes, there is some precedent for that. For instance, raise() is supposed to work in capability mode.

Thu, Jul 23, 12:45 AM

Wed, Jul 22

kib accepted D58314: pwait: Optionally wait until process is reaped.
Wed, Jul 22, 11:51 PM
kib accepted D58313: kqueue: Add NOTE_REAP.
Wed, Jul 22, 11:48 PM
kib added inline comments to D58385: pwait: Test the new -r option.
Wed, Jul 22, 11:44 PM
kib accepted D58403: procdesc: Disallow pddupfd() of non-passable files.
Wed, Jul 22, 11:34 PM
kib updated the diff for D58393: getpgrp(2), getsid(2): allow to call on zombies.

Return error.

Wed, Jul 22, 10:01 PM
kib added inline comments to D58393: getpgrp(2), getsid(2): allow to call on zombies.
Wed, Jul 22, 10:01 PM
kib accepted D58395: kqueue: Fix delivery of unwanted events.
Wed, Jul 22, 9:55 PM
kib added inline comments to D58059: runtime: add the ability to set exterrors in userspace.
Wed, Jul 22, 9:53 PM
kib accepted D58060: exterr(9): add a few tests of new message formats.
Wed, Jul 22, 9:46 PM
kib accepted D58298: LinuxKPI: page.h: use atop() and ptoa() instead of PAGE_SHIFT.
Wed, Jul 22, 9:42 PM
kib accepted D58402: kqueue: Allocate marker knotes on the stack.

I am thinking about reducing the amd64 default kstack size to 4->3, or even 2.

Wed, Jul 22, 9:41 PM
kib added a comment to D58402: kqueue: Allocate marker knotes on the stack.

I do not object strong, but knote is 160 bytes.

Wed, Jul 22, 9:06 PM
kib accepted D58317: unix: Preserve FD_RESOLVE_BENEATH when passing an fd.
Wed, Jul 22, 9:04 PM
kib updated subscribers of D58393: getpgrp(2), getsid(2): allow to call on zombies.
Wed, Jul 22, 9:03 PM
kib added a comment to D58393: getpgrp(2), getsid(2): allow to call on zombies.

Why?

Wed, Jul 22, 9:02 PM
kib requested review of D58393: getpgrp(2), getsid(2): allow to call on zombies.
Wed, Jul 22, 9:51 AM
kib added a comment to D58314: pwait: Optionally wait until process is reaped.
In D58314#1339356, @kib wrote:

This obviously changes the semantic of the pwait(1) tool. Before, it returned control after the process exited. Now, it additionally wait until a reaper makes the wait*() call.

But what does "exited" really mean in this context?

Wed, Jul 22, 1:49 AM
kib added a comment to D58314: pwait: Optionally wait until process is reaped.

This obviously changes the semantic of the pwait(1) tool. Before, it returned control after the process exited. Now, it additionally wait until a reaper makes the wait*() call.

Wed, Jul 22, 1:22 AM
kib accepted D58386: pwait: Add a SIGINFO handler.
Wed, Jul 22, 1:18 AM
kib added a comment to D58264: processes: add zombie references, each of them prevents reap.
In D58264#1339297, @kib wrote:

proc_to_reap(orphan) can reap.

I promised to look at the tests if there is an agreement on the idea of this change. I know that there is some breakage.

Some summary of 1) current semantics 2) proposed semantics would be useful. The review description is not very clear.

As I understand it, 2) is:

  • only the parent can reap the child, by calling wait() or pdwait(),
  • any procdescs which refer to the child will prevent the child PID from being recycled,
  • anybody may use pdwait() to fetch the status of the child, but only the parent can consume the status.
Wed, Jul 22, 12:00 AM

Tue, Jul 21

kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.

proc_to_reap(orphan) can reap.

Tue, Jul 21, 11:13 PM
kib added a comment to D58264: processes: add zombie references, each of them prevents reap.

Did you run the ptrace tests? Several fail, and then I see a panic

panic: reaped an orphan (pid 0)
cpuid = 13
time = 1784674501
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0xa5/frame 0xfffffe00f1a525b0
kdb_backtrace() at kdb_backtrace+0xc6/frame 0xfffffe00f1a52710
vpanic() at vpanic+0x214/frame 0xfffffe00f1a528b0
panic() at panic+0xb5/frame 0xfffffe00f1a52980
kern_wait6() at kern_wait6+0x57c/frame 0xfffffe00f1a52a10
sys_wait4() at sys_wait4+0x18e/frame 0xfffffe00f1a52d10
amd64_syscall() at amd64_syscall+0x3d8/frame 0xfffffe00f1a52f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe00f1a52f30
--- syscall (7, FreeBSD ELF64, wait4), rip = 0x3ce8fd7e46ea, rsp = 0x3ce8f93b2d78, rbp = 0x3ce8f93b2db0 ---
Tue, Jul 21, 11:09 PM
kib accepted D58388: libsysdecode: Recognize NOTE_PDSIGCHLD.
Tue, Jul 21, 9:55 PM
kib accepted D58383: loader: Allocate trampoline as EfiLoaderCode, not Data.
Tue, Jul 21, 9:01 PM
kib added inline comments to D58383: loader: Allocate trampoline as EfiLoaderCode, not Data.
Tue, Jul 21, 8:15 PM
kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.

Rename PZOMBIEREF_ORPHAN to PZOMBIEREF_REALPARENT.
Move an assert into proc_realparent().
Correct the condition to reparent on the last procdesc close.
Start modifying the man pages.

Tue, Jul 21, 8:13 PM
kib added inline comments to D58264: processes: add zombie references, each of them prevents reap.
Tue, Jul 21, 8:12 PM
kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.

Fix one more locking comment.

Tue, Jul 21, 6:49 PM
kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.

Change p_zombieref lock annotation to be just proctree_lock.

Tue, Jul 21, 6:04 PM
kib accepted D58379: amd64: Remove a prototype for an unimplemented function.
Tue, Jul 21, 4:08 PM
kib accepted D58378: amd64: Fix an off-by-one in the fred_ipi_handlers definition.
Tue, Jul 21, 4:07 PM
kib committed rGeca7b25c101a: kern/sys_ptrace: do not skip P2_PTRACEREQ wait for PT_CLEARSTEP/PT_GET_CHILDREN (authored by kib).
kern/sys_ptrace: do not skip P2_PTRACEREQ wait for PT_CLEARSTEP/PT_GET_CHILDREN
Tue, Jul 21, 2:59 AM
kib closed D58364: kern/sys_ptrace: do not skip P2_PTRACEREQ wait for PT_CLEARSTEP/PT_GET_CHILDREN.
Tue, Jul 21, 2:59 AM
kib updated the diff for D58264: processes: add zombie references, each of them prevents reap.
Tue, Jul 21, 2:19 AM
kib abandoned D58331: wait6(): fix reporting of orphan exits.

Will be consumed by D58264

Tue, Jul 21, 1:53 AM

Mon, Jul 20

kib updated the diff for D58364: kern/sys_ptrace: do not skip P2_PTRACEREQ wait for PT_CLEARSTEP/PT_GET_CHILDREN.

Add a control variable for proc_can_ptrace() calls.

Mon, Jul 20, 10:37 PM
kib requested review of D58364: kern/sys_ptrace: do not skip P2_PTRACEREQ wait for PT_CLEARSTEP/PT_GET_CHILDREN.
Mon, Jul 20, 10:13 PM
kib added inline comments to D58315: ptrace(2): add PT_GET_CHILDREN.
Mon, Jul 20, 10:00 PM
kib accepted D58322: exterror tests: harden the checks.
Mon, Jul 20, 9:58 PM
kib committed rG29d1a3248a6d: lookup: do not return vp_crossmp as dvp for mount over the reg file (authored by kib).
lookup: do not return vp_crossmp as dvp for mount over the reg file
Mon, Jul 20, 9:56 PM
kib closed D58191: lookup: do not return vp_crossmp as dvp for mount over the reg file.
Mon, Jul 20, 9:56 PM
kib committed rG6e93f5e4d693: amd64: FRED support (authored by kib).
amd64: FRED support
Mon, Jul 20, 9:52 PM
kib committed rG0e5b1384df10: x86 xen: provide the prototype for xen_arch_intr_handle_upcall() in x86/apicvar. (authored by kib).
x86 xen: provide the prototype for xen_arch_intr_handle_upcall() in x86/apicvar.
Mon, Jul 20, 9:52 PM
kib closed D55829: amd64: FRED support.
Mon, Jul 20, 9:52 PM
kib closed D56005: x86 xen: provide the prototype for xen_arch_intr_handle_upcall() in xen/arch-intr.h.
Mon, Jul 20, 9:51 PM
kib committed rG009e83b5ebf3: mlx5ib: use the eventfd_ctx API for DEVX event subscriptions (authored by aehrenberg_nvidia.com).
mlx5ib: use the eventfd_ctx API for DEVX event subscriptions
Mon, Jul 20, 8:55 PM
kib committed rGfab43c031ccd: mlx5ib: initialize DEVX subscription state before the eventfd fdget() (authored by aehrenberg_nvidia.com).
mlx5ib: initialize DEVX subscription state before the eventfd fdget()
Mon, Jul 20, 8:55 PM
kib committed rG7b0e4a73ebb6: mlx5: pass the full EQE to the DEVX event notifier (authored by aehrenberg_nvidia.com).
mlx5: pass the full EQE to the DEVX event notifier
Mon, Jul 20, 8:55 PM
kib committed rG2c713c35b430: mlx5ib: advertise write-combining support for dynamic BlueFlame UARs (authored by aehrenberg_nvidia.com).
mlx5ib: advertise write-combining support for dynamic BlueFlame UARs
Mon, Jul 20, 8:55 PM
kib committed rG86cdda181e4e: mlx5: propagate the DEVX uid through SRQ create and destroy (authored by aehrenberg_nvidia.com).
mlx5: propagate the DEVX uid through SRQ create and destroy
Mon, Jul 20, 8:55 PM
kib committed rG012c852efd27: mlx5: guard against a NULL CQ event handler in mlx5_cq_event() (authored by aehrenberg_nvidia.com).
mlx5: guard against a NULL CQ event handler in mlx5_cq_event()
Mon, Jul 20, 8:55 PM
kib committed rGe611f58ae361: ofed/ib_uverbs: release rdma_user_mmap entry ref in rdma_umap_close() (authored by aehrenberg_nvidia.com).
ofed/ib_uverbs: release rdma_user_mmap entry ref in rdma_umap_close()
Mon, Jul 20, 8:55 PM
kib committed rGc15fa820881d: mlx5ib: encode dynamic UAR mmap offsets in the reserved command range (authored by aehrenberg_nvidia.com).
mlx5ib: encode dynamic UAR mmap offsets in the reserved command range
Mon, Jul 20, 8:55 PM
kib committed rGe3f260ad6614: mlx5: mark completion EQs as a shared resource for DEVX uids (authored by aehrenberg_nvidia.com).
mlx5: mark completion EQs as a shared resource for DEVX uids
Mon, Jul 20, 8:55 PM
kib committed rG8d198bba057c: mlx5ib: implement the MLX5_IB_OBJECT_UAR ioctl object (authored by aehrenberg_nvidia.com).
mlx5ib: implement the MLX5_IB_OBJECT_UAR ioctl object
Mon, Jul 20, 8:54 PM
kib committed rGc122d64b5ab2: mlx5ib: allocate IB queue counters as a shared resource (authored by aehrenberg_nvidia.com).
mlx5ib: allocate IB queue counters as a shared resource
Mon, Jul 20, 8:54 PM
kib committed rG8d518f4b482f: mlx5_ib: do not consume CMD/PAGE_REQUEST events in the DEVX notifier (authored by aehrenberg_nvidia.com).
mlx5_ib: do not consume CMD/PAGE_REQUEST events in the DEVX notifier
Mon, Jul 20, 8:54 PM
kib committed rGf7280623cdfe: mlx5_ib: register DEVX objects in the uverbs ioctl parse tree (authored by aehrenberg_nvidia.com).
mlx5_ib: register DEVX objects in the uverbs ioctl parse tree
Mon, Jul 20, 8:54 PM
kib committed rGea6c3833438a: mlx5: extend mlx5_ib_create_cq struct with fields from the current Linux ABI (authored by kib).
mlx5: extend mlx5_ib_create_cq struct with fields from the current Linux ABI
Mon, Jul 20, 8:54 PM
kib committed rGfcee136ce056: kern_writefile(): fix several regressions (authored by kib).
kern_writefile(): fix several regressions
Mon, Jul 20, 8:54 PM