kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (186 w, 5 d)

Recent Activity

Yesterday

kib committed rS326793: MFC r326311:.
MFC r326311:
Tue, Dec 12, 11:10 AM

Mon, Dec 11

kib committed rS326765: ofed: Define barriers for mips and arm..
ofed: Define barriers for mips and arm.
Mon, Dec 11, 11:59 AM
This revision was not accepted when it landed; it landed in state Needs Review.
Mon, Dec 11, 11:58 AM
kib committed rS326764: ofed: Remove duplicated symbols from the version file..
ofed: Remove duplicated symbols from the version file.
Mon, Dec 11, 11:58 AM

Sat, Dec 9

kib added a comment to D13403: Implement thread domain policy via cpuset.

I admit that I like the new iterators, they are quite clean and understandable.

Sat, Dec 9, 11:52 AM
kib accepted D13422: Use a dedicated counter for laundry thread wakeups..
Sat, Dec 9, 11:00 AM
kib accepted D13428: Provide an option to force synchronous initialization of inode blocks.

I agree with Kirk.

Sat, Dec 9, 10:57 AM

Fri, Dec 8

kib added a comment to D13426: Extend stripeoffset and stripesize of GEOMs from u_int to off_t.

nop and others not mentioned in the diff use "off_t" internaly already.

Fri, Dec 8, 9:16 PM
kib added a comment to D13426: Extend stripeoffset and stripesize of GEOMs from u_int to off_t.
In D13426#280534, @kib wrote:

Does this change break ABI or KBI ? Or both ?

It seems, yes. No MFC planned.

Fri, Dec 8, 9:15 PM
kib added a comment to D13426: Extend stripeoffset and stripesize of GEOMs from u_int to off_t.

Does this change break ABI or KBI ? Or both ?

Fri, Dec 8, 7:08 PM
kib accepted D13423: Fix the act_scan_laundry_weight mechanism..
Fri, Dec 8, 5:19 PM
kib committed rS326684: MFC r326429:.
MFC r326429:
Fri, Dec 8, 10:31 AM

Thu, Dec 7

kib accepted D13412: Fix the UMA reclaim worker.
Thu, Dec 7, 7:31 PM
kib added a comment to D13412: Fix the UMA reclaim worker.
In D13412#280192, @kib wrote:

Plain store is enough, _rel does not add any functionality there. Or the load in the while() loop above should become _acq(), but I do not see a need.

Indeed, but there is no plain atomic_store_int().

Thu, Dec 7, 7:23 PM
kib accepted D13412: Fix the UMA reclaim worker.

Plain store is enough, _rel does not add any functionality there. Or the load in the while() loop above should become _acq(), but I do not see a need.

Thu, Dec 7, 7:07 PM
kib added a comment to D13403: Implement thread domain policy via cpuset.

[I only looked at the syscall interface, not read the implementation, plan to do this later].

Thu, Dec 7, 5:05 PM
kib added a comment to D13407: Add missing network interface address event for adding default IPv6 link-local addresses.

@kib: Other places where "EVENTHANDLER_INVOKE(ifaddr_event, ifp)" is used there are no locks involved from what I can see. Correct me if I'm wrong.

Thu, Dec 7, 4:59 PM
kib added a comment to D13407: Add missing network interface address event for adding default IPv6 link-local addresses.

For my understanding of this stuff. Is some lock which guarantees consistency for the addresses configuration is still held while the eventhandler is invoked ? What is the lock ?

Thu, Dec 7, 3:38 PM
kib added a comment to D13267: Export extattr_*vp() functions to allow to use it in the linuxulator in future .
In D13267#280049, @thisisadrgreenthumb_gmail.com wrote:

It is difficult to find a value to restrict extattr value size. Because, as I know, in case of ntfs and hfs, the extattr sizes are "infinity".

It is not difficult, it is impossible. In other words, no size checks would allow to avoid the issue with the userspace access under the vnode (and/or buffer) lock by preallocating malloced buffer and copying into it.

Thu, Dec 7, 9:53 AM
kib added a comment to D13346: Handle address wrap errors in vm_map_find().
In D13346#280028, @alc wrote:
In D13346#280027, @alc wrote:

Kostik, I've been reviewing vm_map_find()'s callers, and I'm concerned about i915_gem_mmap_ioctl(). Consider this snippet:

        p = curproc;
        map = &p->p_vmspace->vm_map;
...
        addr = 0;
        vm_object_reference(obj->vm_obj);
        rv = vm_map_find(map, obj->vm_obj, args->offset, &addr, args->size, 0,

I believe that 0 is going to be out-of-range for a map on amd64, and so vm_map_find(), either with or without this revision, is going to return an error. Am I missing something here?

Nevermind. I forgot that vm_map_findspace() handles this case. It updates the given address to be at least vm_map_min(). In general, other callers don't pass 0, but themselves initialize the given address to vm_map_min().

Thu, Dec 7, 9:25 AM
kib accepted D13405: Move buffer size checks outside of the vnode locks..

You have the commit bit, am I right ? Please ask phab admins to change your login to match the cluster user name.

Thu, Dec 7, 9:24 AM
kib committed rS326657: Fix livelock in ufsdirhash_create()..
Fix livelock in ufsdirhash_create().
Thu, Dec 7, 9:05 AM

Wed, Dec 6

kib added a comment to D13385: Optimize telldir(3).
In D13385#279917, @mav wrote:
In D13385#279912, @mav wrote:

Looks good to me, at least until we implement original offset reporting.

What's original offset reporting?

64-bit inode project commit r318736 introduced new field d_off into struct dirent. If supported by all file systems, it would obsolete all this code.

It looks like d_off is currently supported by no file systems. Is the intent that one could pass a d_off directly to lseek to seek to a particular directory entry?

Wed, Dec 6, 8:59 PM
kib accepted D13385: Optimize telldir(3).
Wed, Dec 6, 5:10 PM
kib accepted D13378: Rework alignment handling in __libc_allocate_tls() for Variant I of TLS layout..

I did not found anything obviously wrong (i.e. an easy to see contradiction between the comment and code).

Wed, Dec 6, 4:54 PM
kib added a comment to D13267: Export extattr_*vp() functions to allow to use it in the linuxulator in future .

It would be nice to ditch the requirement for exclusive vnode lock acquisition in VFS for extended attribute writes. But I'm not sure the filesystems would approve of that..?

Wed, Dec 6, 4:18 PM
kib added a comment to D13395: devfs: Add siphash comparison.
In D13395#279754, @manu wrote:
In D13395#279745, @kib wrote:

Also, if calculating a hash, I do not see why not use it to store the strings in the hasharray instead of plain list.

Which hasharray ?

Wed, Dec 6, 4:17 PM
kib added inline comments to D13267: Export extattr_*vp() functions to allow to use it in the linuxulator in future .
Wed, Dec 6, 3:33 PM
kib added a comment to D13395: devfs: Add siphash comparison.

Try to compare lengths before committing to strcmp(). Does it help ?

Wed, Dec 6, 3:30 PM
kib added inline comments to D13394: devfs: Remove devfs_pathpath.
Wed, Dec 6, 3:17 PM

Tue, Dec 5

kib added inline comments to D13346: Handle address wrap errors in vm_map_find().
Tue, Dec 5, 5:12 PM
kib added a comment to D13267: Export extattr_*vp() functions to allow to use it in the linuxulator in future .

As I already noted, this change is around the architecturally wrong code. uiomove(9) with UIO_USERSPACE must not be performed while a vnode is locked.

Tue, Dec 5, 1:39 PM

Mon, Dec 4

kib added inline comments to D13346: Handle address wrap errors in vm_map_find().
Mon, Dec 4, 8:25 PM
kib added a comment to D13361: vfs_donmount: in certain cases try r/o mount if r/w mount fails.
In D13361#278984, @avg wrote:

It's not a no, but it's push back that this isn't POLA based on what people expect.

Well, it depends on definition of "people".
I know that one wide-spread OS does this and so some people are used to it.
"mount: block device /dev/sdb1 is write-protected, mounting read-only"
But I am not sure if it does that in kernel or in userland.

Mon, Dec 4, 5:46 PM
kib requested changes to D13361: vfs_donmount: in certain cases try r/o mount if r/w mount fails.

Such level of artificial intelligence was never applied to the Unix behavior. IMO we should not out-guess the user, and if the requested mode of operation failed, to not retry with randomly tweaked parameters.

Mon, Dec 4, 3:36 PM
kib added a comment to D13329: Fix make universe with WITH_OFED=yes..

Can you check inside your MAKEOBJDIRPEFIX if there is "include/infiniband" and what its contents might be?

Mon, Dec 4, 1:40 PM
kib added inline comments to D13329: Fix make universe with WITH_OFED=yes..
Mon, Dec 4, 12:37 PM
kib committed rS326523: MFC r326424:.
MFC r326424:
Mon, Dec 4, 10:06 AM
kib added inline comments to D13346: Handle address wrap errors in vm_map_find().
Mon, Dec 4, 10:04 AM
kib committed rS326516: MFC r326424:.
MFC r326424:
Mon, Dec 4, 9:48 AM

Sun, Dec 3

kib added inline comments to D13289: Use separate vmems to segregate KVA by domain.
Sun, Dec 3, 10:03 AM
kib added inline comments to D13346: Handle address wrap errors in vm_map_find().
Sun, Dec 3, 9:33 AM
kib added inline comments to D13329: Fix make universe with WITH_OFED=yes..
Sun, Dec 3, 8:58 AM
kib added a reviewer for D13329: Fix make universe with WITH_OFED=yes.: bdrewery.
Sun, Dec 3, 8:55 AM
kib accepted D13327: Count write delegations so nfsrv_checkgetattr() can just return if the count is 0.

I would be easier to reason about the change if code properly annotated with lock assertions.

Sun, Dec 3, 8:53 AM

Sat, Dec 2

kib added a comment to D13155: Do not loop infinitely in vm_map_find()..
In D13155#278471, @alc wrote:

Should I create a new review for my patch?

Sat, Dec 2, 8:26 PM
kib added a comment to D13155: Do not loop infinitely in vm_map_find()..
In D13155#278433, @alc wrote:

More generally, I've come to the conclusion that speculatively calling vm_map_insert() is more trouble than it's worth. I'm tinkering with an alternate implementation where the loop consists of two steps: (1) alignment and (2) vm_map_findspace(). The loop terminates when either step does not result in any change to the address, so the sanity check proposed here is a regular part of the control flow.

This approach does introduce an additional call to vm_map_findspace(), that the speculative vm_map_insert() call avoided. However, in situations where the speculative vm_map_insert() call would have succeeded, the extra call to vm_map_findspace() will complete in constant time, because the map entry we are checking to verify that there is still sufficient space at the now aligned address is at the root of the tree.

Sat, Dec 2, 6:55 PM
kib added inline comments to D13327: Count write delegations so nfsrv_checkgetattr() can just return if the count is 0.
Sat, Dec 2, 2:36 PM
kib added inline comments to D13327: Count write delegations so nfsrv_checkgetattr() can just return if the count is 0.
Sat, Dec 2, 11:39 AM
kib added inline comments to D13289: Use separate vmems to segregate KVA by domain.
Sat, Dec 2, 11:07 AM

Fri, Dec 1

kib updated the summary of D13329: Fix make universe with WITH_OFED=yes..
Fri, Dec 1, 10:48 PM
kib created D13329: Fix make universe with WITH_OFED=yes..
Fri, Dec 1, 10:47 PM
kib closed D13228: vmstat: fix style(9) violations and bump WARNS.
Fri, Dec 1, 10:38 PM
kib committed rS326436: vmstat: fix style(9) violations and bump WARNS..
vmstat: fix style(9) violations and bump WARNS.
Fri, Dec 1, 10:38 PM
kib added a comment to D13228: vmstat: fix style(9) violations and bump WARNS.

One more issue, recording it there to keep all diffs against original submission.

commit 2b9fe1c7cf023c6700f69bd25268c8ce04267872
Author: Konstantin Belousov <kib@freebsd.org>
Date:   Fri Dec 1 23:37:17 2017 +0200
Fri, Dec 1, 10:30 PM
kib added a comment to D13228: vmstat: fix style(9) violations and bump WARNS.

I'm fine with it. I've one question about what is the correct way of sorting local variables? style(9) use two different versions (or I'm reading it wrong):

int
 main(int argc, char *argv[])
 {
         char *ep;
         long num;
         int ch;

vs.

struct foo one, *two;
 double three;
 int *four, five;
 char *six, seven, eight, nine, ten, eleven, twelve;
Fri, Dec 1, 6:38 PM
kib added a comment to D13228: vmstat: fix style(9) violations and bump WARNS.

Apparently tinderbox is busted. Additionally at least the following chunk is needed.

commit 07e3214722f4cb9928a8ef908e7a4be4a3cb6bcd
Author: Konstantin Belousov <kib@freebsd.org>
Date:   Fri Dec 1 20:34:44 2017 +0200
Fri, Dec 1, 6:36 PM
kib added a comment to D13228: vmstat: fix style(9) violations and bump WARNS.
commit 1bdb99ca310aa8b145bdc139aa59ba5373e0c306
Author: Konstantin Belousov <kib@freebsd.org>
Date:   Fri Dec 1 20:20:22 2017 +0200
Fri, Dec 1, 6:22 PM
kib committed rS326429: Destroy seltd st_mtx and st_wait in seltdfini()..
Destroy seltd st_mtx and st_wait in seltdfini().
Fri, Dec 1, 11:18 AM
kib updated the diff for D13155: Do not loop infinitely in vm_map_find()..

Trim patch after r326424.

Fri, Dec 1, 10:57 AM
kib committed rS326424: Add comment for vm_map_find_min()..
Add comment for vm_map_find_min().
Fri, Dec 1, 10:53 AM

Thu, Nov 30

kib updated the diff for D13155: Do not loop infinitely in vm_map_find()..

Edit vm_map_find_min() comments.

Thu, Nov 30, 5:37 PM
kib committed rS326397: MFC r326122:.
MFC r326122:
Thu, Nov 30, 2:38 PM
kib committed rS326396: MFC r326122:.
MFC r326122:
Thu, Nov 30, 2:20 PM
kib updated the diff for D13155: Do not loop infinitely in vm_map_find()..

Add comment explaining vm_map_find_min().

Thu, Nov 30, 1:55 PM

Wed, Nov 29

kib accepted D13298: Fix regression issue after r326218.

Note for the commit message: sched_add() actually marks the thread as runnable for all locks, for instance sleepqueues do setrunnable()->sched_wakeup()->sched_add().

Wed, Nov 29, 11:01 PM
kib added a comment to D13298: Fix regression issue after r326218.

Hmm, after I looked over all uses of thread_alloc(), I do not see a single path where sched_add() is executed without accompanying sched_fork_thread() before it, except perhaps for the thread0. So wouldn't it be simpler to just remove the line from sched_add() for now ?

Wed, Nov 29, 10:40 PM
kib added inline comments to D13155: Do not loop infinitely in vm_map_find()..
Wed, Nov 29, 5:35 PM
kib updated the diff for D13155: Do not loop infinitely in vm_map_find()..

Do not use goto.

Wed, Nov 29, 12:06 PM
kib updated the diff for D13155: Do not loop infinitely in vm_map_find()..

Untangle the loops in vm_map_find().

Wed, Nov 29, 11:26 AM
kib added a comment to D13155: Do not loop infinitely in vm_map_find()..
In D13155#277218, @alc wrote:

Set aside the proposed change for a moment. Suppose that find_space == VMFS_OPTIMAL_SPACE, that we are approaching the end of the address space, and that vm_map_findspace() succeeds. However, the address is not optimally aligned, so pmap_align_superpage() adjusts the address (upward). I believe that vm_map_insert() could return KERN_INVALID_ARGUMENT because the adjusted address plus length wraps, and as a result the loop terminates whereas it should have restarted after updating find_space.

Wed, Nov 29, 11:24 AM
kib committed rS326363: Implement hardware mlx5(4) rx timestamps..
Implement hardware mlx5(4) rx timestamps.
Wed, Nov 29, 10:04 AM
kib closed D12638: mlx5(4) rx timestamps..
Wed, Nov 29, 10:04 AM
kib committed rS325893: Remove xlint(1)..
Remove xlint(1).
Wed, Nov 29, 9:52 AM
kib closed D13015: Axe xlint..
Wed, Nov 29, 9:52 AM

Tue, Nov 28

kib added a comment to D13267: Export extattr_*vp() functions to allow to use it in the linuxulator in future .
In D13267#276922, @cem wrote:

Is it more expensive to spill one argument to the stack, or to re-read td from curthread later? It is used to check td_ucred.

Tue, Nov 28, 9:59 AM
kib added a comment to D13267: Export extattr_*vp() functions to allow to use it in the linuxulator in future .

Addition of the uio_seg to the functions interfaces is fine.

Tue, Nov 28, 9:56 AM
kib committed rS326311: Fix index calculation for the page table pages for efirt 1:1 map..
Fix index calculation for the page table pages for efirt 1:1 map.
Tue, Nov 28, 9:35 AM
kib closed D13273: Fix index calculation for the page table pages for efirt 1:1 map..
Tue, Nov 28, 9:35 AM
kib updated the diff for D13155: Do not loop infinitely in vm_map_find()..

Hide prev_start under invariants.

Tue, Nov 28, 8:36 AM
kib added a comment to D13155: Do not loop infinitely in vm_map_find()..
In D13155#276876, @jhb wrote:

Mmm, you'd have to put prev_start under #ifdef INVARIANTS I guess, either that or do this:

if (result != KERN_SUCCESS && start <= prev_start) {
#ifdef INVARIANTS
    panic("vm_map_findspace infinite loop");
#endif
    vm_map_unlock(map);
    return (KERN_NO_SPACE);
}
Tue, Nov 28, 8:36 AM

Mon, Nov 27

kib updated the diff for D13155: Do not loop infinitely in vm_map_find()..

Follow John' explanations:

  1. Convert error termination on no progress into assert.
  2. Add overflow checks into the loop.
Mon, Nov 27, 8:04 PM
kib added a member for NUMA: kib.
Mon, Nov 27, 7:46 PM
kib created D13273: Fix index calculation for the page table pages for efirt 1:1 map..
Mon, Nov 27, 5:45 PM
kib accepted D13270: Avoid unneeded lookups in vm_page_init_page()..
Mon, Nov 27, 5:08 PM

Sun, Nov 26

kib accepted D12397: combine block frees in swap_pager_meta_frees.
Sun, Nov 26, 6:10 PM
kib accepted D13250: Move vm_phys_init_page() to vm_page.c..
Sun, Nov 26, 6:00 PM
kib committed rS326226: Improve sysctl(8) pretty printing of some structures..
Improve sysctl(8) pretty printing of some structures.
Sun, Nov 26, 10:02 AM
kib added inline comments to D13228: vmstat: fix style(9) violations and bump WARNS.
Sun, Nov 26, 9:52 AM
kib added inline comments to D12397: combine block frees in swap_pager_meta_frees.
Sun, Nov 26, 9:26 AM
kib added a comment to D12397: combine block frees in swap_pager_meta_frees.

The change to swp_pager_freeswapspace() signature and handling of empty runs can be committed in advance.

Sun, Nov 26, 9:22 AM
kib accepted D13242: Avoid unneeded initializations in vm_phys_init_page()..

You mean that the allocators vm_page_alloc(), vm_page_alloc_contig(), and vm_page_alloc_freelist() overwrite the fields anyway.

Sun, Nov 26, 9:06 AM

Sat, Nov 25

kib committed rS326189: MFC r326098:.
MFC r326098:
Sat, Nov 25, 2:52 PM
kib committed rS326188: MFC r326098:.
MFC r326098:
Sat, Nov 25, 2:47 PM

Thu, Nov 23

kib updated the diff for D5603: ASLR.

Resolve conflict.

Thu, Nov 23, 7:18 PM
kib added a comment to D12470: Pretty-print the kevent structures logged via KTRACE..

I think that the current patch should be committed as is. It is a significant improvement over the previous state to have the compat32 kevents dumped, and for all variants of them decoded.

Thu, Nov 23, 7:13 PM
kib committed rS326139: vmstat: use 64-bit counters from struct vmtotal..
vmstat: use 64-bit counters from struct vmtotal.
Thu, Nov 23, 7:10 PM
kib closed D13199: vmstat: use 64-bit counters from struct vmtotal.
Thu, Nov 23, 7:10 PM
kib committed rS326138: Use C standard spelling uint64_t for u_int64_t..
Use C standard spelling uint64_t for u_int64_t.
Thu, Nov 23, 7:06 PM
kib added inline comments to D13187: Eliminate kmem_arena in preparation for NUMA.
Thu, Nov 23, 7:00 PM