Page MenuHomeFreeBSD
Feed Advanced Search

Today

kib created D23386: Provide support for fdevname(3) on linuxkpi-backed devices..
Mon, Jan 27, 9:59 PM
kib added inline comments to D23378: sysctl(9): add CTLFLAG_NEEDGIANT flag.
Mon, Jan 27, 3:27 PM
kib added inline comments to D23355: Reimplement stack capture of running threads..
Mon, Jan 27, 3:22 PM
kib added inline comments to D23348: Add missing EPOCH wrappers as a pre-step for D23347.
Mon, Jan 27, 3:16 PM
kib closed D23380: Fix aggregating geoms for BIO_SPEEDUP..
Mon, Jan 27, 1:15 PM
kib committed rS357172: Fix aggregating geoms for BIO_SPEEDUP..
Fix aggregating geoms for BIO_SPEEDUP.
Mon, Jan 27, 1:15 PM
kib committed rS357171: MFC r356919,r357054:.
MFC r356919,r357054:
Mon, Jan 27, 1:12 PM
kib created D23380: Fix aggregating geoms for BIO_SPEEDUP..
Mon, Jan 27, 8:23 AM

Yesterday

kib added a comment to D23291: vfs: add mandatory inactive processing to vget.

Are you sure that syncer would process such vnodes ? After recent changes, for UFS I think only vnodes with UFS i_flags are on the syncer list, no ?

Sun, Jan 26, 10:05 PM
kib added a comment to D23291: vfs: add mandatory inactive processing to vget.
In D23291#512527, @jeff wrote:

I'm not sure why we are still pursuing this when the bugs relating to inactive processing were fixed when vget was changed to not drop the lock.
When I originally weakened the guarantee for inactive I discussed it at length with Kirk and he agreed that no such guarantee was intended. I regret not taking it all the way then. I would like to reduce the proliferation of interfaces to deal with locks and references. If we went forward with this patch, who would use this interface? How would a filesystem author know which is correct? People rightly think our current VFS is confusing. There are some specific cases that have been added over the years that I don't fully understand myself. I have several regrets from my time bringing in SMP support and lockless lookups that mjg has already resolved. I want us to continue to work towards a healthy and simple middle layer even if that means we have to fix a handful of bugs along the way. I don't think performance and correctness need be at odds if we continue to look at problems holistically.

Sun, Jan 26, 9:23 PM
kib added inline comments to D23355: Reimplement stack capture of running threads..
Sun, Jan 26, 8:02 PM
kib added a comment to D22839: random(4) fenestrasX: Push root seed version to arc4random(3).

I still do not understand the need for both fx_generation and fx_generation32, and why fx_generation is 64bit.

Sun, Jan 26, 7:14 PM
kib added inline comments to D23291: vfs: add mandatory inactive processing to vget.
Sun, Jan 26, 6:44 PM
kib accepted D23189: Fix definition and use of RB_AUGMENT.
Sun, Jan 26, 5:07 PM

Sat, Jan 25

kib added inline comments to D23291: vfs: add mandatory inactive processing to vget.
Sat, Jan 25, 2:02 PM
kib accepted D23363: Fix some misleading indentation warnings reported by recent clang..
Sat, Jan 25, 1:14 PM
kib added a comment to D23355: Reimplement stack capture of running threads..

Isn't the code to capture stack trace become MI ?

Sat, Jan 25, 11:23 AM
kib accepted D23362: Compile hack.c with normal CFLAGS + -shared -nostdlib..

BTW I think that pico extension is not correct (as much as extension can be).

Sat, Jan 25, 10:39 AM
kib accepted D23357: vfs: stop null checking routines in vop wrappers.

Can you show old vs. generated vnode_if.

Sat, Jan 25, 10:37 AM

Fri, Jan 24

kib accepted D23336: stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite.
Fri, Jan 24, 8:35 PM
kib committed rS357091: Handle a race of collapse with a retrying fault..
Handle a race of collapse with a retrying fault.
Fri, Jan 24, 7:43 PM
kib closed D23331: Handle a race of collapse with a retrying fault..
Fri, Jan 24, 7:42 PM
kib accepted D23215: [wip] ufs: add missing vgone calls to accomodate unlocked vnode with i_mode == 0.

I think that this change can/should be committed regardless of other actions in this area. It is correct for the places where you put it.

Fri, Jan 24, 4:00 PM
kib added a comment to D23347: Add support for batching interrupts in system interrupt code.

To add some colors to the discussion, I disagree with both approaches. My main complain is that *net epoch* should not be married with the interrupts handlers infrastructure, neither in code nor in data. I agree with people that mark this as layering violations.

Fri, Jan 24, 3:52 PM

Thu, Jan 23

kib added a comment to D23341: Fix Linuxulator clock_gettime() and clock_getres() for cpu clocks.

Why do you need D23340 ? Why the current method is not sufficient ?

Thu, Jan 23, 10:02 PM
kib added inline comments to D23189: Fix definition and use of RB_AUGMENT.
Thu, Jan 23, 5:56 PM
kib accepted D23336: stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite.
Thu, Jan 23, 5:39 PM
kib added inline comments to D23336: stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite.
Thu, Jan 23, 5:17 PM
kib committed rS357054: Fix r356919..
Fix r356919.
Thu, Jan 23, 5:08 PM
kib closed D23330: Fix r356919..
Thu, Jan 23, 5:08 PM
kib added a comment to D23330: Fix r356919..

Isn't curpcb set while still on the old stack? We load the new rsp after setting curpcb. In fact, the same is true for curthread, I didn't notice it before.

Thu, Jan 23, 2:03 PM
kib added inline comments to D23189: Fix definition and use of RB_AUGMENT.
Thu, Jan 23, 1:56 PM
kib accepted D23328: Don't enable interrupts in init_secondary()..
Thu, Jan 23, 12:18 PM
kib updated subscribers of D23331: Handle a race of collapse with a retrying fault..
Thu, Jan 23, 11:24 AM
kib created D23331: Handle a race of collapse with a retrying fault..
Thu, Jan 23, 11:24 AM
kib created D23330: Fix r356919..
Thu, Jan 23, 11:18 AM

Wed, Jan 22

kib accepted D23326: Move zero fill into its own function so that the object locking is more clear..
Wed, Jan 22, 9:46 PM
kib accepted D23311: Move the fault getpages code into its own function..
Wed, Jan 22, 9:11 PM
kib accepted D23321: Restructure fault to eliminate a goto and label..

Note that the title of the review is misleading.

Wed, Jan 22, 8:21 PM
kib accepted D23320: Move fault page allocation into its own routine..
Wed, Jan 22, 8:18 PM
kib added inline comments to D23311: Move the fault getpages code into its own function..
Wed, Jan 22, 1:31 PM
kib accepted D23310: Move the backing_object chain traversal into its own function..
Wed, Jan 22, 1:23 PM
kib accepted D23303: Move map relookup into its own function..
Wed, Jan 22, 1:15 PM

Tue, Jan 21

kib accepted D23304: Move cow into its own function..
Tue, Jan 21, 9:07 PM
kib added inline comments to D23303: Move map relookup into its own function..
Tue, Jan 21, 9:03 PM
kib accepted D23302: Move map lookup into a separate function..
Tue, Jan 21, 9:00 PM
kib accepted D23301: Move a handful of stack variables into the faultstate..
Tue, Jan 21, 8:55 PM
kib accepted D23270: ULE: set td_oncpu before switching..
Tue, Jan 21, 8:39 PM
kib accepted D23299: vm_map_submap(): Avoid unnecessary clipping..
Tue, Jan 21, 8:37 PM
kib accepted D22646: Add kern_unmount(), use in Linuxulator.

Why would it? It doesn't make much sense; you want it to unmount what you pass as an argument, and not it's linuxulator counterpart. Besides; this is mostly for use inside jails/chroots.

Tue, Jan 21, 7:58 PM
kib committed rS356940: Add support for Hygon Dhyana Family 18h processor..
Add support for Hygon Dhyana Family 18h processor.
Tue, Jan 21, 1:22 PM
kib closed D23163: Add support for Hygon Dhyana Family 18h processor.
Tue, Jan 21, 1:22 PM
kib added inline comments to D22646: Add kern_unmount(), use in Linuxulator.
Tue, Jan 21, 12:04 PM

Mon, Jan 20

kib added a comment to D23184: 1/3 vfs: stop handling VI_OWEINACT in vget.
In D23184#510594, @jeff wrote:

I agree with mjg. Inactive has been a half promise since shared locking went in. This is really my mess originally. Better to consistently not make the promise and clean up the interface.

Mon, Jan 20, 9:49 PM
kib accepted D23283: Consistently use vm_page_valid() to validate pages..
Mon, Jan 20, 9:25 PM
kib accepted D23282: Move readahead into its own function..
Mon, Jan 20, 9:23 PM
kib committed rS356919: x86: Wait for curthread to be set up as an indicator that the boot stack.
x86: Wait for curthread to be set up as an indicator that the boot stack
Mon, Jan 20, 5:23 PM
kib closed D23276: x86: Wait for curthread to be set up as an indicator that the boot stack is no longer used..
Mon, Jan 20, 5:23 PM
kib added a comment to D12773: Manage thread signal mask using a shared word, instead of syscall..
In D12773#510434, @mjg wrote:
In D12773#510115, @kib wrote:
In D12773#509975, @mjg wrote:

In general imo the kernel should automatically clear the flag after n syscalls without changes and let userspace know. Then should userspace continue using sigaction it will know whether it needs to call the kernel, all while not relying on it to eventually clear the flag to prevent avoidable calls to fuword.

I might do this for some future version.

Is there a problem making the modification I suggested? It would also enable the optimization for all sigprocmask consumers, not only rtld. As it is this adds fuword call overhead for long running processes which I suspect can be avoided. If it happens later it may need some form of version checks to see if libc knows about disablement by the kernel.

In fact yes, after some thinking about it I highly dislike that. This is not a kernel job to stop the mode requested by userspace. It would be similar e.g. for kernel to close some file descriptor because it decided that userspace executed some number of syscalls that did not touch them.

I don't think the analogy holds. Should the dedicated "fastsigblock" syscall be removed and e.g., another argument added to sigprocmask syscall (to specify the area to read stuff from) it could be easily considered as just advisory. This would make the mechanism as something between libc and the kernel.

We are not going to change sigprocmask(2). And if a new syscall is added, then it is not better or worse of sigfastblock(2).

Mon, Jan 20, 5:14 PM
kib accepted D23279: Remove some lingering page lock usages..
Mon, Jan 20, 4:00 PM
kib added inline comments to D22646: Add kern_unmount(), use in Linuxulator.
Mon, Jan 20, 3:54 PM
kib accepted D23163: Add support for Hygon Dhyana Family 18h processor.

Do you want me to commit this now ?

Mon, Jan 20, 3:52 PM
kib added a comment to D23270: ULE: set td_oncpu before switching..

Instead of depending on scheduler internals, what do you think of instead calling smp_rendezvous()? Once it returns we know that all APs have enabled interrupts, and they can only do that after cpu_throw() switches to the idle thread and fork_exit() reenables interrupts.

Mon, Jan 20, 10:05 AM
kib created D23276: x86: Wait for curthread to be set up as an indicator that the boot stack is no longer used..
Mon, Jan 20, 10:03 AM
kib committed rS356907: MFC r356682:.
MFC r356682:
Mon, Jan 20, 9:16 AM
kib committed rS356906: MFC r356682:.
MFC r356682:
Mon, Jan 20, 8:55 AM

Sun, Jan 19

kib added a comment to D23270: ULE: set td_oncpu before switching..

In fact, there is at least one place that is affected, I remembered.

Sun, Jan 19, 11:15 PM
kib accepted D23270: ULE: set td_oncpu before switching..
Sun, Jan 19, 10:27 PM
kib added a comment to D23184: 1/3 vfs: stop handling VI_OWEINACT in vget.

If you reliably do inactivation on vget() for the unreferenced vnodes, this should fix the i_mode == 0 issue. More, it should fix it for all filesystems, not only UFS.

Sun, Jan 19, 8:26 PM
kib added inline comments to D23243: x86: fix a race during running thread stack capture resulting in unclaimed NMI.
Sun, Jan 19, 7:35 PM
kib added a comment to D12773: Manage thread signal mask using a shared word, instead of syscall..
In D12773#509975, @mjg wrote:
In D12773#509824, @kib wrote:
In D12773#509808, @mjg wrote:

This fails to build for me on head:

ld: error: /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libpthread.so: undefined reference to __sys_sigfastblock
cc: error: linker command failed with exit code 1 (use -v to see invocation)

Did you do 'make sysent' before starting the build ? It works for me.

That's my bad, works now.

I'm not confident from just reading. Is the TDP_SIGFASTBLOCK flag getting cleared by rtld at some point for single-threaded case?

No, it is not. The flag is set when fast sigblock location is registered, and it is there until either libthr is loaded (which re-registers) or execve(2) is executed.

In general imo the kernel should automatically clear the flag after n syscalls without changes and let userspace know. Then should userspace continue using sigaction it will know whether it needs to call the kernel, all while not relying on it to eventually clear the flag to prevent avoidable calls to fuword.

I might do this for some future version.

Is there a problem making the modification I suggested? It would also enable the optimization for all sigprocmask consumers, not only rtld. As it is this adds fuword call overhead for long running processes which I suspect can be avoided. If it happens later it may need some form of version checks to see if libc knows about disablement by the kernel.

In fact yes, after some thinking about it I highly dislike that. This is not a kernel job to stop the mode requested by userspace. It would be similar e.g. for kernel to close some file descriptor because it decided that userspace executed some number of syscalls that did not touch them.

Sun, Jan 19, 7:17 PM

Sat, Jan 18

kib added a comment to D23251: Correct the default initial thread stack size..

Are you sure ? I do not see what you claim, in the code:

#define THR_STACK_DEFAULT		(sizeof(void *) / 4 * 1024 * 1024)
Sat, Jan 18, 9:14 PM
kib added a comment to D23247: Provide O_SEARCH as an alias for O_EXEC.
In D23247#509800, @kib wrote:

Right. So then I am not sure if we should act as if O_RDONLY is specified, rather I think we should not. You should be able to open(O_EXEC) a dir without r permission, I think this is the main point of the flag.

Hmm... this gets a little more complicated, but I'm inclined to agree. Further, in my testing, Linux's O_PATH (which has been accepted by some as 'close enough' to O_EXEC/O_SEARCH and it's advertised as being suitable for O_EXEC) will ignore the r bit by virtue of the fact that it's not even opening the underlying file/dir.

Sat, Jan 18, 7:42 PM
kib added a comment to D12773: Manage thread signal mask using a shared word, instead of syscall..
In D12773#509808, @mjg wrote:

This fails to build for me on head:

ld: error: /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libpthread.so: undefined reference to __sys_sigfastblock
cc: error: linker command failed with exit code 1 (use -v to see invocation)

Did you do 'make sysent' before starting the build ? It works for me.

Sat, Jan 18, 5:58 PM
kib added a comment to D23247: Provide O_SEARCH as an alias for O_EXEC.
In D23247#509797, @kib wrote:

I think the status quo is fine from a validity perspective. O_EXEC | O_RDONLY is what almost everyone that wants to use it gets anyways, because we reject all of the non !RDONLY ACCMODE bits in conjunction with O_EXEC. I think it makes sense to continue rejecting the other bits, because I do not think a writable O_EXEC/O_SEARCH directory has any obvious interpretation.

I do not understand this part of your response. O_EXEC | O_RDONLY i distinct from O_EXEC (and from O_RDONLY in fact). O_EXEC allows entry lookup, while O_RDONLY allows entry reading.
My point is that we migh start allowing O_EXEC | O_RDONLY for directories.

Sorry, my point was that O_RDONLY is defined to be 0 and anyone currently using it is implicitly getting O_EXEC | O_RDONLY anyways if they're using O_EXEC and there's no way to get any other behavior because you can't specify any non-0 ACCMODE bits with O_EXEC without rejection in kern_openat().

Sat, Jan 18, 4:15 PM
kib added a comment to D23184: 1/3 vfs: stop handling VI_OWEINACT in vget.
In D23184#509790, @mjg wrote:

Unclear what you mean.
inactive effectively not being done matches the current behavior (excluding the rare case where someone called vget with LK_EXCLUSIVE)
new behavior is that should the race happen, the syncer will keep setting VI_DEFINACT flag and retrying on every run. if this is considered a problem I can augment the code in vfs_deferred_inactive so that it clears VI_OWEINACT if v_usecount > 0, similarly to how vget does it now.

Sat, Jan 18, 4:13 PM
kib added a comment to D23247: Provide O_SEARCH as an alias for O_EXEC.
In D23247#509781, @kib wrote:

Do we expect that O_EXEC might start meaning anything for directories ? Does e.g. linux define different values for O_EXEC vs. O_SEARCH ? Currently POSIX says that the result is unspecified.

I don't think we would expect this at all. Currently, AFAICT, Linux (nor glibc) actually implement O_SEARCH because they have O_PATH. Illumos and NetBSD both define them as distinctly different values, while musl defines them as the same (and equivalent to O_PATH as a close approximation supported by the kernel they primarily operate under). Rich Felker had at some point suggested that Linux should choose O_PATH|03 or something to this effect as O_SEARCH since the semantics are slightly different from what they provide for O_PATH, but I cannot find where I read this now.

Ok.

Sat, Jan 18, 3:57 PM
kib accepted D23186: 3/3 vfs: allow v_holdcnt to transition 0->1 without the interlock.
Sat, Jan 18, 2:58 PM
kib accepted D23185: 2/3 vfs: allow v_usecount to transition 0->1 without the interlock.
Sat, Jan 18, 2:56 PM
kib added a comment to D23184: 1/3 vfs: stop handling VI_OWEINACT in vget.

So basically this indefinitely postpone the inactivation after 1->0->1 transition, right ?

Sat, Jan 18, 2:51 PM
kib added a comment to D23247: Provide O_SEARCH as an alias for O_EXEC.

Is it harmful to extend our interpretation of UB for O_EXEC in this way? It's not clear to me that O_EXEC on a directory is otherwise sensible/useful, and I would think no one relies on this now, so I lean towards "not harmful."

Sat, Jan 18, 2:33 PM
kib added inline comments to D23189: Fix definition and use of RB_AUGMENT.
Sat, Jan 18, 2:28 PM
kib added inline comments to D12773: Manage thread signal mask using a shared word, instead of syscall..
Sat, Jan 18, 1:26 PM
kib added a reviewer for D23243: x86: fix a race during running thread stack capture resulting in unclaimed NMI: markj.
Sat, Jan 18, 12:24 PM
kib accepted D23243: x86: fix a race during running thread stack capture resulting in unclaimed NMI.

Yes, this should fix the problem.

Sat, Jan 18, 12:24 PM
kib added a comment to D23247: Provide O_SEARCH as an alias for O_EXEC.

I do not object, but there is some issue that probably makes O_SEARCH addition not very reasonable until it is resolved. From what I read in POSIX description of O_SEARCH, access checks for search must be performed at the open time. Then, the *at(2) family of syscalls should not check the current directory permissions when the file descriptor is specified as the starting point for the lookup. We do not implement this mode, namei(9) always checks the current directory mode for the path starting point.

Sat, Jan 18, 12:10 PM

Fri, Jan 17

kib updated the diff for D12773: Manage thread signal mask using a shared word, instead of syscall..
  • rename to sigfastblock
  • teach reschedule_signals()/sigtd() about sigfastblock (prop arg to sigtd() is unused, it was removed)
  • some editing of the man page and knob description.
Fri, Jan 17, 5:30 PM
kib added a comment to D23172: Ignore EPOLLEXCLUSIVE.

I think a scary kernel message should be printed when the flag is ignored. Simply because it might affect correctness.

Fri, Jan 17, 2:03 PM
kib accepted D23174: Add qsort_s(3).
Fri, Jan 17, 1:58 PM
kib added a comment to D23110: Introduce CTLFLAG_NEEDGIANT.

I want this to be split into three patches:

  1. sysctl infra: CTLFLAG_NEEDGIANT, related code, locking for strings, and empty definition of SYSCTL_ENFORCE_FLAGS()
  2. addition of NEEDGIANT for everything that should be marked as such
  3. proper definition of SYSCTL_ENFORCE_FLAGS
Fri, Jan 17, 1:15 PM
kib added inline comments to D23215: [wip] ufs: add missing vgone calls to accomodate unlocked vnode with i_mode == 0.
Fri, Jan 17, 1:08 PM
kib accepted D23210: Fix 64-bit system call argument fetching for 32-bit Linux compat..
Fri, Jan 17, 1:01 PM
kib added inline comments to D23172: Ignore EPOLLEXCLUSIVE.
Fri, Jan 17, 12:59 PM
kib added a comment to D23172: Ignore EPOLLEXCLUSIVE.

What is the semantic of the flag ?

Fri, Jan 17, 12:58 PM
kib added inline comments to D23174: Add qsort_s(3).
Fri, Jan 17, 12:40 PM
kib accepted D23162: vfs: provide F_ISUNIONSTACK as a kludge for libc.
Fri, Jan 17, 10:58 AM

Thu, Jan 16

kib added inline comments to D23162: vfs: provide F_ISUNIONSTACK as a kludge for libc.
Thu, Jan 16, 2:42 PM
kib added inline comments to D23162: vfs: provide F_ISUNIONSTACK as a kludge for libc.
Thu, Jan 16, 2:41 PM
kib accepted D23140: vfs: increment numvnodes without the vnode list lock unless under pressure.
Thu, Jan 16, 2:29 PM
kib accepted D23158: vfs: refactor vnode allocation.
Thu, Jan 16, 2:01 PM