Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (274 w, 3 d)

Recent Activity

Yesterday

kib added a comment to D21311: Use atomics for paging in progress..

Note that for devfs vnodes the vnode lock is often not held when writes are started. This is esp. true when metadata io is initiated by UFS.

Mon, Aug 19, 6:38 PM
kib added a comment to D21320: amd64: rework PCPU allocation.

Style.

Mon, Aug 19, 6:32 PM
kib accepted D21310: Allow calls to vm_pager_haspages with the object read locked.
Mon, Aug 19, 6:23 PM
kib added inline comments to D21320: amd64: rework PCPU allocation.
Mon, Aug 19, 4:31 PM
D21296: Remove some compatability with Seventh Edition UNIX realloc(). is now accepted and ready to land.

Please fix two style issues, no need to re-post the updated patch.

Mon, Aug 19, 12:18 PM
kib committed rS351211: sys.kern.pdeathsig.signal_delivered_ptrace: fix startup..
sys.kern.pdeathsig.signal_delivered_ptrace: fix startup.
Mon, Aug 19, 9:33 AM
kib committed rS351210: sys.kern.pdeathsig.signal_delivered_ptrace: fix debugger detach.
sys.kern.pdeathsig.signal_delivered_ptrace: fix debugger detach
Mon, Aug 19, 9:29 AM
kib created D21320: amd64: rework PCPU allocation.
Mon, Aug 19, 7:33 AM

Sun, Aug 18

kib committed rS351195: Fix an issue with executing tmpfs binary..
Fix an issue with executing tmpfs binary.
Sun, Aug 18, 8:36 PM
kib committed rS351194: Change locking requirements for VOP_UNSET_TEXT()..
Change locking requirements for VOP_UNSET_TEXT().
Sun, Aug 18, 8:25 PM
D21252: Allocate the vm_page_array on domain correct memory. is now accepted and ready to land.
Sun, Aug 18, 6:43 PM
D21242: Reallocate pcpu area on the correct domain. is now accepted and ready to land.
Sun, Aug 18, 6:25 PM
D21317: vfs: stop always overwriting ->mnt_stat in VFS_STATFS is now accepted and ready to land.
Sun, Aug 18, 6:21 PM
kib committed rS351190: i386: Implement atomic_load_64(9) and atomic_store_64(9)..
i386: Implement atomic_load_64(9) and atomic_store_64(9).
Sun, Aug 18, 3:59 PM
D21299: Add a vop_stdioctl() that does the trivial algorithm for FIOSEEKDATA/FIOSEEKHOLE is now accepted and ready to land.
Sun, Aug 18, 4:49 AM

Sat, Aug 17

kib accepted D21251: Add phys_avail allocation routines..
Sat, Aug 17, 6:49 PM
kib added inline comments to D21254: Add support for blocking waits to refcounts..
Sat, Aug 17, 6:11 PM
kib added inline comments to D20814: Make entry simplification one-way.
Sat, Aug 17, 11:31 AM
kib added a comment to D21060: Stop installing clang, clang++, and clang-cpp hardlinks in /usr/bin..
In D21060#463035, @jhb wrote:

FWIW, gcc4.2.1 does get installed as /usr/bin/gcc on platforms that use it as /usr/bin/cc, and the base/gcc port that installs gcc6 as /usr/bin/cc also installs it as /usr/bin/gcc. I think gcc may be slightly different though in that autoconf scripts tend to look specifically for gcc sometimes instead of cc. I haven't run into similar configure scripts that look specifically for 'clang'. In my experience they look for 'cc' which happens to be clang.

Sat, Aug 17, 11:07 AM
kib added inline comments to D21299: Add a vop_stdioctl() that does the trivial algorithm for FIOSEEKDATA/FIOSEEKHOLE.
Sat, Aug 17, 10:57 AM
kib added inline comments to D21252: Allocate the vm_page_array on domain correct memory..
Sat, Aug 17, 8:44 AM
kib added inline comments to D21296: Remove some compatability with Seventh Edition UNIX realloc()..
Sat, Aug 17, 8:11 AM

Fri, Aug 16

kib added a comment to D21252: Allocate the vm_page_array on domain correct memory..

I suspect the diff generation missed vm_phys.c.

Fri, Aug 16, 7:42 PM
kib accepted D21272: Fix 'lock "vm reserv" already initialized' panic..
Fri, Aug 16, 6:48 PM
kib added a comment to D21272: Fix 'lock "vm reserv" already initialized' panic..

I noted on IRC that roundup2 on line 1058 might result in overflow as well, at least theoretically.

Fri, Aug 16, 2:30 PM
kib added a comment to D21060: Stop installing clang, clang++, and clang-cpp hardlinks in /usr/bin..
In D21060#462930, @imp wrote:

I'd personally rather see us bring back something from the past . We had WITH_CLANG_AS_CC which controlled creating cc->clang links. What if we had WITH_CLANG_LINKS or similar that would create clang->cc links and have it default to off? This isn't blocking if there's no support for it, though. I didn't click request changes for this :).

See below.

Fri, Aug 16, 2:28 PM
kib added a comment to D21272: Fix 'lock "vm reserv" already initialized' panic..
In D21272#462891, @ray wrote:
In D21272#462874, @kib wrote:

Can't we simply test paddr < rounddown2(seg->end, VM_LEVEL_0_SIZE)?

Is seg->end 0xffffffff or 0 for the problematic case ?

No, it is 0xfff00000. But problem with paddr, which is 32bits and paddr + 0x100000 will be 0x00000000.
It satisfy check:
0xffe00000 <= 0xfff00000 - true
0xfff00000 <= 0xfff00000 - true
0x00000000 <= 0xfff00000 - true
BTW, I set MTX_NEW to mtx_init for test, and it just go around.

Anyway, I prefer the explicit check for overflow, it makes the things absolutely clear for reader.
uint64_t cast is no-go of course.

cast to uint64_t will do nothing on 64bits machines and will have impact on 32bits machines only.
cast to intmax_t will add "double-math" for all, but save code from modifications when 64->128 era begin :)
and since it is affect only boot process, think it acceptable.

vM is coded using (somewhat) abstracted types. We do not assume that everything is ILP32 or LP64, at least not in places where it is easy to avoid and which would create one more portability bug for future system porting.

Fri, Aug 16, 10:33 AM
kib committed rS351114: Fix OOM handling of some corner cases..
Fix OOM handling of some corner cases.
Fri, Aug 16, 9:44 AM
kib closed D13671: Collection of fixes for OOM handling of some corner cases..
Fri, Aug 16, 9:44 AM
kib added a comment to D21272: Fix 'lock "vm reserv" already initialized' panic..

Can't we simply test paddr < rounddown2(seg->end, VM_LEVEL_0_SIZE)?

Is seg->end 0xffffffff or 0 for the problematic case ? Anyway, I prefer the explicit check for overflow, it makes the things absolutely clear for reader.

Fri, Aug 16, 9:14 AM

Thu, Aug 15

kib added inline comments to D21257: Support atomic updates of the "aflags" and "queue" fields..
Thu, Aug 15, 7:37 PM
kib added a comment to D21060: Stop installing clang, clang++, and clang-cpp hardlinks in /usr/bin..
solo% ls -l /usr/local/bin/clang                                              ~
lrwxr-xr-x  1 root  wheel  7 Aug  5 22:10 /usr/local/bin/clang -> clang90
solo% pkg which /usr/local/bin/clang                                          ~
/usr/local/bin/clang was installed by package llvm-90
solo% pkg which /usr/local/bin/clang90                                        ~
/usr/local/bin/clang90 was installed by package llvm90-9.0.0.r1_1
Thu, Aug 15, 7:05 PM
kib added a comment to D13671: Collection of fixes for OOM handling of some corner cases..

Peter, could you please, test the patch ? The only interesting scenarios are OOMs. It should allow the system to unwind from low memory situations much quicker, or sometimes it should make out of problems previously causing hang.

Thu, Aug 15, 7:03 PM
D13671: Collection of fixes for OOM handling of some corner cases. now requires review to proceed.

Add sysctls descriptions, slightly edited from the wording provided by Mark.

Thu, Aug 15, 7:02 PM
kib added a comment to D13671: Collection of fixes for OOM handling of some corner cases..

I think this is ok. Just some thoughts below.
In head, if a process sleeps for a long time in vm_waitpfault(), the page daemon can deactivate and reclaim most of the process' mapped pages. If it reclaims enough pages to wake up the process, the process will run and immediately fault a number of times, adding pressure to the pool of free pages. So I can see why the OOM killer would fail to make progress: with many large processes we will just reclaim pages from one process to satisfy PF allocations for another, and this can go on indefinitely.
With your patch this is less likely to happen since a starved process can eventually trigger OOM kills, but in principle it can still be a problem if the page daemon reclaims user-mapped pages quickly enough. We can tune the sysctls you added, but I wonder if there is a way to recognize this pattern in general.

Thu, Aug 15, 7:01 PM
kib added a comment to D21060: Stop installing clang, clang++, and clang-cpp hardlinks in /usr/bin..

Which package provides clang? I don't have a /usr/local/bin/clang on my system.

Thu, Aug 15, 6:43 PM
kib added a comment to D21250: Move phys_avail and dump_avail into MI code..

(assuming Mark and John notes are handled)

Thu, Aug 15, 4:37 PM
D21155: fix copy_file_range(2) so that it doesn't allocate unneeded data blocks of all 0s in the output file is now accepted and ready to land.
Thu, Aug 15, 3:47 PM
D21257: Support atomic updates of the "aflags" and "queue" fields. is now accepted and ready to land.
Thu, Aug 15, 3:45 PM
kib added a comment to D21272: Fix 'lock "vm reserv" already initialized' panic..
In D21272#462558, @ray wrote:
In D21272#462545, @ray wrote:

Don't we then have the same problem if seg->end < VM_LEVEL_0_SIZE?

only if you want to add some really small seg at 0x00000000 :)

Why does it have to be at 0x00000000? With the segment below we will test 0x100000 <= 0x9d000 - 0x100000, and the variables are unsigned.

SEGMENT 0:  
start:     0x10000                 
end:       0x9d000
domain:    0                       
free list: 0xffffffff81233cb0

no, start and end will be truncated and rounded up.
So you will get segment 0x00000000 with size 0x00100000.
First iteration will look that:
0x000000 <= 0x100000 - 0x100000, which is true and you will initialize one super page.

Thu, Aug 15, 3:30 PM
D21274: rtld-elf: fix build with xtoolchain-llvm90 is now accepted and ready to land.
Thu, Aug 15, 3:12 PM
kib added reviewers for D21272: Fix 'lock "vm reserv" already initialized' panic.: alc, dougm.
Thu, Aug 15, 2:19 PM
D21272: Fix 'lock "vm reserv" already initialized' panic. is now accepted and ready to land.
Thu, Aug 15, 2:16 PM
kib added a comment to D21206: libc: Add fdwalk(3), commonly used in Linux software.
In D21206#462415, @mjg wrote:

I had an extra look and there is an extremely worrisome comment: apparently the routine is expected to by async-signal safe. This means both malloc and realloc are off the table. This can be worked around with having a statically sized buffer and requesting the bitmap in chunks which fit the buffer, i.e. pass the buffer and an offset (size of the buffer * iteration counter). See https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gspawn.c#L1182

Thu, Aug 15, 11:39 AM

Wed, Aug 14

kib added inline comments to D21257: Support atomic updates of the "aflags" and "queue" fields..
Wed, Aug 14, 4:27 PM
kib added a comment to D13671: Collection of fixes for OOM handling of some corner cases..

Eliminate vm_oom_ratelim_count.

Wed, Aug 14, 4:11 PM
kib added inline comments to D13671: Collection of fixes for OOM handling of some corner cases..
Wed, Aug 14, 4:10 PM
kib committed rS351024: MFC r350484, r350607, r350608:.
MFC r350484, r350607, r350608:
Wed, Aug 14, 9:57 AM
kib committed rS351023: MFC r350757:.
MFC r350757:
Wed, Aug 14, 9:53 AM
kib committed rS351022: MFC r350758:.
MFC r350758:
Wed, Aug 14, 9:52 AM
kib committed rS351021: MFC r350757:.
MFC r350757:
Wed, Aug 14, 9:49 AM
kib committed rS351020: MFC r350758:.
MFC r350758:
Wed, Aug 14, 9:45 AM
kib committed rS351016: MFC r350861:.
MFC r350861:
Wed, Aug 14, 9:42 AM
kib committed rS351014: MFC r350860:.
MFC r350860:
Wed, Aug 14, 9:41 AM
kib committed rS351012: MFC r350861:.
MFC r350861:
Wed, Aug 14, 9:39 AM
kib committed rS351011: MFC r350860:.
MFC r350860:
Wed, Aug 14, 9:39 AM
kib committed rS351010: MFC r350481, r350483:.
MFC r350481, r350483:
Wed, Aug 14, 9:37 AM
kib added inline comments to D21206: libc: Add fdwalk(3), commonly used in Linux software.
Wed, Aug 14, 9:18 AM
kib added inline comments to D21206: libc: Add fdwalk(3), commonly used in Linux software.
Wed, Aug 14, 9:17 AM
kib added inline comments to D21206: libc: Add fdwalk(3), commonly used in Linux software.
Wed, Aug 14, 9:14 AM

Tue, Aug 13

kib added inline comments to D21255: Remove the page lock dependency on busy sleeps by using sleepq to avoid races..
Tue, Aug 13, 8:53 PM
kib added inline comments to D21242: Reallocate pcpu area on the correct domain..
Tue, Aug 13, 5:35 PM
kib added a comment to D13671: Collection of fixes for OOM handling of some corner cases..

Update the patch to the latest merge, trying to revive the review process.

Tue, Aug 13, 1:56 PM
kib committed rS350978: MFC r350639:.
MFC r350639:
Tue, Aug 13, 1:48 PM
kib committed rS350977: MFC r350639:.
MFC r350639:
Tue, Aug 13, 1:47 PM
kib added inline comments to D21242: Reallocate pcpu area on the correct domain..
Tue, Aug 13, 11:07 AM
kib added inline comments to D21242: Reallocate pcpu area on the correct domain..
Tue, Aug 13, 7:28 AM

Mon, Aug 12

kib committed rS350957: Increase YPMAXRECORD to 16M to be compatible with Linux..
Increase YPMAXRECORD to 16M to be compatible with Linux.
Mon, Aug 12, 8:27 PM
kib closed D20900: Increase YPMAXRECORD to 16M to be compatible with Linux..
Mon, Aug 12, 8:27 PM
D21222: shutdown_halt: make sure that watchdog timer is stopped is now accepted and ready to land.
Mon, Aug 12, 10:51 AM

Sun, Aug 11

kib committed rS350863: compat/linux: Remove obsoleted and somewhat confusing comments related to….
compat/linux: Remove obsoleted and somewhat confusing comments related to…
Sun, Aug 11, 7:17 PM
kib committed rS350862: Only enable COMPAT_43 changes for syscalls ABI for a.out processes..
Only enable COMPAT_43 changes for syscalls ABI for a.out processes.
Sun, Aug 11, 7:16 PM
kib closed D21200: Only enable COMPAT_43 changes for syscalls ABI for a.out processes..
Sun, Aug 11, 7:16 PM
kib committed rS350861: wait(2): clarify reparenting of children of the exiting process..
wait(2): clarify reparenting of children of the exiting process.
Sun, Aug 11, 3:48 PM
kib committed rS350860: wait(2): split long line by using .Fo/.Fa instead of .Ft..
wait(2): split long line by using .Fo/.Fa instead of .Ft.
Sun, Aug 11, 3:44 PM
kib committed rS350856: MFC r343667:.
MFC r343667:
Sun, Aug 11, 8:25 AM

Sat, Aug 10

kib committed rS350839: MFC r350561:.
MFC r350561:
Sat, Aug 10, 5:17 PM
D21200: Only enable COMPAT_43 changes for syscalls ABI for a.out processes. now requires review to proceed.

Remove confusing comments in linuxolator that mention COMPAT_43.

Sat, Aug 10, 1:39 PM
kib added a comment to D21200: Only enable COMPAT_43 changes for syscalls ABI for a.out processes..
In D21200#460959, @imp wrote:
In D21200#460958, @jhb wrote:

I think a related question on the mail thread was if COMPAT_43 should be in any non-x86 config files at all. E.g. it shouldn't be in sys/conf/notes but should move to sys/x86/conf/NOTES once we start that.

Let's see, these changes would mean COMPAT_43 is just a normal 'include old code' stuff.
sparc64 wouldn't need it, since it didn't do a.out But it's frankly irrelevant...
powerpc I'm unsure about, but I don't think it needs it, despite it being in several kernels
powerpc64 I'm pretty sure doesn't need it since it doesn't support a.out.
mips doesn't need it since binary compatibility has been busted several times and we've never supported a.out.
I'm pretty sure it's close to a no op on 32-bit arm. There's no really old binaries that matter: we broke compatibility with EABI changes, and then again with the move to v6/v7, so compat for anything before FreeBSD 9 (or was it 10) is a don't care.
arm64 doesn't need it if arm doesn't need it.
riscv doesn't need it since it's too new.
I'd be willing to do the legwork unless kib@ knows some reason you and I are overlooking.

Sat, Aug 10, 1:37 PM
kib added a comment to D21200: Only enable COMPAT_43 changes for syscalls ABI for a.out processes..
In D21200#460954, @imp wrote:

I think these are good. There's comments in the Linux emulator that says they do different things because of this ifdef:
compat/linux/linux_misc.c: * td->td_retval[1] when COMPAT_43 is defined. This clobbers registers that
compat/linux/linux_uid16.c: * when COMPAT_43 is defined. This clobbers registers that are assumed to
maybe that means there can be a simplification?

Sat, Aug 10, 1:35 PM
kib committed rS350835: MFC r350683, r350684:.
MFC r350683, r350684:
Sat, Aug 10, 8:35 AM
kib committed rS350834: MFC r350560:.
MFC r350560:
Sat, Aug 10, 8:34 AM
kib committed rS350833: MFC r350683, r350684:.
MFC r350683, r350684:
Sat, Aug 10, 8:29 AM
kib committed rS350832: MFC r350561:.
MFC r350561:
Sat, Aug 10, 8:27 AM
kib committed rS350831: MFC r350560:.
MFC r350560:
Sat, Aug 10, 8:26 AM
kib added a comment to D21206: libc: Add fdwalk(3), commonly used in Linux software.

Ultimately we want some other sysctl to get the list of filedescs, because kern.proc.filedesc performs a huge amount of the work that is discarded.

Sat, Aug 10, 7:55 AM

Fri, Aug 9

kib created D21200: Only enable COMPAT_43 changes for syscalls ABI for a.out processes..
Fri, Aug 9, 9:04 PM
D20900: Increase YPMAXRECORD to 16M to be compatible with Linux. now requires review to proceed.

Add comment hinting why we do not stop iteration on asprintf (malloc) failure.

Fri, Aug 9, 8:30 PM
kib added a comment to D20362: procdesc: allow to collect status through wait(1) if process is traced.
  1. Can you rewrite the review summary according to the new code ? I want to see the commit message for the change.
  2. Looking at proc_to_reap() and you initial note about kern_wait6(), I wonder should we check for p_procdesc for all idtype cases in proc_to_reap() ? In other words, isn't there somewhat larger problem with kern_wait6() reaping procdesc zombies at all ?
Fri, Aug 9, 3:04 PM
kib added inline comments to D20900: Increase YPMAXRECORD to 16M to be compatible with Linux..
Fri, Aug 9, 7:09 AM

Thu, Aug 8

kib committed rS350758: Fix stack grow for init..
Fix stack grow for init.
Thu, Aug 8, 4:48 PM
kib committed rS350757: Update comment explaining create_init()..
Update comment explaining create_init().
Thu, Aug 8, 4:43 PM
D20900: Increase YPMAXRECORD to 16M to be compatible with Linux. now requires review to proceed.

Add checks for ENOMEM.

Thu, Aug 8, 3:15 PM

Wed, Aug 7

kib added a comment to D20900: Increase YPMAXRECORD to 16M to be compatible with Linux..

Do not leak pwbuf.

Wed, Aug 7, 9:25 PM
kib committed rS350684: More places to clarify the robustness guarantees..
More places to clarify the robustness guarantees.
Wed, Aug 7, 5:51 PM
kib committed rS350683: Clarify the robustness guarantees..
Clarify the robustness guarantees.
Wed, Aug 7, 5:46 PM
kib added a comment to D20900: Increase YPMAXRECORD to 16M to be compatible with Linux..

Fix bugs pointed out by ian. I did not found other instances of it.

Wed, Aug 7, 10:56 AM

Tue, Aug 6

kib closed D21087: Provide the list of knobs related to mitigations..
Tue, Aug 6, 5:06 PM
kib committed rS350640: Provide the list of knobs related to mitigations..
Provide the list of knobs related to mitigations.
Tue, Aug 6, 5:06 PM
kib committed rS350639: amd64: prevents speculations over swapgs reload of %gs base..
amd64: prevents speculations over swapgs reload of %gs base.
Tue, Aug 6, 4:53 PM