Page MenuHomeFreeBSD

markj (Mark Johnston)
User

Projects (10)

User Details

User Since
Mar 12 2014, 1:00 AM (602 w, 4 d)

Recent Activity

Yesterday

markj added inline comments to D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.
Sat, Sep 27, 1:12 PM
markj updated the diff for D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.
  • Fix handling of explicit VNETs passed to $V()
  • Improve the README
  • Add a simplistic selftest module
Sat, Sep 27, 12:31 PM
markj committed rGceb5792d1e2e: OptionalObsoleteFiles.inc: Add more ATF libraries (authored by markj).
OptionalObsoleteFiles.inc: Add more ATF libraries
Sat, Sep 27, 8:21 AM
markj closed D52676: OptionalObsoleteFiles.inc: Add more ATF libraries.
Sat, Sep 27, 8:21 AM
markj committed rGba364342aeef: vm_object: Remove the kmem_object alias (authored by markj).
vm_object: Remove the kmem_object alias
Sat, Sep 27, 7:57 AM
markj closed D52708: vm_object: Remove the kmem_object alias.
Sat, Sep 27, 7:57 AM

Fri, Sep 26

markj added a comment to D52733: vm_domainset: Make the iterators atomic.

How so? Allocations within an object are serialized by the VM object write lock.

I didn't check initially, was just addressing your concern in D52441.

Fri, Sep 26, 10:02 AM
markj added a comment to D52733: vm_domainset: Make the iterators atomic.

concurrent allocations might lead to lost increases of the iterator index

Fri, Sep 26, 9:08 AM

Thu, Sep 25

markj added a comment to D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.

If this looks ok, I'll extend it to support PCPU and DPCPU variables. And probably counter(9) too.

Thu, Sep 25, 1:36 PM
markj added a comment to D52730: linker: Make it easier to find the VNET section layout.

This is required for D50825.

Thu, Sep 25, 1:32 PM
markj requested review of D52730: linker: Make it easier to find the VNET section layout.
Thu, Sep 25, 1:31 PM
markj updated the diff for D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.

Have a hard-coded list in kern.post.mk

Thu, Sep 25, 1:30 PM
markj added inline comments to D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.
Thu, Sep 25, 1:18 PM
markj updated the diff for D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.
  • Remove unneeded changes.
Thu, Sep 25, 12:48 PM
markj updated the diff for D50825: libexec/kgdb: Add a new VNET function and add more scaffolding.
  • Fix vnet.py to work with kernel modules.
  • Move scripts to sys/tools/gdb/.
  • Install scripts to /usr/lib/debug/boot/<kernel name>/gdb
  • Modify kernel-gdb.py to automatically load those scripts.
Thu, Sep 25, 12:43 PM

Wed, Sep 24

markj requested review of D52708: vm_object: Remove the kmem_object alias.
Wed, Sep 24, 2:08 PM
markj accepted D52607: wrmsr_early_safe(9).
Wed, Sep 24, 12:38 PM
markj added inline comments to D52628: vfs: fix races between vdrop and VOP_UNLOCK.
Wed, Sep 24, 9:18 AM
markj added inline comments to D52628: vfs: fix races between vdrop and VOP_UNLOCK.
Wed, Sep 24, 9:07 AM

Mon, Sep 22

markj added inline comments to D52628: vfs: fix races between vdrop and VOP_UNLOCK.
Mon, Sep 22, 7:45 PM
markj added a comment to D52628: vfs: fix races between vdrop and VOP_UNLOCK.

Looks mostly ok to me, thank you.

Mon, Sep 22, 6:28 PM
markj added inline comments to D52628: vfs: fix races between vdrop and VOP_UNLOCK.
Mon, Sep 22, 2:26 PM
markj added a comment to D52628: vfs: fix races between vdrop and VOP_UNLOCK.
In D52628#1203111, @mjg wrote:

This is finished, it just has extra parts to trigger defered drop + a printf that it happened. I'll upload a cleaned up variant shortly.

Did you verify you get the printfs from vdrop_doomed_process in your testcase?

Mon, Sep 22, 2:20 PM
markj requested review of D52676: OptionalObsoleteFiles.inc: Add more ATF libraries.
Mon, Sep 22, 2:06 PM
markj added a comment to D52628: vfs: fix races between vdrop and VOP_UNLOCK.

This patch seems to fix the panics I referred to in my revision. Will you finish this patch?

Mon, Sep 22, 2:05 PM

Sun, Sep 21

markj committed rG7e8473273f02: bhyve: insert VM name to the VNC screen title (authored by naito.yuichiro_gmail.com).
bhyve: insert VM name to the VNC screen title
Sun, Sep 21, 2:54 PM
markj committed rGa24fa22bf03c: share/mk: Fix a heuristic in bsd.cpu.mk (authored by markj).
share/mk: Fix a heuristic in bsd.cpu.mk
Sun, Sep 21, 2:53 PM
markj committed rG20bb3d7d500b: bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg() (authored by markj).
bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg()
Sun, Sep 21, 2:53 PM
markj committed rG009317e7dab9: share/sendmail: Use consistent ordering when processing files (authored by markj).
share/sendmail: Use consistent ordering when processing files
Sun, Sep 21, 2:53 PM
markj committed rG3f63d59e38cd: vnode: Assert that VOP_LOCK succeeds in freevnode() (authored by markj).
vnode: Assert that VOP_LOCK succeeds in freevnode()
Sun, Sep 21, 2:53 PM
markj committed rGc11836712548: release: Remove a duplicate package listing in oracle.conf (authored by markj).
release: Remove a duplicate package listing in oracle.conf
Sun, Sep 21, 2:53 PM
markj committed rGc3a8da8f6828: vdso: Build without debug info (authored by markj).
vdso: Build without debug info
Sun, Sep 21, 2:53 PM
markj committed rGd93223f34bee: random: Make random_source definitions const (authored by markj).
random: Make random_source definitions const
Sun, Sep 21, 2:53 PM
markj committed rG527c05afa6d9: vm_pageout: Scan inactive dirty pages less aggressively (authored by markj).
vm_pageout: Scan inactive dirty pages less aggressively
Sun, Sep 21, 2:53 PM
markj committed rG3cd8d379e382: tests: Add some regression tests for copy_file_range() (authored by markj).
tests: Add some regression tests for copy_file_range()
Sun, Sep 21, 2:53 PM

Sat, Sep 20

markj committed rG174d5d9397c4: random: fxrng: Add an entry for RANDOM_RANDOMDEV to the source table (authored by markj).
random: fxrng: Add an entry for RANDOM_RANDOMDEV to the source table
Sat, Sep 20, 12:26 PM
markj committed rG7ea59a07046a: sanitizers: Provide wrappers for atomic_testandset_acq_long (authored by markj).
sanitizers: Provide wrappers for atomic_testandset_acq_long
Sat, Sep 20, 12:26 PM
markj closed D52633: random: fxrng: Add an entry for RANDOM_RANDOMDEV to the source table.
Sat, Sep 20, 12:26 PM
markj accepted D52626: powerpc: implement atomic_set/clear_16.
Sat, Sep 20, 12:18 PM
markj accepted D52612: pwait: Fix timeout unit parser.
Sat, Sep 20, 12:17 PM

Fri, Sep 19

markj requested review of D52633: random: fxrng: Add an entry for RANDOM_RANDOMDEV to the source table.
Fri, Sep 19, 11:12 PM
markj added inline comments to D52631: release: Complete NO_ROOTification of Vagrant builds.
Fri, Sep 19, 9:23 PM
markj updated the diff for D52631: release: Complete NO_ROOTification of Vagrant builds.

Remove some unintended modifications.

Fri, Sep 19, 9:21 PM
markj requested review of D52631: release: Complete NO_ROOTification of Vagrant builds.
Fri, Sep 19, 9:04 PM
markj accepted D52625: fusefs: fix a kernel panic regarding SCM_RIGHTS.

I'm sure this will fix the panic, but I can't easily see if it's correct. For instance, if the unix domain socket code does asynchronous fd reclamation using unp_gc_task, the current thread will be some taskqueue thread. Its PID will probably be zero (but this is an implementation detail). I see some special handling for PID 0 e.g. in fuse_filehandle_get_anyflags(). Will this work the way you want in that case?

The FUSE protocol says that every request sent to the server must include the pid, gid, and uid responsible. That's so the server can do access control itself, if it wants to. The entire concept of a fuse_filehandle exists solely to support that requirement. However, it's bullshit. It's a terrible antifeature, because there are many situations in which the kernel can't possibly set those accurately. Most obviously, if a write is coming from the writeback cache. So FUSE daemons can never rely on those fields. Yet, we try to set them anyway, for compliance's sake.

Regarding this particular bug, I'm happy as long as it does not panic. This is another one of those cases where we can't possibly set the uid, gid, or pid to their "correct" values.

There's another stupid detail in the protocol too: fhid. When the kernel does FUSE_OPEN, the server may return an fhid. It's an opaque 64-bit number. But we're supposed to set it in any future request that involves the same open file. It's easily possible for two processes (or even the same process) to open a file multiple times, and we're supposed to keep track of which fhid is needed by each. That's very difficult to due given the design of our VHS. It's easy in Linux, which is probably why it was added to the fuse protocol in the first place. The main purpose, again, is server-side access control. But we have a little optimization. If two different file descriptors have the same uid, pid, gid, and access mode, then we only store one file handle for both. That's because the server almost certainly would treat them the same, for access control decisions. IIRC, that "pid == 0" expression is there precisely because of situations where we don't know the true pid. In such a case, we don't want fuse_filehandle_get_anyflags to match on pid.

So to reiterate, I'm happy as long as it doesn't panic. I'm not upset that the pid field won't be "correct".

Fri, Sep 19, 8:47 PM
markj added a comment to D52625: fusefs: fix a kernel panic regarding SCM_RIGHTS.

I'm sure this will fix the panic, but I can't easily see if it's correct. For instance, if the unix domain socket code does asynchronous fd reclamation using unp_gc_task, the current thread will be some taskqueue thread. Its PID will probably be zero (but this is an implementation detail). I see some special handling for PID 0 e.g. in fuse_filehandle_get_anyflags(). Will this work the way you want in that case?

Fri, Sep 19, 8:21 PM
markj accepted D52626: powerpc: implement atomic_set/clear_16.

The implementation seems ok to me.

Fri, Sep 19, 7:55 PM
markj added a comment to D52542: bhyve: add support for ng_device network backend.

tap_init() will open the device and add it to the mevent loop, which uses kevent() under the hood. But, ng_device doesn't implement d_kqfilter, i.e., ngd_cdevsw doesn't have a d_kqfilter implementation, in contrast with tap devices. How does bhyve know when to read packets from the device?

Please have a look at parent revision D52541, which adds kevent support to ng_device.

Fri, Sep 19, 1:21 PM
markj added inline comments to D52541: ng_device: add kqueue support.
Fri, Sep 19, 1:20 PM
markj added a comment to D52542: bhyve: add support for ng_device network backend.

tap_init() will open the device and add it to the mevent loop, which uses kevent() under the hood. But, ng_device doesn't implement d_kqfilter, i.e., ngd_cdevsw doesn't have a d_kqfilter implementation, in contrast with tap devices. How does bhyve know when to read packets from the device?

Fri, Sep 19, 1:08 PM
markj added inline comments to D52561: iflib: Implement tx desc reclaim threshold.
Fri, Sep 19, 1:02 PM
markj added a comment to D52608: vnode: Rework vput() to avoid holding the vnode lock after decrementing.

It is not safe to modify the vnode structure after releasing one's
reference. Modify vput() to avoid this.

This part I don't understand, as I don't see how it matches the change. If you're the last one dropping a reference, it's safe to modify the vnode, as vput_final() will do, and both versions do not differ in this respect (the hold count is still non-zero, and is decremented at the end of vput_final()). In the original code, you even had the additional "guarantee" of holding the vnode lock. What do you mean exactly by "modifying the vnode structure"?

Fri, Sep 19, 12:50 PM

Thu, Sep 18

markj requested review of D52608: vnode: Rework vput() to avoid holding the vnode lock after decrementing.
Thu, Sep 18, 11:28 PM
markj committed rG182ed3c0755f: pw: Add a metalog output mode (authored by markj).
pw: Add a metalog output mode
Thu, Sep 18, 10:43 PM
markj committed rGa03d150a3d44: pw: Use copy_file_range() when copying skeleton files (authored by markj).
pw: Use copy_file_range() when copying skeleton files
Thu, Sep 18, 10:43 PM
markj committed rG41b2a80353e0: pw: Add a missing chown() when creating dirs in mkdir_home_parents() (authored by markj).
pw: Add a missing chown() when creating dirs in mkdir_home_parents()
Thu, Sep 18, 10:43 PM
markj committed rG42dc71a544a4: pw: Style (authored by markj).
pw: Style
Thu, Sep 18, 10:43 PM
markj committed rGbc69d5dffa21: pw: Clean up a couple of errx() calls (authored by markj).
pw: Clean up a couple of errx() calls
Thu, Sep 18, 10:43 PM
markj committed rGdaa63c9417a2: pw: Print warnings when metadata updates fail (authored by markj).
pw: Print warnings when metadata updates fail
Thu, Sep 18, 10:43 PM
markj closed D52590: pw: Add a metalog output mode.
Thu, Sep 18, 10:43 PM
markj closed D52588: pw: Use copy_file_range() when copying skeleton files.
Thu, Sep 18, 10:43 PM
markj closed D52587: pw: Add a missing chown() when creating dirs in mkdir_home_parents().
Thu, Sep 18, 10:43 PM
markj added inline comments to D52590: pw: Add a metalog output mode.
Thu, Sep 18, 10:26 PM
markj committed rG4784ca874410: pw: Remove duplicate lines from the pw useradd usage message (authored by markj).
pw: Remove duplicate lines from the pw useradd usage message
Thu, Sep 18, 10:11 PM
markj committed rGbf115203bb8a: dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations (authored by markj).
dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations
Thu, Sep 18, 10:11 PM
markj added a comment to D52245: vnode: Assert that VOP_LOCK succeeds in freevnode().
In D52245#1201575, @kib wrote:

Looking at vunref() for a bit and taking fdesc_pathconf() as an example:

vref(vp);
VOP_UNLOCK(vp);
error = kern_fpathconf(...);
vn_lock(vp, LK_SHARED | LK_RETRY);
vunref(vp);
return (error);

The vnode can be vgone()d while the lock is dropped. Suppose usecount == 2 and the vunref() decrements it to 1. Then the VOP_UNLOCK in the VOP_PATHCONF caller can unlock a freed vnode. I don't see a way to fix this without either acquiring the vnode lock in freevnode() in order to provide a barrier (and this sounds deadlock-prone), or changing the VOP contract to permit returning with the vnode unlocked if it is doomed.

I do not understand what you are saying there. Which specific VOP_PATHCONF() would access the freed vnode?

Thu, Sep 18, 8:23 PM
markj added a comment to D52245: vnode: Assert that VOP_LOCK succeeds in freevnode().
In D52245#1201577, @mjg wrote:
In D52245#1201325, @mjg wrote:

Note I proposed a fix to the panic which is orthogonal to the vput change.

So I slept on it. Per my previous remark about possible extra locking *and* not completely taking care of the issue anyway due to vunref, I don't think there is any benefit of this going in (and there is a visible loss)

What about something like the following (ignoring vunref() for a moment)?

if (refcount_release_if_last(&vp->v_usecount))

This would reduce scalability as it would replace fetchadd with a fcmpset loop.

Thu, Sep 18, 7:55 PM
markj added a comment to D52245: vnode: Assert that VOP_LOCK succeeds in freevnode().
In D52245#1201325, @mjg wrote:

Note I proposed a fix to the panic which is orthogonal to the vput change.

So I slept on it. Per my previous remark about possible extra locking *and* not completely taking care of the issue anyway due to vunref, I don't think there is any benefit of this going in (and there is a visible loss)

Thu, Sep 18, 1:59 PM
markj accepted D52600: acpi: Add back `hw.acpi.suspend_state` sysctl.
Thu, Sep 18, 12:41 PM
markj accepted D52598: acpi: Fix panic on poweroff.
Thu, Sep 18, 12:38 PM

Wed, Sep 17

markj added a comment to D52598: acpi: Fix panic on poweroff.

Is the proper fix "just" to plumb the acpi softc through acpi_wake_prep_walk()->AcpiWalkNamespace()->acpi_wake_prep()->...? That doesn't seem too painful.

Wed, Sep 17, 9:31 PM
markj added a comment to D52245: vnode: Assert that VOP_LOCK succeeds in freevnode().
In D52245#1201035, @kib wrote:

IMO the bug is there:
vput()

	if (!refcount_release(&vp->v_usecount)) {
		VOP_UNLOCK(vp);
		return;
	}

vput() released the reference, but still operates on the vnode, unlocks it.

Wed, Sep 17, 2:59 PM
markj added a comment to D52245: vnode: Assert that VOP_LOCK succeeds in freevnode().
In D52245#1193915, @kib wrote:

If we are in freevnode(), there _must_ be no other users for its pointer. Hopefully, if trylock fails, we should see the lock owner in lk_lock, and then see what it does.

Wed, Sep 17, 1:58 PM
markj added a comment to D52045: Copy kqueues into the child on fork.
In D52045#1199301, @kib wrote:
In D52045#1193293, @kib wrote:

From my current PoV, this should be more or less finished implementation. In particular, I reviewed all filters for the need of special copy handling.

Ping?

Wed, Sep 17, 1:38 PM

Tue, Sep 16

markj requested review of D52590: pw: Add a metalog output mode.
Tue, Sep 16, 11:29 PM
markj accepted D52496: witness: Record the first acquired file and line for recursable locks.
Tue, Sep 16, 9:17 PM
markj committed rG135cb071e068: release: Prepare Vagrant cloudware images for building as non-root (authored by markj).
release: Prepare Vagrant cloudware images for building as non-root
Tue, Sep 16, 8:51 PM
markj committed rG8f5791873a30: release: Prepare oracle cloudware images for non-root builds (authored by markj).
release: Prepare oracle cloudware images for non-root builds
Tue, Sep 16, 8:51 PM
markj committed rGf1995d6fc13f: release: Prepare GCE cloudware images for building as non-root (authored by markj).
release: Prepare GCE cloudware images for building as non-root
Tue, Sep 16, 8:51 PM
markj committed rGbab6b01bcfea: release: Make azure cloudware images buildable as non-root (authored by markj).
release: Make azure cloudware images buildable as non-root
Tue, Sep 16, 8:51 PM
markj committed rG8027de008d9f: release: Prepare EC2 cloudware images to be buildable as non-root (authored by markj).
release: Prepare EC2 cloudware images to be buildable as non-root
Tue, Sep 16, 8:51 PM
markj closed D52456: release: Prepare Vagrant cloudware images for building as non-root.
Tue, Sep 16, 8:51 PM
markj closed D52455: release: Prepare GCE cloudware images for building as non-root.
Tue, Sep 16, 8:51 PM
markj closed D52454: release: Prepare oracle cloudware images for non-root builds.
Tue, Sep 16, 8:51 PM
markj closed D52451: release: Make azure cloudware images buildable as non-root.
Tue, Sep 16, 8:51 PM
markj closed D52452: release: Prepare EC2 cloudware images to be buildable as non-root.
Tue, Sep 16, 8:51 PM
markj requested review of D52587: pw: Add a missing chown() when creating dirs in mkdir_home_parents().
Tue, Sep 16, 8:33 PM
markj requested review of D52588: pw: Use copy_file_range() when copying skeleton files.
Tue, Sep 16, 8:33 PM
markj accepted D52582: sdp(3): Change bdaddr parameter type in sdp_register_service().
Tue, Sep 16, 7:24 PM
markj committed rG5eb917426e0a: release: Enable installing packages as a non-root user (authored by markj).
release: Enable installing packages as a non-root user
Tue, Sep 16, 4:15 PM
markj closed D52453: release: Enable installing packages as a non-root user.
Tue, Sep 16, 4:15 PM
markj committed rG4be491e1b9b3: jail: Optionally allow audit session state to be configured in a jail (authored by markj).
jail: Optionally allow audit session state to be configured in a jail
Tue, Sep 16, 3:49 PM
markj added a comment to D52575: dtraceall: Enable kinst for aarch64 and riscv as well.

MFC after: 2 days

Why do you use such short MFC timeouts for non-urgent things? It takes time for other folks to update and test changes, which is the purpose of having the MFC period.

In this case because I thought the change is simple enough. I can bump it to 1-2 weeks if you want.

Tue, Sep 16, 3:32 PM
markj added a comment to D52575: dtraceall: Enable kinst for aarch64 and riscv as well.

MFC after: 2 days

Tue, Sep 16, 3:27 PM
markj accepted D52575: dtraceall: Enable kinst for aarch64 and riscv as well.
Tue, Sep 16, 3:26 PM
markj accepted D52567: vm/vm_fault.c: update and split comments for vm_fault() and vm_fault_trap().
Tue, Sep 16, 3:04 PM
markj added a reverting change for rG246d7e9fc239: jail: Optionally allow audit session state to be configured in a jail: rG1c3ca0c733a4: Revert "jail: Optionally allow audit session state to be configured in a jail".
Tue, Sep 16, 1:45 PM
markj committed rG1c3ca0c733a4: Revert "jail: Optionally allow audit session state to be configured in a jail" (authored by markj).
Revert "jail: Optionally allow audit session state to be configured in a jail"
Tue, Sep 16, 1:45 PM
markj added a reverting change for D51719: jail: Optionally allow audit session state to be configured in a jail: rG1c3ca0c733a4: Revert "jail: Optionally allow audit session state to be configured in a jail".
Tue, Sep 16, 1:45 PM
markj accepted D52567: vm/vm_fault.c: update and split comments for vm_fault() and vm_fault_trap().
Tue, Sep 16, 1:31 PM