Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

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

Recent Activity

Yesterday

kib added a comment to D23802: vn_fullpath: const'ify retbuf.
In D23802#523379, @kib wrote:

The buffer was written by the function, this is my point of the aliasing breakage.

A const pointer does not require that the pointed-to object remain unchanged; it merely suggests that it not be modified via the pointer. There may be other non-const pointers to the same object or const may be cast away.

Yes, but why is it useful even slightly to prevent modifications to (successfull) result of the vn_fullpathX() ?

Mon, Feb 24, 3:15 PM
kib added a comment to D23802: vn_fullpath: const'ify retbuf.
In D23802#523059, @kib wrote:

I really do not understand it. The *retbuf *is* modified by vn_fullpath. I believe you are lying to the compiler' aliasing analysis this way.

*retbuf is, but importantly **retbuf is not. This should be the difference between const char ** and char * const *

Mon, Feb 24, 1:11 PM
kib committed rS358288: MFC r358226:.
MFC r358226:
Mon, Feb 24, 12:36 PM
kib committed rS358287: MFC r358225:.
MFC r358225:
Mon, Feb 24, 12:35 PM

Sun, Feb 23

kib added a comment to D23802: vn_fullpath: const'ify retbuf.

I really do not understand it. The *retbuf *is* modified by vn_fullpath. I believe you are lying to the compiler' aliasing analysis this way.

Sun, Feb 23, 10:45 AM

Sat, Feb 22

kib added a comment to D23428: vfs: stop populating spares in struct stat.
In D23428#522227, @mjg wrote:

So any incarnation of this patch makes the following fail contrib/netbsd-tests/lib/libc/c063/t_fstatat.c:

ATF_TC_BODY(fstatat_fd, tc)
{
        int dfd;
        int fd;
        struct stat st1, st2;
        ATF_REQUIRE(mkdir(DIR, 0755) == 0);
        ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
        ATF_REQUIRE(close(fd) == 0);
        ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1);
        ATF_REQUIRE(fstatat(dfd, BASEFILE, &st1, 0) == 0);
        ATF_REQUIRE(close(dfd) == 0);
        ATF_REQUIRE(stat(FILE, &st2) == 0);
        ATF_REQUIRE(memcmp(&st1, &st2, sizeof(st1)) == 0);
}

That is, they fstat twice to different buffers and memcmp the result. Since the spare area is not populated this fails. This makes me worried there are actual programs which also do it and which would break because of this change.
Thus another take is this: on Linux struct stat is 144 bytes. On FreeBSD this struct without any spares would have precisely the same size. The upshot of shrinking it to Linux size would be that userspace sees the same one (and uses less memory). If spares are to be preserved, we can use fewer of them. Adding 16 bytes in spares brings the structure to 160 bytes in total. I can add the necessary compat for 12.x binaries.
Note this change on top of other speed ups gives about +10% for fstat/second rate which I think makes it worth it given how often fstat is executed.
Thoughts?

Sat, Feb 22, 10:31 PM
kib accepted D23798: sys/kern: quiet -Wwrite-strings.
Sat, Feb 22, 10:25 PM
kib accepted D23797: vfs: quiet -Wwrite-strings.
Sat, Feb 22, 10:23 PM
kib added inline comments to D23796: sys/vm: quiet -Wwrite-strings.
Sat, Feb 22, 10:22 PM
kib committed rS358252: Fix NFS client deadlock when read reports truncated node..
Fix NFS client deadlock when read reports truncated node.
Sat, Feb 22, 8:50 PM
kib committed rS358251: Add td_pflags2, yet another thread-private flags word..
Add td_pflags2, yet another thread-private flags word.
Sat, Feb 22, 8:43 PM
kib added a comment to D23787: add "mntfs" private vnodes for file systems to access their storage safely.

I would be slightly less worried about this hack if you added asserts that odevvp does not get any buffers on its bufobj queues.

Sat, Feb 22, 5:46 PM
kib committed rS358246: Fix build with INVARIANTS turned on..
Fix build with INVARIANTS turned on.
Sat, Feb 22, 12:10 PM
kib committed rS358245: MFC r357984:.
MFC r357984:
Sat, Feb 22, 11:08 AM
kib committed rS358244: MFC r357983:.
MFC r357983:
Sat, Feb 22, 11:05 AM
kib committed rS358243: MFC r357982:.
MFC r357982:
Sat, Feb 22, 11:04 AM
kib committed rS358242: MFC r357984:.
MFC r357984:
Sat, Feb 22, 10:56 AM
kib committed rS358241: MFC r357983:.
MFC r357983:
Sat, Feb 22, 10:54 AM
kib committed rS358240: MFC r357982:.
MFC r357982:
Sat, Feb 22, 10:49 AM

Fri, Feb 21

kib committed rS358226: x86/identcpu.c whitespace cleanup..
x86/identcpu.c whitespace cleanup.
Fri, Feb 21, 4:55 PM
kib committed rS358225: print_svm_info: decode a CPUID 0x8000000a.edx bit 20..
print_svm_info: decode a CPUID 0x8000000a.edx bit 20.
Fri, Feb 21, 4:41 PM
kib added a comment to D23164: Introduce kern_mmap_req()..

Overall this looks reasonable.

Fri, Feb 21, 4:26 PM
kib added a comment to D23774: Add KPASS macros.
In D23774#522504, @kib wrote:

I very much dislike this. It repeats the mistake of KASSERT() while not eliminating KASSERT.
IMO the big and perhaps the only problem of KASSERT is that it was written before C99 so it cannot use variadic args. If the () around the printing part are dropped, then we can do any additions to the printed line without adding yet another set of macros.
So if you want to spend time on this, doing the convertion of KASSERT to variadic, and dropping the braces, would be a first step IMO. Personally I am fine with the churn.

I don't really care about the parens either way, but I don't want yet another assertion macro. I'd prefer to see kassert_panic() take func or LINE and FILE arguments. Existing consumers can be fixed up to avoid printing redundant info, it could be combined with the paren removal.

Fri, Feb 21, 4:02 PM
kib accepted D23779: Indicate issetugid in AT_BSDFLAGS.
Fri, Feb 21, 12:46 PM
kib added inline comments to D23779: Indicate issetugid in AT_BSDFLAGS.
Fri, Feb 21, 12:26 PM
kib added a comment to D23774: Add KPASS macros.

I very much dislike this. It repeats the mistake of KASSERT() while not eliminating KASSERT.

Fri, Feb 21, 12:17 PM

Thu, Feb 20

kib committed rS358182: Fix a bug in r358168, do not call sigfastblock_setpend() under a mutex..
Fix a bug in r358168, do not call sigfastblock_setpend() under a mutex.
Thu, Feb 20, 9:25 PM
kib committed rS358175: Print out some newly added PCIe extended capabilities and subclasses..
Print out some newly added PCIe extended capabilities and subclasses.
Thu, Feb 20, 5:10 PM
kib committed rS358174: Add more values for PCI capabilities, PCIe extended capabilities, and….
Add more values for PCI capabilities, PCIe extended capabilities, and…
Thu, Feb 20, 5:09 PM
kib created D23775: buffer pager: deref ucred immediately after read..
Thu, Feb 20, 4:26 PM
kib committed rS358168: Do not read sigfastblock word on syscall entry..
Do not read sigfastblock word on syscall entry.
Thu, Feb 20, 3:34 PM
kib closed D23622: Do not read sigfastblock word on syscall entry..
Thu, Feb 20, 3:34 PM
kib accepted D23723: Add a blocking counter KPI, blockcount(9)..
Thu, Feb 20, 1:43 PM
kib accepted D23763: Allow swap_pager_putpages() to allocate one block at a time..
Thu, Feb 20, 1:39 PM
kib added reviewers for D23574: vfs: add kernel-side realpathat: rstone, emaste.
Thu, Feb 20, 1:30 PM
kib accepted D23574: vfs: add kernel-side realpathat.

Ok, lets postpone AT_NOFOLLOW.

Thu, Feb 20, 1:30 PM
kib added inline comments to D23723: Add a blocking counter KPI, blockcount(9)..
Thu, Feb 20, 1:11 PM
kib committed rS358151: MFC r357871:.
MFC r357871:
Thu, Feb 20, 1:46 AM
kib committed rS358150: MFC r357870:.
MFC r357870:
Thu, Feb 20, 1:45 AM
kib committed rS358149: MFC r357869:.
MFC r357869:
Thu, Feb 20, 1:42 AM
kib committed rS358148: MFC r357868:.
MFC r357868:
Thu, Feb 20, 1:41 AM
kib committed rS358147: MFC r357866:.
MFC r357866:
Thu, Feb 20, 1:40 AM
kib committed rS358146: MFC r357865:.
MFC r357865:
Thu, Feb 20, 1:39 AM
kib committed rS358145: MFC r358022:.
MFC r358022:
Thu, Feb 20, 1:35 AM
kib committed rS358144: MFC r358022:.
MFC r358022:
Thu, Feb 20, 1:34 AM
kib committed rS358142: MFC r357895, r357910:.
MFC r357895, r357910:
Thu, Feb 20, 1:27 AM
kib committed rS358141: MFC r357894:.
MFC r357894:
Thu, Feb 20, 1:25 AM
kib committed rS358140: MFC r357894:.
MFC r357894:
Thu, Feb 20, 1:23 AM
kib committed rS358139: MFC r358021:.
MFC r358021:
Thu, Feb 20, 1:22 AM
kib committed rS358138: MFC r358021:.
MFC r358021:
Thu, Feb 20, 1:17 AM
kib accepted D23755: Don't convert all lower-layer errors to EIO..
Thu, Feb 20, 12:34 AM
kib added inline comments to D23574: vfs: add kernel-side realpathat.
Thu, Feb 20, 12:28 AM

Wed, Feb 19

kib added inline comments to D23755: Don't convert all lower-layer errors to EIO..
Wed, Feb 19, 3:42 PM
kib accepted D23756: Don't spam the console with an additional, and useless, error message..
Wed, Feb 19, 3:41 PM

Tue, Feb 18

kib added a comment to D23574: vfs: add kernel-side realpathat.

How jails and chroots are handled ?

Tue, Feb 18, 3:45 PM

Mon, Feb 17

kib accepted D23711: Type validating smr protected pointer accessors..
Mon, Feb 17, 9:35 PM
kib added inline comments to D23711: Type validating smr protected pointer accessors..
Mon, Feb 17, 8:46 PM
kib added a comment to D23587: Stop couting threads executing dynamic syscalls.
In D23587#520661, @mjg wrote:
In D23587#520606, @jeff wrote:

This would be a good use for tick based (non-atomic) smr. It would have a cheaper simpler write path. I don't object to this patch but it might get replaced again.

In the current code the commonly executed codepath is expanded with:
#define syscall_read_barrier() __compiler_membar()
it does not get any cheaper than that for that end. Anything else *adds* work.
On the other hand we really don't expect to register/unregister syscalls a whole lot and let alone catch someone executing them while we do so. If someone would be looking at improving the area, they can consider working on lending the priority to blocked syscall users.
In fact in my opinion the facility should be removed.

Why ?

Mon, Feb 17, 8:35 PM
kib added a comment to D23661: Implement a translation from FreeBSD atomic API to gcc intrinsics.

Biggest objection is that there is still no ABI for atomic stuff even on x86, so each compiler (version) is free to choose the implementation that it finds suitable and that non necessary compatible with the other' compiler implementation.

Mon, Feb 17, 7:52 PM
kib committed rS358022: pciconf: List names of all known extended PCIe capabilities..
pciconf: List names of all known extended PCIe capabilities.
Mon, Feb 17, 1:31 PM
kib committed rS358021: Fix typo..
Fix typo.
Mon, Feb 17, 1:26 PM
kib updated subscribers of D23622: Do not read sigfastblock word on syscall entry..
Mon, Feb 17, 12:19 PM

Sun, Feb 16

kib accepted D23612: Allow safe unlocked busy sleeps..
Sun, Feb 16, 9:12 PM
kib updated the diff for D23622: Do not read sigfastblock word on syscall entry..

One setpend() was missed after refactoring.

Sun, Feb 16, 8:50 PM
kib updated the summary of D23622: Do not read sigfastblock word on syscall entry..
Sun, Feb 16, 8:48 PM
kib accepted D23719: refcount: update comments about fencing when releasing counts.

Thanks.

Sun, Feb 16, 5:09 PM
kib accepted D23633: Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (M of N).
Sun, Feb 16, 5:04 PM
kib added inline comments to D23718: Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (M of N).
Sun, Feb 16, 4:59 PM
kib updated the diff for D23622: Do not read sigfastblock word on syscall entry..

re-upload with context.

Sun, Feb 16, 3:54 PM
kib updated the diff for D23622: Do not read sigfastblock word on syscall entry..

Apply full pack of nano-optimizations, change sigfastblock_fetch_always to bool.

Sun, Feb 16, 3:53 PM
kib committed rS358002: Fix build of some modules for some kernel configs..
Fix build of some modules for some kernel configs.
Sun, Feb 16, 3:43 PM
kib closed D23699: Fix build..
Sun, Feb 16, 3:43 PM
kib added a reviewer for D23685: Remove long broken procfs-based process tracing.: jhb.
Sun, Feb 16, 10:26 AM
kib added a comment to D23685: Remove long broken procfs-based process tracing..

If one day I feel offended enough by this breakage, it seems that ptracestop() can be used to restore the functionality.

Sun, Feb 16, 10:26 AM
kib added inline comments to D23622: Do not read sigfastblock word on syscall entry..
Sun, Feb 16, 10:23 AM

Sat, Feb 15

kib committed rS357985: Add pthread_peekjoin_np(3)..
Add pthread_peekjoin_np(3).
Sat, Feb 15, 11:25 PM
kib closed D23676: Add pthread_peekjoin_np(3)..
Sat, Feb 15, 11:25 PM
kib committed rS357984: sem_remove(): fix the loop that compacts sem array on semaphores removal..
sem_remove(): fix the loop that compacts sem array on semaphores removal.
Sat, Feb 15, 11:19 PM
kib committed rS357983: sem_remove(): add some asserts..
sem_remove(): add some asserts.
Sat, Feb 15, 11:18 PM
kib committed rS357982: Use designated initializers for seminfo..
Use designated initializers for seminfo.
Sat, Feb 15, 11:15 PM
kib closed D23694: sysv_sem: fix the loop that compacts sem array on semaphores removal..
Sat, Feb 15, 11:15 PM
kib updated the diff for D23699: Fix build..

Give up. Do not build dtrace.

Sat, Feb 15, 11:08 PM
kib added a comment to D23699: Fix build..

I don't see a problem with excluding the dtrace modules if KDTRACE_HOOKS is not defined, but the patch doesn't completely fix the problem. KDTRACE_HOOKS is a kernel option that means, "the kernel implements the interfaces required by dtrace.ko and friends." It doesn't make sense for the modules themselves to be modulated by this option.

Why ? This is exactly how options work, at least for the coherent build of kernel and modules.

Sat, Feb 15, 10:26 PM
kib accepted D23665: Fix a swap block allocation race..
Sat, Feb 15, 7:51 PM
kib added a comment to D23699: Fix build..

If module is buildable, I do not see a reason to not include it into the build. Mark can provide more input on this issue.

Sat, Feb 15, 6:54 PM
kib created D23699: Fix build..
Sat, Feb 15, 5:45 PM
kib accepted D23631: Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (M of N).
Sat, Feb 15, 4:53 PM
kib updated subscribers of D23694: sysv_sem: fix the loop that compacts sem array on semaphores removal..
Sat, Feb 15, 11:11 AM
kib created D23694: sysv_sem: fix the loop that compacts sem array on semaphores removal..
Sat, Feb 15, 11:11 AM
kib committed rS357949: MFC r357813:.
MFC r357813:
Sat, Feb 15, 12:49 AM
kib updated the summary of D23622: Do not read sigfastblock word on syscall entry..
Sat, Feb 15, 12:12 AM
kib retitled D23622: Do not read sigfastblock word on syscall entry. from Convert usermode access (fueword) for sigfastblock(2) into a kernel read. to Do not read sigfastblock word on syscall entry..
Sat, Feb 15, 12:12 AM
kib updated the diff for D23622: Do not read sigfastblock word on syscall entry..

Another approach, summary will be updated.

Sat, Feb 15, 12:07 AM

Fri, Feb 14

kib committed rS357948: Consolidate read code for timecounters and fix possible overflow in.
Consolidate read code for timecounters and fix possible overflow in
Fri, Feb 14, 11:27 PM
kib added a comment to D23676: Add pthread_peekjoin_np(3)..

It was a test for r357894. The victim thread exiting, then I need to wait for it to exit but not join, to issue cancellation request.

Fri, Feb 14, 7:50 PM
kib added a comment to D23675: The SYSCTL_NODE / MPSAFE / NEEDGIANT saga.

Ok, consider it from the following angle: does doing the sweep for CTLTYPE_NODE->CTLTYPE_PROC improves the code or just allows to avoid adding a flag, and then removing it ?

Fri, Feb 14, 7:28 PM
kib accepted D23664: Fix object locking races in swapoff..
Fri, Feb 14, 7:21 PM
kib accepted D23449: Add unlocked variants of grab functions..
Fri, Feb 14, 7:03 PM
kib accepted D23446: Add a lockless lookup mechanism that uses a SMR zone..
Fri, Feb 14, 6:59 PM
kib updated the diff for D23676: Add pthread_peekjoin_np(3)..

Man page edits.
Add symlink for man.

Fri, Feb 14, 6:55 PM