Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (257 w, 9 h)

Recent Activity

Yesterday

kib committed rS346384: MFC r345966, r345968:.
MFC r345966, r345968:
Fri, Apr 19, 1:19 PM
kib committed rS346383: MFC r345965:.
MFC r345965:
Fri, Apr 19, 1:09 PM
kib committed rS346382: MFC r345963, r345997:.
MFC r345963, r345997:
Fri, Apr 19, 1:05 PM
kib committed rS346380: MFC r345966, r345968:.
MFC r345966, r345968:
Fri, Apr 19, 12:54 PM
kib committed rS346379: MFC r345965:.
MFC r345965:
Fri, Apr 19, 12:50 PM
kib committed rS346378: MFC r345963, r345997:.
MFC r345963, r345997:
Fri, Apr 19, 12:48 PM
kib committed rS346377: MFC r345960:.
MFC r345960:
Fri, Apr 19, 12:45 PM
kib committed rS346376: MFC r345964:.
MFC r345964:
Fri, Apr 19, 12:40 PM
kib committed rS346375: MFC r345964:.
MFC r345964:
Fri, Apr 19, 12:39 PM
kib committed rS346374: MFC r345959:.
MFC r345959:
Fri, Apr 19, 12:34 PM
kib committed rS346373: MFC r345959:.
MFC r345959:
Fri, Apr 19, 12:33 PM
kib committed rS346372: MFC r346158:.
MFC r346158:
Fri, Apr 19, 12:31 PM
kib committed rS346371: MFC r346158:.
MFC r346158:
Fri, Apr 19, 12:30 PM

Thu, Apr 18

kib updated the diff for D19923: Switch to use shared vnode locks for text files during image activation..

A version with refcounted text references. vm_map_entry keeps such reference on the lowest object in the shadow chain, which must be vnode or tmpfs swap.

Thu, Apr 18, 7:24 PM
kib updated the diff for D19923: Switch to use shared vnode locks for text files during image activation..

On kern_execve() error path, only call VOP_UNSET_TEXT() when it was set by current thread.

Thu, Apr 18, 5:42 PM
kib added a comment to D19923: Switch to use shared vnode locks for text files during image activation..
In D19923#428953, @mjg wrote:

I gave it a spin with poudriere and it panics:

panic: Assertion error_ == 0 failed at /tank/users/mjg/src/freebsd/sys/kern/kern_exec.c:623
cpuid = 59
time = 1555604110
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe056d49a650
vpanic() at vpanic+0x19d/frame 0xfffffe056d49a6a0
panic() at panic+0x43/frame 0xfffffe056d49a700
kern_execve() at kern_execve+0x12f3/frame 0xfffffe056d49aa50
sys_execve() at sys_execve+0x4c/frame 0xfffffe056d49aad0
amd64_syscall() at amd64_syscall+0x276/frame 0xfffffe056d49abf0
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe056d49abf0

  • syscall (59, FreeBSD ELF64, sys_execve), rip = 0x8003d517a, rsp = 0x7fffffffe388, rbp = 0x7fffffffe4d0 ---

KDB: enter: panic
[ thread pid 12060 tid 101862 ]
Stopped at kdb_enter+0x3b: movq $0,kdb_why

This is the unset in interpreted case and is probably a race where 2 different threads are unsetting the flag.
I was working on shared exec myself few years back. I think both writers and execs have to be explicitly counted. Instead of using a dedicated flag to differentiate between them (or separate counts), in Linux they have a hack where negative value signifies execs.

Thu, Apr 18, 5:39 PM
kib committed rS346355: Use correct type name..
Use correct type name.
Thu, Apr 18, 3:31 PM
kib committed rS346352: Correct handling of RMRR during early enumeration stages..
Correct handling of RMRR during early enumeration stages.
Thu, Apr 18, 2:18 PM
kib committed rS346351: Remove witness warning. dmar_bus_dmamap_create() does not sleep..
Remove witness warning. dmar_bus_dmamap_create() does not sleep.
Thu, Apr 18, 2:04 PM
kib committed rS346350: Reduce verbosity, do not announce details of irte programming by default..
Reduce verbosity, do not announce details of irte programming by default.
Thu, Apr 18, 2:02 PM
kib added a comment to D19845: to be compatible with an IOMMU LinuxKPI should use bus_dma(9).

Some more i915 GPU testing (w/o the latest update here): after using Firefox (opengl layers, xwayland) for some time, GPU resets start happening

drmn0: Resetting chip for stuck wait on rcs0
drmn0: Resetting chip for stuck wait on rcs0
drmn0: Resetting chip for stuck wait on rcs0
…
DMAR0: Fault Overflow
DMAR0: vgapci0: pci:0:2:0 sid 10 fault acc 0 adt 0x0 reason 0x5 addr 2e09000
DMAR0: Fault Overflow
DMAR0: vgapci0: pci:0:2:0 sid 10 fault acc 0 adt 0x0 reason 0x5 addr 2e09000

and eventually the whole system freezes if I don't quit the compositor / switch to vt console.

Looks like a symptom of non-translatable physical address. I've encountered drivers which need additional work outside of the scope of this effort. Perhaps this is the case there as I can't any more cases in the Linux KPI where a physical address is substituted for a DMA one.
Also, I assume this is in remap mode. Does it work in identify map mode hw.busdma.default="bounce"? Unless there is an API which escaped, if it works in hw.dmar.enable="0" it's not a regression from before :-/

Thu, Apr 18, 12:54 PM

Wed, Apr 17

kib accepted D19930: Track device's NUMA domain in ifnet & allocate ifnet from NUMA local memory.
Wed, Apr 17, 6:19 PM
kib added inline comments to D19290: Add a tool to modify control features in ELF binaries.
Wed, Apr 17, 5:33 PM
kib added inline comments to D19930: Track device's NUMA domain in ifnet & allocate ifnet from NUMA local memory.
Wed, Apr 17, 4:41 PM
kib added a comment to D19930: Track device's NUMA domain in ifnet & allocate ifnet from NUMA local memory.
In D19930#428329, @kib wrote:

I wonder if a KPI of the format

struct ifnet *if_alloc_dev(u_char type, dev_t device);

would be more useful. It would hide all NUMA/non-NUMA/bus_get_domain() failed details that driver authors will copy/paste ad infinitum.
I do not propose to not add if_alloc_domain(), just think that if_alloc_dev() should be the primari KPI. Also it might allow to get more device_t context in if_alloc().

I think I agree with you. I was torn between the 2 different KPIs. Given that you suggested what I already was thinking about, I will implement it.
I'm trying to think now how if_alloc_domain() could be useful for non-device ifnets, and it does not seem to me at all clear that it would be. So I think I will replace if_alloc_domain() with if_alloc_dev()

Wed, Apr 17, 1:14 PM
kib added a comment to D19930: Track device's NUMA domain in ifnet & allocate ifnet from NUMA local memory.

I wonder if a KPI of the format

struct ifnet *if_alloc_dev(u_char type, dev_t device);

would be more useful. It would hide all NUMA/non-NUMA/bus_get_domain() failed details that driver authors will copy/paste ad infinitum.

Wed, Apr 17, 8:20 AM

Tue, Apr 16

kib committed rS346294: Fix initial x87 state after r345562..
Fix initial x87 state after r345562.
Tue, Apr 16, 7:46 PM
kib committed rS346289: MFC r346064:.
MFC r346064:
Tue, Apr 16, 5:56 PM
kib committed rS346288: MFC r346065:.
MFC r346065:
Tue, Apr 16, 5:56 PM
kib committed rS346287: MFC r346064:.
MFC r346064:
Tue, Apr 16, 5:54 PM
kib committed rS346286: MFC r345425, r345514, r345799, r345800, r345803, r346157:.
MFC r345425, r345514, r345799, r345800, r345803, r346157:
Tue, Apr 16, 5:43 PM
kib committed rS346285: MFC r345425, r345514, r345799, r345800, r345803, r346157:.
MFC r345425, r345514, r345799, r345800, r345803, r346157:
Tue, Apr 16, 5:33 PM
kib committed rS346284: MFC r346062:.
MFC r346062:
Tue, Apr 16, 5:16 PM
kib created D19923: Switch to use shared vnode locks for text files during image activation..
Tue, Apr 16, 1:22 PM

Mon, Apr 15

kib accepted D19063: mlx5en: add pfil ethernet hook.
Mon, Apr 15, 2:12 PM
kib committed rS346227: MFC r346038:.
MFC r346038:
Mon, Apr 15, 1:13 PM
kib committed rS346226: MFC r346031:.
MFC r346031:
Mon, Apr 15, 1:11 PM
kib committed rS346225: Fix order of destructors between main binary and libraries..
Fix order of destructors between main binary and libraries.
Mon, Apr 15, 1:03 PM
kib accepted D19915: Drop -g from CFLAGS for zfsd(8).

s/-d/-g/ in the message.

Mon, Apr 15, 12:49 PM
kib committed rS346224: MFC r346038:.
MFC r346038:
Mon, Apr 15, 12:24 PM
kib committed rS346223: MFC r346031:.
MFC r346031:
Mon, Apr 15, 12:23 PM

Sun, Apr 14

kib accepted D19887: fix the NFSv4 client so that it doesn't call pfind() with a mutex held.
Sun, Apr 14, 9:12 PM
kib committed rS346216: ld-elf.so: make LD_DEBUG always functional..
ld-elf.so: make LD_DEBUG always functional.
Sun, Apr 14, 6:05 PM
kib added a comment to D19863: Rework vnode locking in the ELF loader.

I do not see that this could end in anything useful.

Sun, Apr 14, 11:42 AM
kib added inline comments to D19908: Provide accounting of user-wired pages..
Sun, Apr 14, 9:12 AM
kib added inline comments to D19863: Rework vnode locking in the ELF loader.
Sun, Apr 14, 9:03 AM

Sat, Apr 13

kib accepted D19887: fix the NFSv4 client so that it doesn't call pfind() with a mutex held.
Sat, Apr 13, 9:50 PM
kib added a comment to D19887: fix the NFSv4 client so that it doesn't call pfind() with a mutex held.

I just read the man page (I know, never read the documentation;-) and it seems that
the recursion check is for exclusive locks, so adding SX_DUPOK would allow a process
to acquire a shared lock that it already has.
So, maybe, sticking with the current patch that applies a unique name to each element
is preferred?

Sat, Apr 13, 2:58 PM

Fri, Apr 12

kib committed rS346158: Do not access mutex memory after unlock..
Do not access mutex memory after unlock.
Fri, Apr 12, 5:27 PM
kib committed rS346157: Ignore doomed vnodes in tmpfs_update_mtime()..
Ignore doomed vnodes in tmpfs_update_mtime().
Fri, Apr 12, 5:12 PM
kib committed rS346156: MFC r345703:.
MFC r345703:
Fri, Apr 12, 3:15 PM
kib committed rS346155: MFC r345703:.
MFC r345703:
Fri, Apr 12, 3:12 PM
kib committed rS346154: MFC r345955:.
MFC r345955:
Fri, Apr 12, 3:02 PM
kib committed rS346153: MFC r345955:.
MFC r345955:
Fri, Apr 12, 3:01 PM
kib committed rS346152: MFC r345702,r345954:.
MFC r345702,r345954:
Fri, Apr 12, 2:59 PM
kib accepted D19889: Remove unneeded conditionals for sv_ functions..
Fri, Apr 12, 1:53 PM
kib accepted D19845: to be compatible with an IOMMU LinuxKPI should use bus_dma(9).
Fri, Apr 12, 11:49 AM
kib added inline comments to D19863: Rework vnode locking in the ELF loader.
Fri, Apr 12, 9:36 AM
kib added a comment to D19887: fix the NFSv4 client so that it doesn't call pfind() with a mutex held.

I would greatly prefer that kern_proc.c provided the services that nfscl used, instead of open-coding. E.g., it would be the 'lock all pidhash chains', and then pfind_locked(). The later can also assert that the hash chain it accesses is locked.

Fri, Apr 12, 9:33 AM

Thu, Apr 11

kib added inline comments to D19883: Call crdup(9) earlier, spare one vnode lock/unlock.
Thu, Apr 11, 9:10 PM
kib added a comment to D19863: Rework vnode locking in the ELF loader.

I still fail to understand why the change is needed.

Thu, Apr 11, 8:55 PM
kib added inline comments to D19845: to be compatible with an IOMMU LinuxKPI should use bus_dma(9).
Thu, Apr 11, 2:28 PM
kib added inline comments to D19845: to be compatible with an IOMMU LinuxKPI should use bus_dma(9).
Thu, Apr 11, 9:18 AM

Wed, Apr 10

kib accepted D19874: Use shared vnode locks for ELF interpreter.

Did you tested this with DEBUG_VFS_LOCKS ?

Wed, Apr 10, 7:23 PM
kib added inline comments to D19874: Use shared vnode locks for ELF interpreter.
Wed, Apr 10, 5:33 PM
kib added inline comments to D19874: Use shared vnode locks for ELF interpreter.
Wed, Apr 10, 3:50 PM
kib added inline comments to D19845: to be compatible with an IOMMU LinuxKPI should use bus_dma(9).
Wed, Apr 10, 3:41 PM
kib added a comment to D19874: Use shared vnode locks for ELF interpreter.

The relock happens pretty much never, since the function is used for loading the interpreter - which is busy all the time. I had a printf there for testing, and it's called just once, early during boot.

Wed, Apr 10, 2:43 PM
kib added a comment to D19863: Rework vnode locking in the ELF loader.

But previously we were dropping and picking up the lock just before, to call malloc(9), so this should equal out?

Wed, Apr 10, 1:55 PM
kib added a comment to D19874: Use shared vnode locks for ELF interpreter.

Basically the relock invalidates all benefits of the shared locking.

Wed, Apr 10, 1:52 PM
kib accepted D19867: remove the 4GB boundary requirement on PCI DMA segments.
Wed, Apr 10, 1:47 PM
kib accepted D19868: fix cache_lookup's documentation.
Wed, Apr 10, 12:58 PM
kib committed rS346077: MFC r345847:.
MFC r345847:
Wed, Apr 10, 10:51 AM
kib added a comment to D19863: Rework vnode locking in the ELF loader.
In D19863#426594, @kib wrote:

But I don't see how the patch increases the number of locks/unlocks. Could you explain?

I did not count exact number of locks you take, but you now lock per segment, and do this more than once. So the number of locks taken is O(num of segments) instead of O(1).

And that's the part I don't get - where? From what I see, the lock is taken once, around load_sections().

That said, even if we assume that executables all have one segment (in fact two), then there is still more locks after your patch. I did not checked this.

There is one additional lock, at the end - we have to return with an exclusive lock held. I'll think about this some more.

Wed, Apr 10, 10:44 AM
kib added a comment to D19863: Rework vnode locking in the ELF loader.

But I don't see how the patch increases the number of locks/unlocks. Could you explain?

I did not count exact number of locks you take, but you now lock per segment, and do this more than once. So the number of locks taken is O(num of segments) instead of O(1).

Wed, Apr 10, 8:54 AM
kib added inline comments to D19868: fix cache_lookup's documentation.
Wed, Apr 10, 8:49 AM
kib added inline comments to D19867: remove the 4GB boundary requirement on PCI DMA segments.
Wed, Apr 10, 8:43 AM
kib committed rS346074: MFC r345847:.
MFC r345847:
Wed, Apr 10, 8:34 AM

Tue, Apr 9

kib committed rS346065: Add vn_fsync_buf()..
Add vn_fsync_buf().
Tue, Apr 9, 8:20 PM
kib added a comment to D19599: Add a UFS-specific implementation for lseek(SEEK_DATA)..

Should this now be closed since it was resolved in D19811?

Tue, Apr 9, 8:15 PM
kib committed rS346064: Fix dirty buf exhaustion easily triggered with msdosfs..
Fix dirty buf exhaustion easily triggered with msdosfs.
Tue, Apr 9, 7:55 PM
kib added a comment to D19863: Rework vnode locking in the ELF loader.

I do not understand why this patch is needed, and you did not bothered to explain.

Tue, Apr 9, 6:18 PM
kib committed rS346062: pci_cfgreg.c: Use io port config access for early boot time..
pci_cfgreg.c: Use io port config access for early boot time.
Tue, Apr 9, 6:07 PM
kib closed D19833: pci_cfgreg.c: Use io port config access for early boot time..
Tue, Apr 9, 6:07 PM
kib added inline comments to D19833: pci_cfgreg.c: Use io port config access for early boot time..
Tue, Apr 9, 5:38 PM
kib updated the diff for D19833: pci_cfgreg.c: Use io port config access for early boot time..

Fix two nits according to jhb comments.

Tue, Apr 9, 4:37 PM
kib added inline comments to D19833: pci_cfgreg.c: Use io port config access for early boot time..
Tue, Apr 9, 4:36 PM
kib accepted D19862: replace cosqos field in pkthdr with a numa domain tag.
Tue, Apr 9, 3:48 PM
kib accepted D19846: Factor out section loading into a separate function.
Tue, Apr 9, 3:00 PM
kib retitled D19833: pci_cfgreg.c: Use io port config access for early boot time. from amd64 pci_cfgreg.c: Use io port config access for early boot time. to pci_cfgreg.c: Use io port config access for early boot time..
Tue, Apr 9, 12:35 PM
kib updated the diff for D19833: pci_cfgreg.c: Use io port config access for early boot time..

Move legacy match to legacy.c as suggested.

Tue, Apr 9, 12:35 PM
kib added inline comments to D19833: pci_cfgreg.c: Use io port config access for early boot time..
Tue, Apr 9, 12:33 PM

Mon, Apr 8

kib retitled D19833: pci_cfgreg.c: Use io port config access for early boot time. from Use io port config access for early boot time. to amd64 pci_cfgreg.c: Use io port config access for early boot time..
Mon, Apr 8, 9:19 PM
kib updated the diff for D19833: pci_cfgreg.c: Use io port config access for early boot time..
Mon, Apr 8, 9:17 PM
kib added a comment to D19833: pci_cfgreg.c: Use io port config access for early boot time..
In D19833#426071, @jhb wrote:

Well, we should either remove the fallback outright, or we should fix it to actually be used. I think I would be fine with just removing it outright.

Yes, I will update the patch with removal in a minute.

Mon, Apr 8, 9:16 PM
kib committed rS346038: Exercise some care before sending SIGHUP to mountd..
Exercise some care before sending SIGHUP to mountd.
Mon, Apr 8, 6:17 PM
kib closed D19847: Exercise some care before sending SIGHUP to mountd..
Mon, Apr 8, 6:17 PM
kib added a comment to D19833: pci_cfgreg.c: Use io port config access for early boot time..
In D19833#425992, @jhb wrote:

Hmm, so scottl@ added this version of MMIO access before we looked at the MCFG table, and I'm not sure that the BIOS for these chipsets don't actually already provide the MCFG table.

At least on the machine of the person who reported the problem, there is MCFG table. Chipset MCH is E7500.

Mon, Apr 8, 6:12 PM
kib added a comment to D19845: to be compatible with an IOMMU LinuxKPI should use bus_dma(9).

Could you add some comments and update summary to explain the design ?

Mon, Apr 8, 4:23 PM
kib updated the diff for D19847: Exercise some care before sending SIGHUP to mountd..

Update comment.

Mon, Apr 8, 3:58 PM