Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (611 w, 6 d)

Recent Activity

Today

kib updated the diff for D55135: Sprinkle the use of freebsd32_uint64_t over compat32.

sys/user.h: remove XXXSKE markers

Thu, Feb 5, 8:22 PM
kib requested review of D55135: Sprinkle the use of freebsd32_uint64_t over compat32.
Thu, Feb 5, 8:09 PM
kib accepted D54920: STACKALIGN: Reimplement in terms of __align_down.

There are opportunities with amd64 at least, but I can do it myself after this patch lands. Thanks.

Thu, Feb 5, 6:42 PM
kib added a comment to D55077: OptionalObsoleteFiles: Don't mark /usr/lib/debug/boot directory obsolete.

My previous answer was probably not quite clear in some aspects. I mean, on make installkernel we should either rename /usr/lib/debug/boot, or remove it, before installing new debug symbols.

Thu, Feb 5, 12:21 PM
kib added a comment to D55077: OptionalObsoleteFiles: Don't mark /usr/lib/debug/boot directory obsolete.

Kernel debug files aren't controlled by WITH_/WITHOUT_DEBUG_FILES so should not be removed here

Oh, I see, these seem to be controlled by WITH[OUT]_SPLIT_KERNEL_DEBUG. But where we should put the code that will mark files in /usr/lib/debug/boot/{kernel,modules} 'obsolete'? I guess it must be somewhere in sys/, but I'm not sure where exactly.

Thu, Feb 5, 12:16 PM
kib requested changes to D42470: libc: return error number on ptsname_r failure.

Well, API or ABI, as is it is a sudden change in the behavior for the same code compiled against new or old base. IMO the #define posix is the required workaround if we going to change the ptsname_r() this way.

Thu, Feb 5, 8:10 AM

Yesterday

kib accepted D55114: sched_shim: Drop no-ifunc case.

I think the idea was to use VARARG, but then the types and arg names have to be split out of it. Something similar to what is done to EXTERROR() from sys/exterrvar.h and CTR() from sys/ktr.h. But it might be too convoluted for the limited use.

Wed, Feb 4, 9:05 PM
kib added inline comments to D44454: intelhfi - Intel TD/HFI driver - Part2: Enable thermal interrupt handler for Local APIC's..
Wed, Feb 4, 4:35 PM · Contributor Reviews (src)
kib added a comment to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.

FreeBSD is realtime kernel, where regions with disabled interrupts are exceptional. Trap happening with interrupts disabled means that CPU meeting some conditions that should not be there.
It might be that trap.c and exceptions.S somewhat evolved, but the guiding rule there was a simplification. As a secondary effect, it might take exceptions with interrupts disabled, in some cases.
It still assumes that e.g. GSBASE is valid, which is generally not true for regions with disabled interrupts. So I prefer to keep it close to original design.

Wed, Feb 4, 9:04 AM
kib updated the diff for D55045: x86: add a safe variant of MSR_OP_SCHED* operations.

Fix locking error with sched_bind()

Wed, Feb 4, 3:21 AM
kib updated the diff for D55045: x86: add a safe variant of MSR_OP_SCHED* operations.

Execute SCHED ops in critical section

Wed, Feb 4, 3:18 AM
kib updated the diff for D55045: x86: add a safe variant of MSR_OP_SCHED* operations.

Minor clarifications to the description.

Wed, Feb 4, 12:54 AM
kib updated the diff for D55045: x86: add a safe variant of MSR_OP_SCHED* operations.

finalize the change

Wed, Feb 4, 12:47 AM

Tue, Feb 3

kib accepted D55082: riscv: implement kernel ifunc resolution.
Tue, Feb 3, 10:10 PM
kib accepted D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.

I think it would be simpler if you commit this version now, then I will provide the proper herald comment explaining the modes, in mine SAFE patch.

Tue, Feb 3, 12:06 PM
kib added a comment to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
In D54996#1258511, @kib wrote:

I am fine with either case, IMO it is simpler to disable the interrupts unconditionally. It is boot code only anyway, and we should target the code size and not code speed.

Done.

But did you noted my yesterday comment about SCHED for the herald comment?

Yes. It was more of my intention to leave that discussion for when reviewing your patch instead of amending the code comments not to match what the code currently does, but there seems to still be some divergence here.

I think our goal should be to make these MSR accesses atomic, and change the rest to make it happen rather than the other way around. The SAFE variant should not be treated differently.

The only difference for SAFE is using *msr_safe(), which can fault with #GP(0) -> T_PROTFLT with handlers "installed" through pcb_onfault. After amd64's trap.c code re-examination, I fail to see any reason why this wouldn't work with interrupts disabled or even while holding a spinlock. So, where does "There, it is absolutely required to not hold thread lock around msr_safe() accesses" come from?

Tue, Feb 3, 12:01 PM
kib accepted D55075: kern linker: Mark link_elf_ireloc as no-KASAN.

Do you mean that the low-level startup, e.g. hammertime() for amd64, and initarm() for arm64, must be tagged with __nosanitizeaddress as well? (And recursively every function that is called from them, at least up to the point where ifuncs are resolved).

Tue, Feb 3, 11:44 AM
kib added a comment to D55056: fusefs: Take mnt_ref when mounting.

You do not need to change fuse_vfsop_unmount()

Not sure how is this possible.

I put debugging printfs into the destructor and fuse_vfsop_unmount(). When I kill -KILL the daemon I see:

===> fdata_dtor
===> fdata_dtor, mnt_ref: 4
===> fuse_vfsop_unmount, ref: 3

The control first enters fdata_dtor, then reaches the code you suggested in the last comment, then enters dounmount and eventually reaches fuse_vfsop_unmount with mnt_ref: 3. This scenario works.

Now if I do proper umount /foo I end up with

===> fuse_vfsop_unmount, ref: 4
===> fdata_dtor

The dounmount -> fuse_vfsop_unmount path happens before the destructor and the refcount is too high, which makes fuse_vfsop_unmount to sleep in [mntref]. When fdata_dtor gets executed the fdata variable is already NULL, so it exits early.

I guess, your intentition was to make the destructor dereference that last reference so that fuse_vfsop_unmount would be able to proceed?

Tue, Feb 3, 10:41 AM
kib committed rGcd8d44173adc: unmount(2): do not allow MNT_DEFERRED or MNT_RECURSE flags from userspace (authored by kib).
unmount(2): do not allow MNT_DEFERRED or MNT_RECURSE flags from userspace
Tue, Feb 3, 10:26 AM
kib committed rG120ca8d74b46: Re-introduce kern.sched.topology_spec (authored by kib).
Re-introduce kern.sched.topology_spec
Tue, Feb 3, 2:44 AM
kib closed D55062: Re-introduce kern.sched.topology_spec.
Tue, Feb 3, 2:43 AM

Mon, Feb 2

kib added a comment to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.

Gentle ping.

Is it OK like that? Or would you prefer, e.g., always disabling interrupts in the MSR_OP_LOCAL case?

Mon, Feb 2, 8:53 PM
kib added a comment to D55056: fusefs: Take mnt_ref when mounting.

No, this is not what I suggested. You do not need to change fuse_vfsop_unmount(), instead in fdata_destroy()

	if (fdata->mp != NULL) {
              if fdata->dataflags & FSESS_AUTO_UNMOUNT)
		dounmount(fdata->mp, MNT_FORCE, curthread);
	      else
                 mnt_rel(fdata-mp);
       }

modulo small details that you should figure out.

Mon, Feb 2, 8:43 PM
kib requested review of D55062: Re-introduce kern.sched.topology_spec.
Mon, Feb 2, 8:29 PM
kib committed rGa8e92198f854: devfs: unlock the directory vnode around the call to dev_clone handler (authored by kib).
devfs: unlock the directory vnode around the call to dev_clone handler
Mon, Feb 2, 7:51 PM
kib closed D55028: devfs: unlock the directory vnode around the call to dev_clone handler.
Mon, Feb 2, 7:51 PM
kib accepted D55049: geom: Make g_waitidle() wait for orphaned providers.
Mon, Feb 2, 5:04 AM
kib added inline comments to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
Mon, Feb 2, 12:03 AM
kib requested review of D55045: x86: add a safe variant of MSR_OP_SCHED* operations.
Mon, Feb 2, 12:01 AM

Sun, Feb 1

kib added inline comments to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
Sun, Feb 1, 10:50 PM
kib accepted D55023: runat: Add -h to manipulate a symbolic link's named attribute dir.
Sun, Feb 1, 10:26 PM
kib committed rG70c55537c134: posix_spawn: use rfork_thread on all arches (authored by kib).
posix_spawn: use rfork_thread on all arches
Sun, Feb 1, 9:47 PM
kib committed rG7659f33149d6: kern/kern_exit.c: define the exterror category for exit/wait (authored by kib).
kern/kern_exit.c: define the exterror category for exit/wait
Sun, Feb 1, 9:47 PM
kib committed rG4aead2abdae2: Add pdrfork to OpenBSM (authored by asomers).
Add pdrfork to OpenBSM
Sun, Feb 1, 9:43 PM
kib committed rG4d8e4b67f5b5: libc: document posix_spawnattr_{get,set}procdescp_np(3) (authored by kib).
libc: document posix_spawnattr_{get,set}procdescp_np(3)
Sun, Feb 1, 9:42 PM
kib committed rG124f70e36e35: libsys, libc: provide rfork_thread() and pdrfork_thread() on all arches (authored by kib).
libsys, libc: provide rfork_thread() and pdrfork_thread() on all arches
Sun, Feb 1, 9:42 PM
kib committed rGf7bcd6305226: posix_spawnattr_getexecfd_np.3: add closing .Fc (authored by kib).
posix_spawnattr_getexecfd_np.3: add closing .Fc
Sun, Feb 1, 9:42 PM
kib committed rGc5fc8e4fdb09: libsys: add pdrfork_thread() on x86 (authored by kib).
libsys: add pdrfork_thread() on x86
Sun, Feb 1, 9:42 PM
kib committed rGad6a63b4ec6b: libc: document posix_spawnattr_getexecfd_np(3) (authored by kib).
libc: document posix_spawnattr_getexecfd_np(3)
Sun, Feb 1, 9:42 PM
kib committed rGf68ddd04ae06: libc: add posix_spawnattr_{get,set}procdescp_np (authored by kib).
libc: add posix_spawnattr_{get,set}procdescp_np
Sun, Feb 1, 9:42 PM
kib committed rG6b9e7e922d8b: libc: add posix_spawnattr_{get,set}execfd_np(3) (authored by kib).
libc: add posix_spawnattr_{get,set}execfd_np(3)
Sun, Feb 1, 9:42 PM
kib committed rG5b61a139a63c: Regen for the fork and exit/wait exterror category addition (authored by kib).
Regen for the fork and exit/wait exterror category addition
Sun, Feb 1, 9:42 PM
kib committed rG892a09e12371: Regen sysents for addition of pdrfork and pdwait (authored by kib).
Regen sysents for addition of pdrfork and pdwait
Sun, Feb 1, 9:42 PM
kib committed rG6b89954dd36d: rights.4: document CAP_PDWAIT (authored by kib).
rights.4: document CAP_PDWAIT
Sun, Feb 1, 9:42 PM
kib committed rG6820fe965f1d: lib/libsys, lib/libc: export pdwait (authored by kib).
lib/libsys, lib/libc: export pdwait
Sun, Feb 1, 9:42 PM
kib committed rG780b7f9e0ece: Document pdrfork(2) and pdwait(2) (authored by kib).
Document pdrfork(2) and pdwait(2)
Sun, Feb 1, 9:42 PM
kib committed rGd4d20337fe70: procdesc: postpone freeing the zombie' pid until procdesc is freed (authored by kib).
procdesc: postpone freeing the zombie' pid until procdesc is freed
Sun, Feb 1, 9:42 PM
kib committed rGab3f893cd989: sys: Add cap_pdwait_rights (authored by kib).
sys: Add cap_pdwait_rights
Sun, Feb 1, 9:42 PM
kib committed rG758de6465572: Add pdwait(2) (authored by kib).
Add pdwait(2)
Sun, Feb 1, 9:42 PM
kib committed rG79f19b07438b: audit: handle AUE_PDWAIT (authored by kib).
audit: handle AUE_PDWAIT
Sun, Feb 1, 9:42 PM
kib committed rG85a43441ccff: kern/kern_exit.c: extract wait6_check_alive() helper (authored by kib).
kern/kern_exit.c: extract wait6_check_alive() helper
Sun, Feb 1, 9:42 PM
kib committed rG2e5b89c5ac3d: kern/kern_exit.c: extract some helpers from proc_to_reap() (authored by kib).
kern/kern_exit.c: extract some helpers from proc_to_reap()
Sun, Feb 1, 9:42 PM
kib committed rGf48772e6dac2: lib/libsys, lib/libc: export pdrfork(2) (authored by kib).
lib/libsys, lib/libc: export pdrfork(2)
Sun, Feb 1, 9:42 PM
kib committed rG4ae6f372e26c: sys: add pdrfork(2) (authored by kib).
sys: add pdrfork(2)
Sun, Feb 1, 9:42 PM
kib committed rG5017c8b16100: sys: add AUE_PDRFORK (authored by kib).
sys: add AUE_PDRFORK
Sun, Feb 1, 9:41 PM
kib committed rG304d02fc2e43: kern/kern_fork.c: define the exterror category for fork (authored by kib).
kern/kern_fork.c: define the exterror category for fork
Sun, Feb 1, 9:41 PM
kib committed rG8b6f9f8afe7e: kern/kern_fork/exit.c: organize includes (authored by kib).
kern/kern_fork/exit.c: organize includes
Sun, Feb 1, 9:41 PM
kib committed rGeadd5601bcc3: kern/kern_exit.c: some style (authored by kib).
kern/kern_exit.c: some style
Sun, Feb 1, 9:41 PM
kib committed rG38901e30663d: sbin/setkey: add -Z option to disable receive timeouts (authored by kib).
sbin/setkey: add -Z option to disable receive timeouts
Sun, Feb 1, 9:41 PM
kib added inline comments to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
Sun, Feb 1, 8:49 PM
kib accepted D55029: LinuxKPI: add str_read_write().
Sun, Feb 1, 8:46 PM
kib added inline comments to D55029: LinuxKPI: add str_read_write().
Sun, Feb 1, 7:23 PM
kib added inline comments to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
Sun, Feb 1, 2:31 AM
kib updated the diff for D55028: devfs: unlock the directory vnode around the call to dev_clone handler.

Add comment explaining why dvp is unlocked, and how possible reclamation is handled.

Sun, Feb 1, 2:23 AM
kib added inline comments to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
Sun, Feb 1, 2:03 AM
kib added inline comments to D55028: devfs: unlock the directory vnode around the call to dev_clone handler.
Sun, Feb 1, 1:59 AM

Sat, Jan 31

kib added a reviewer for D55028: devfs: unlock the directory vnode around the call to dev_clone handler: kevans.
Sat, Jan 31, 11:06 PM
kib requested review of D55028: devfs: unlock the directory vnode around the call to dev_clone handler.
Sat, Jan 31, 11:05 PM
kib added a comment to D55023: runat: Add -h to manipulate a symbolic link's named attribute dir.

BTW, ls(1) and find(1) use -P for the same functionality. ls(1) does not fail if the argument is not a symbolic link.

Sat, Jan 31, 9:56 PM
kib added inline comments to D55023: runat: Add -h to manipulate a symbolic link's named attribute dir.
Sat, Jan 31, 9:26 PM
kib added inline comments to D55023: runat: Add -h to manipulate a symbolic link's named attribute dir.
Sat, Jan 31, 9:24 PM
kib added inline comments to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
Sat, Jan 31, 7:37 PM
kib added inline comments to D54996: x86: x86_msr_op(): Add comments, guarantee atomicity.
Sat, Jan 31, 7:22 PM

Fri, Jan 30

kib added inline comments to D54970: arm: Implement kernel IFUNC.
Fri, Jan 30, 9:06 PM
kib added inline comments to D54961: bus: Provide 32-bit compatibility.
Fri, Jan 30, 6:58 PM
kib committed rG245157fd8a38: ktrcsw(): should not be called when the thread is owning interlock or on sleepq (authored by kib).
ktrcsw(): should not be called when the thread is owning interlock or on sleepq
Fri, Jan 30, 6:46 PM
kib added inline comments to D54970: arm: Implement kernel IFUNC.
Fri, Jan 30, 6:44 PM
kib added inline comments to D54970: arm: Implement kernel IFUNC.
Fri, Jan 30, 6:05 PM
kib added a comment to D54954: atrtc: Prevent duplicate device attachment.

FWIW, we do not disable EFI RT timer services when we attach to rtc, and in reverse. I am not sure, might be we should. Right now we lock accesses according to the UEFI spec recommendation.

Fri, Jan 30, 2:26 AM

Thu, Jan 29

kib closed D54945: SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread.
Thu, Jan 29, 11:27 PM
kib committed rGb249cb2b18b3: SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread (authored by kib).
SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread
Thu, Jan 29, 11:27 PM
kib committed rG0730a05cd383: tuning.7: document schedulers knobs (authored by kib).
tuning.7: document schedulers knobs
Thu, Jan 29, 10:44 PM
kib closed D54951: tuning.7: document schedulers knobs.
Thu, Jan 29, 10:44 PM
kib updated the diff for D54951: tuning.7: document schedulers knobs.

Editings by olce.

Thu, Jan 29, 10:37 PM
kib updated the diff for D54945: SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread.

Add assert that ast handler is called for curthread.

Thu, Jan 29, 10:35 PM
kib added inline comments to D54945: SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread.
Thu, Jan 29, 10:34 PM
kib requested review of D54951: tuning.7: document schedulers knobs.
Thu, Jan 29, 9:42 PM
kib updated the diff for D54945: SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread.

Simplify. Use TDP_SCHED1 instead of the new field in the ts structure.

Thu, Jan 29, 9:30 PM
kib requested review of D54945: SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread.
Thu, Jan 29, 6:19 PM
kib committed rGb125c4d13095: sys: Make sched_4bsd a sched instance (authored by kib).
sys: Make sched_4bsd a sched instance
Thu, Jan 29, 6:18 PM
kib committed rG783b8a0fd880: kern/sched: deduplicate dtrace hook vars (authored by kib).
kern/sched: deduplicate dtrace hook vars
Thu, Jan 29, 6:13 PM
kib committed rGa84a39dfe5d1: kern/sched: move duplicate preemption stat vars into sched_shim.c (authored by kib).
kern/sched: move duplicate preemption stat vars into sched_shim.c
Thu, Jan 29, 6:13 PM
kib committed rG9409e8698030: kern/sched: deduplicate sdt probes (authored by kib).
kern/sched: deduplicate sdt probes
Thu, Jan 29, 6:13 PM
kib committed rG1322760fd127: sys: enable both SCHED_ULE and SCHED_4BSD for some configs (authored by kib).
sys: enable both SCHED_ULE and SCHED_4BSD for some configs
Thu, Jan 29, 6:13 PM
kib committed rGff870b783f09: sched_shim: restore kern.ccpu sysctl (authored by kib).
sched_shim: restore kern.ccpu sysctl
Thu, Jan 29, 6:13 PM
kib committed rG5a6e0e31bc2e: sysctl kern.sched.ule.topology_spec: allow to run if ULE is not initialized (authored by kib).
sysctl kern.sched.ule.topology_spec: allow to run if ULE is not initialized
Thu, Jan 29, 6:13 PM
kib committed rG1c4e16f6db81: x86/cpu_machdep.c: unconditionally fence (authored by kib).
x86/cpu_machdep.c: unconditionally fence
Thu, Jan 29, 6:13 PM
kib committed rGb602ba1b5fd9: net/iflib.c: move out scheduler-depended code into the hook (authored by kib).
net/iflib.c: move out scheduler-depended code into the hook
Thu, Jan 29, 6:13 PM
kib committed rGc384b35e42ee: x86/local_apic.c: remove direct SCHED_ULE use (authored by kib).
x86/local_apic.c: remove direct SCHED_ULE use
Thu, Jan 29, 6:13 PM
kib committed rG377c053a43f3: cpu_switch(): unconditionally wait on the blocked mutex transient (authored by kib).
cpu_switch(): unconditionally wait on the blocked mutex transient
Thu, Jan 29, 6:13 PM