Page MenuHomeFreeBSD
Feed Advanced Search

Aug 3 2020

kib added a comment to D25926: DMAR2IODOM.

Basically I want to get rid of all conversion relying on the layout. And add macros for common conversions e.g. from domain to dmar unit etc.

Aug 3 2020, 5:28 PM
kib committed rS363801: Provide more correct description for sysctl kern.smp.cores..
Provide more correct description for sysctl kern.smp.cores.
Aug 3 2020, 5:17 PM
kib added a comment to D25933: Add SOL_LOCAL symbolic constant for unix socket option level..

I did not added uses to contrib sources, i.e. tests, bsnmpd, and heimdal.

Aug 3 2020, 5:09 PM
kib requested review of D25933: Add SOL_LOCAL symbolic constant for unix socket option level..
Aug 3 2020, 5:07 PM
kib added a comment to D25924: CALLOUT_DEBUG_DRAIN and its use for mlx5en/mlx5ib.

When you unload a kernel module, you know its text segment virtual address, where all code resides.
Why can't you iterate all pending callbacks and check if the function pointer is within the unloaded range?

Aug 3 2020, 4:48 PM
kib added inline comments to D25922: Revert echo(1) diet changes..
Aug 3 2020, 4:44 PM
kib requested review of D25924: CALLOUT_DEBUG_DRAIN and its use for mlx5en/mlx5ib.
Aug 3 2020, 11:38 AM
kib added a reviewer for D25922: Revert echo(1) diet changes.: jilles.
Aug 3 2020, 7:52 AM
kib accepted D25922: Revert echo(1) diet changes..
Aug 3 2020, 7:51 AM

Aug 2 2020

kib added inline comments to D25910: vfs: add VOP_STAT.
Aug 2 2020, 11:40 PM
kib accepted D25921: vfs: store precomputed namecache hash in the vnode.

Is this the only example of such situation, where inode of the vnode changes without the vnode going through its lifecycle ?

Aug 2 2020, 7:45 PM
kib added a comment to D25922: Revert echo(1) diet changes..

This looks like half-done. You are mixing write(2) and stdio .

Aug 2 2020, 7:42 PM
kib added a comment to D25921: vfs: store precomputed namecache hash in the vnode.

I tried to lump this in with v_hash, but unfortunately that one has many testicles elsewhere and in particular is not constant for the lifetime of the vnode.

Aug 2 2020, 6:37 PM
kib added a comment to D25920: Fault in the parent of zombie/killed processes before killing a process in OOM..

The change does not make sense. The address space of the process is destroyed in context of exit1(), see the call to vmspace_exit(). Zombies only hold the struct proc itself to record pid and exit code. So your change is both nop, and racy because p->p_pptr can become invalid any moment.

Aug 2 2020, 6:22 PM

Aug 1 2020

kib added a comment to D25916: Add prng(9) API.
In D25916#574171, @cem wrote:
In D25916#574168, @kib wrote:

So this KPI is not safe to use from interrupt handlers ? I think you need to mention it in the man page.

It is no worse from interrupt handlers as existing random(9) KPI, which does not document that deficiency. But we could use spinlock_enter() in place of critical_enter() if that would solve the problem better.

Aug 1 2020, 9:15 PM
kib added a comment to D25916: Add prng(9) API.

So this KPI is not safe to use from interrupt handlers ? I think you need to mention it in the man page.

Aug 1 2020, 9:05 PM
kib accepted D25914: Unlocked getblk: Fix new false-positive assertion.
Aug 1 2020, 8:23 PM
kib added inline comments to D25612: devfs: rework si_usecount to track opens.
Aug 1 2020, 8:21 PM

Jul 31 2020

kib accepted D25894: domain map/unmap vtable.

I am looking at all lines like this:
iodom = (struct iommu_domain *)domain;
and think we need macros like DMAR2IODOM etc.

Jul 31 2020, 9:13 PM
kib added inline comments to D25894: domain map/unmap vtable.
Jul 31 2020, 6:54 PM
kib added inline comments to D24652: Non-transparent superpages support..
Jul 31 2020, 6:47 PM
kib added inline comments to D25900: Add some basic test coverage for SHM_LARGEPAGE..
Jul 31 2020, 6:45 PM
kib added inline comments to D25900: Add some basic test coverage for SHM_LARGEPAGE..
Jul 31 2020, 5:28 PM
kib updated the diff for D24652: Non-transparent superpages support..

Handle latest Mark notes, comments about them were pushed as followups.

Jul 31 2020, 5:20 PM
kib added a comment to D24652: Non-transparent superpages support..

I am not sure how best to handle the interaction with mlock(). The populate handler does not bump the wire count in the physical page structures (as I noted, it does not handle VM_FAULT_WIRE at all). We could wire every single page in the range, but this will be rather slow for 1GB pages. If we do not bump the per-page wire count, then vm_object_unwire() needs to be updated. It might be reasonable to simply record the wiring in the vm_map_entry and avoid faults. Then, the first access to an mlock'ed large page mapping will trigger a soft fault, which I believe goes against the spirit of mlock(), but maybe it is acceptable.

Jul 31 2020, 5:14 PM
kib updated the diff for D25886: Add O_RESOLVE_BENEATH and AT_RESOLVE_BENEATH to mimic Linux' RESOLVE_BENEATH.

Fix definition of AT_RBENEATH.

Jul 31 2020, 2:19 PM

Jul 30 2020

kib accepted D25898: getblk: Avoid sleeping on wrong buf in lockless path.
Jul 30 2020, 11:46 PM
kib added inline comments to D25894: domain map/unmap vtable.
Jul 30 2020, 10:42 PM
kib added inline comments to D25898: getblk: Avoid sleeping on wrong buf in lockless path.
Jul 30 2020, 10:31 PM
kib added a comment to D25873: vxlan(4): Support for stateless NIC hardware offloads with VXLAN encapsulated traffic..
In D25873#573638, @np wrote:

The goal is to improve vxlan's performance. mbuf tags would add at least an alloc/free and extra access(es) to the tags (which are on a linked list) on the hot path. Why even consider any other location for the flags if there _are_ bits available in the proper place right now. We'll be out of them after this change, we aren't out already.

Where VNI is currently stored when packet is pushed up or down to driver, for stateless offload ?

Jul 30 2020, 10:29 PM
kib added inline comments to D25894: domain map/unmap vtable.
Jul 30 2020, 1:59 PM

Jul 29 2020

kib requested review of D25886: Add O_RESOLVE_BENEATH and AT_RESOLVE_BENEATH to mimic Linux' RESOLVE_BENEATH.
Jul 29 2020, 11:31 PM
kib accepted D25878: Remove headers from iommu.h.
Jul 29 2020, 9:48 PM
kib added inline comments to D25878: Remove headers from iommu.h.
Jul 29 2020, 7:06 PM
kib accepted D25882: fix i386 non-dmar build.
Jul 29 2020, 7:03 PM
kib accepted D25879: Fix modules build.
Jul 29 2020, 3:34 PM
kib added a comment to D25879: Fix modules build.

Butt then why do you need taskqueue.h and tree.h before iommu ? They are included by the header ATM

Jul 29 2020, 2:59 PM
kib accepted D25868: Remove most lingering references to the page lock in comments..
Jul 29 2020, 2:56 PM
kib accepted D25861: Remove the volatile qualifier from busy_lock..
Jul 29 2020, 2:54 PM
kib added a comment to D25879: Fix modules build.

I am confused. Is this needed _now_ for the svn HEAD, or is it a follow-up to D25878 ? If the later, it should be wrapped into D25878.

Jul 29 2020, 2:53 PM
kib added inline comments to D25878: Remove headers from iommu.h.
Jul 29 2020, 2:52 PM
kib accepted D25866: iommu_is_buswide_ctx moved.
Jul 29 2020, 1:13 PM
kib added inline comments to D25866: iommu_is_buswide_ctx moved.
Jul 29 2020, 11:42 AM
kib added inline comments to D25868: Remove most lingering references to the page lock in comments..
Jul 29 2020, 11:38 AM
kib retitled D25873: vxlan(4): Support for stateless NIC hardware offloads with VXLAN encapsulated traffic. from vxlan(4): Support for stateless NIC hardware offloads with VXLANencapsulated traffic. to vxlan(4): Support for stateless NIC hardware offloads with VXLAN encapsulated traffic..
Jul 29 2020, 7:40 AM
kib retitled D25873: vxlan(4): Support for stateless NIC hardware offloads with VXLAN encapsulated traffic. from vxlan(4): Support for stateless NIC hardware offloads with VXLAN encapsulated traffic. to vxlan(4): Support for stateless NIC hardware offloads with VXLANencapsulated traffic..
Jul 29 2020, 7:39 AM

Jul 28 2020

kib accepted D25859: vm_page_xbusy_claim(): Use atomics to update busy lock state..
Jul 28 2020, 4:22 PM
kib accepted D25861: Remove the volatile qualifier from busy_lock..
Jul 28 2020, 3:45 PM
kib accepted D25859: vm_page_xbusy_claim(): Use atomics to update busy lock state..
Jul 28 2020, 3:43 PM
kib accepted D25852: make set_buswide() generic.

So please plan for the following two next changes:

  1. Removal of headers from iommu.h
  2. Providing the vtable for implementation of map/unmap to be used from iommu_gas.
Jul 28 2020, 3:40 PM

Jul 27 2020

kib accepted D25777: Add further clarification on si_addr and si_trapno..
Jul 27 2020, 8:36 PM
kib added inline comments to D24217: amd64 pmap: fine-grained pv list locking.
Jul 27 2020, 6:18 PM
kib added inline comments to D25777: Add further clarification on si_addr and si_trapno..
Jul 27 2020, 6:10 PM
kib added a comment to D25798: arm64: Make local stores observable before sending IPIs.

I think ARM gic writes are not ordered with regards to STLR. It is typical in the sense that for instance Intel LAPIC ICR writes in x2APIC mode are also not ordered with normal accesses. We issue MFENCE before ICR write to avoid similar issue there.

Jul 27 2020, 5:17 PM

Jul 26 2020

kib added a comment to D24217: amd64 pmap: fine-grained pv list locking.
In D24217#572014, @mjg wrote:

Spinning (or adaptive spinning) is mandatory for the primitive to perform when contended. I presume going off CPU in this particular use case has to be supported, hence the new primitive and there is no adaptive spinning since there is no information who owns the lock and consequently no means to check if they went off CPU.

I had a draft for a routine which supports adaptive spinning and easily fits in a byte (even less). The states are: free, locked, sleeping waiters, owner off cpu.

Key observation is that going off CPU while holding a lock is relatively rare.

The idea is to explicitly track all OBM locks as they are taken in an array in struct thread or similar. Then the few places which can put the thread off CPU with the lock held check for it and walk the array to mark the locks appropriately. While puts an explicit upper limit at how many locks should be taken at any given time, I think the limitation is more than fine.

That said, I'll do some benchmarks later with stock head, head + vm obj rebase, head + obm, head + vm obj rebase + obm.

Jul 26 2020, 9:18 PM
kib updated the diff for D24217: amd64 pmap: fine-grained pv list locking.

Add comments for pv fake page.

Jul 26 2020, 9:13 PM
kib accepted D25828: vm_page_free_invalid(): Relax the xbusy assertion..
Jul 26 2020, 8:00 PM
kib added inline comments to D25828: vm_page_free_invalid(): Relax the xbusy assertion..
Jul 26 2020, 7:04 PM
kib updated the diff for D25815: amd64 pmap: add comment explaining TLB invalidation modes..

Handle first batch of comments from Mark.

Jul 26 2020, 7:01 PM
kib added inline comments to D25815: amd64 pmap: add comment explaining TLB invalidation modes..
Jul 26 2020, 7:00 PM
kib added a comment to D25828: vm_page_free_invalid(): Relax the xbusy assertion..

But does this mean that vm_page_free_prep() needs similar change ? Or at least, make assertion conditional on the page validity ?

Jul 26 2020, 6:24 PM
kib accepted D25828: vm_page_free_invalid(): Relax the xbusy assertion..
Jul 26 2020, 6:23 PM
kib requested review of D25815: amd64 pmap: add comment explaining TLB invalidation modes..
Jul 26 2020, 4:44 PM
kib accepted D25812: Rename dmar domain/pgf flags.
Jul 26 2020, 10:26 AM
kib committed rS363538: MFC r363329:.
MFC r363329:
Jul 26 2020, 1:05 AM

Jul 25 2020

kib added inline comments to D25807: Change DMAR sysctl node.
Jul 25 2020, 9:34 PM
kib accepted D25807: Change DMAR sysctl node.
Jul 25 2020, 9:28 PM
kib added inline comments to D25807: Change DMAR sysctl node.
Jul 25 2020, 9:08 PM
kib added inline comments to D25807: Change DMAR sysctl node.
Jul 25 2020, 8:29 PM
kib added inline comments to D25634: Make linux(4) fail lseek(2) on ttys.
Jul 25 2020, 7:48 PM
kib accepted D25802: Move GAS prototypes and flags.
Jul 25 2020, 6:36 PM
kib added inline comments to D25802: Move GAS prototypes and flags.
Jul 25 2020, 4:04 PM
kib accepted D25799: Move Intel GAS.
Jul 25 2020, 11:15 AM

Jul 24 2020

kib added inline comments to D25688: Make Linux sched_getaffinity(2) and sched_setaffinity(2) accept short masks.
Jul 24 2020, 7:42 PM
kib accepted D25776: Set si_addr to dar for MMU and alignment faults..
Jul 24 2020, 7:11 PM
kib accepted D25770: Set si_trapno to the exception code from scause..
Jul 24 2020, 6:35 PM
kib added inline comments to D25754: swi_sched() from NMI context.
Jul 24 2020, 6:29 PM
kib accepted D25782: Add unlocked/SMR fast path to getblk().
Jul 24 2020, 2:24 PM
kib accepted D25743: GAS split-out.

I assume the next patch will move intel_gas.c to dev/iommu ?

Jul 24 2020, 1:43 PM
kib added inline comments to D25754: swi_sched() from NMI context.
Jul 24 2020, 1:35 PM
kib accepted D25787: vm: fix swap reservation leak.
Jul 24 2020, 12:09 PM
kib added inline comments to D25782: Add unlocked/SMR fast path to getblk().
Jul 24 2020, 11:14 AM
kib added inline comments to D25787: vm: fix swap reservation leak.
Jul 24 2020, 11:07 AM

Jul 23 2020

kib accepted D25769: Don't include T_USER in si_trapno reported to userland..

Is usermode variable in mips/trap.c::trap() redundant ?

Jul 23 2020, 10:28 PM
kib accepted D25772: Set si_trapno to the fault index from fsr..
Jul 23 2020, 10:21 PM
kib accepted D25773: Fix si_addr value for breakpoints in a delay slot..
Jul 23 2020, 10:17 PM
kib added inline comments to D25782: Add unlocked/SMR fast path to getblk().
Jul 23 2020, 9:25 PM
kib accepted D25771: Set si_trapno to the exception code from esr..

When I wrote a response yesterday, my motivation was that it is important to provide as much information as we can for the trap signal cause. But, as an after-thought, I realized that siginfo_t is not useful for this purpose, it drops a lot of very important data from the faulting context. In other words, either code has access to ucontext for the fault, or it does not matter much which data we loose. From this point of view, providing just the trap number (for some definition of it) is good enough.

Jul 23 2020, 9:05 PM
kib added inline comments to D25777: Add further clarification on si_addr and si_trapno..
Jul 23 2020, 9:02 PM
kib added a comment to D25700: linuxkpi: Add time_after32.

What do you think about using "int" instead of "int32" ?

Jul 23 2020, 8:23 PM
kib added a comment to D25787: vm: fix swap reservation leak.

Since you are doing cleanups, perhaps change the return type to bool, there and for swap_reserve().

Jul 23 2020, 8:22 PM
kib added inline comments to D25782: Add unlocked/SMR fast path to getblk().
Jul 23 2020, 8:15 PM
kib added a comment to D25736: Avoid overflow in blist_create, remove swap pager checks before blist_create.

Sorry I did not stated that explicitly, the large swap should be a single volume. Blists are allocatd per swap device.

Jul 23 2020, 1:02 PM
kib added a comment to D25736: Avoid overflow in blist_create, remove swap pager checks before blist_create.
In D25736#570896, @pho wrote:
In D25736#570891, @kib wrote:
In D25736#570868, @pho wrote:

I completed a full stress2 test with D25736.74719.diff on r363390.
No problems seen.

How large the configured swap size was ? And how much of it was used (approximately) ?

$ ./swapused.sh 
FreeBSD t2.osted.lan 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r363443M: Thu Jul 23 13:01:56 CEST 2020     pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO  amd64
swapinfo -h
Device              Size     Used    Avail Capacity
/dev/da0p4           67G       0B      67G     0%

swap disk
  1027604514   140509184    4  freebsd-swap  (67G)
13:08:48 0%
13:10:02 1%
13:10:09 2%
:
13:18:33 32%
13:18:55 33%

I think this patch mostly needs Marius' test sort /dev/zero.

This test is included in stress2 as sort.sh

Jul 23 2020, 11:43 AM
kib added a comment to D25700: linuxkpi: Add time_after32.

With all that corner cases and hard-to-correctly-interpret semantic, I do not see why it is useful to deviate from Linux original.

Instead of casting, would a static inline function be better, and more clean code-wise?

Jul 23 2020, 11:09 AM
kib added a comment to D25736: Avoid overflow in blist_create, remove swap pager checks before blist_create.
In D25736#570868, @pho wrote:

I completed a full stress2 test with D25736.74719.diff on r363390.
No problems seen.

Jul 23 2020, 10:38 AM

Jul 22 2020

kib added a comment to D25700: linuxkpi: Add time_after32.

Konstantin, doesn't the use of subtraction "-" imply that the result is signed in C?

No, the result has the promoted type of left and right operands. Basically the shorter type is promoted to wider one. But there are additional rules when operands have different signess.

Jul 22 2020, 9:39 PM
kib accepted D25580: (lookup 5) tmpfs: add support for lockless lookup.
Jul 22 2020, 9:34 PM
kib added a comment to D25700: linuxkpi: Add time_after32.

Konstantin: Please explain why:

(int)((unsigned)(x) - (unsigned)(y)) is different from
(int)((x) - (y))

I don't get it.

Jul 22 2020, 9:21 PM
kib added a comment to D25771: Set si_trapno to the exception code from esr..

May be, just copy the esr value as is. There is additional encoding of trap cause in ISS field.

Jul 22 2020, 9:13 PM