Re: svn commit: r368769 - head/sys/net

2020-12-22 Thread Mateusz Guzik
@@ -2075,10 +2148,23 @@ sysctl_ifmalist(int af, struct walkarg *w) > return (error); > } > > +static void > +rtable_sysctl_dump(uint32_t fibnum, int family, struct walkarg *w) > +{ > + union sockaddr_union sa_dst, sa_mask; > + > + w->family = family; > + w->dst = (struct sockaddr *)_dst; > +

svn commit: r368732 - head/sys/kern

2020-12-17 Thread Mateusz Guzik
Author: mjg Date: Thu Dec 17 18:52:30 2020 New Revision: 368732 URL: https://svnweb.freebsd.org/changeset/base/368732 Log: fd: reimplement close_range to avoid spurious relocking Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c

svn commit: r368731 - in head/sys: kern security/audit

2020-12-17 Thread Mateusz Guzik
Author: mjg Date: Thu Dec 17 18:52:04 2020 New Revision: 368731 URL: https://svnweb.freebsd.org/changeset/base/368731 Log: audit: rework AUDIT_SYSCLOSE This in particular avoids spurious lookups on close. Modified: head/sys/kern/kern_descrip.c head/sys/security/audit/audit.h

svn commit: r368730 - head/sys/kern

2020-12-17 Thread Mateusz Guzik
Author: mjg Date: Thu Dec 17 18:51:09 2020 New Revision: 368730 URL: https://svnweb.freebsd.org/changeset/base/368730 Log: fd: refactor closefp in preparation for close_range rework Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c

svn commit: r368703 - head/sys/kern

2020-12-16 Thread Mateusz Guzik
Author: mjg Date: Wed Dec 16 18:01:41 2020 New Revision: 368703 URL: https://svnweb.freebsd.org/changeset/base/368703 Log: fd: remove redundant saturation check from fget_unlocked_seq refcount_acquire_if_not_zero returns true on saturation. The case of 0 is handled by looping again,

svn commit: r368617 - head/sys/kern

2020-12-13 Thread Mateusz Guzik
Author: mjg Date: Sun Dec 13 21:32:19 2020 New Revision: 368617 URL: https://svnweb.freebsd.org/changeset/base/368617 Log: uipc: disable prediction in unp_pcb_lock_peer The branch is not very predictable one way or the other, at least during buildkernel where it only correctly matched

svn commit: r368616 - head/sys/sys

2020-12-13 Thread Mateusz Guzik
Author: mjg Date: Sun Dec 13 21:30:42 2020 New Revision: 368616 URL: https://svnweb.freebsd.org/changeset/base/368616 Log: Patch annotation in sigdeferstop Probability flipped since sigdefer handling was moved away from regular VOP calls. Modified: head/sys/sys/signalvar.h Modified:

svn commit: r368615 - head/sys/kern

2020-12-13 Thread Mateusz Guzik
Author: mjg Date: Sun Dec 13 21:29:39 2020 New Revision: 368615 URL: https://svnweb.freebsd.org/changeset/base/368615 Log: cache: fix ups bad predicts - last level fallback normally sees CREATE; the code should be optimized to not get there for said case - fast path commonly fails

svn commit: r368614 - head/sys/kern

2020-12-13 Thread Mateusz Guzik
Author: mjg Date: Sun Dec 13 21:28:15 2020 New Revision: 368614 URL: https://svnweb.freebsd.org/changeset/base/368614 Log: vfs: correctly predict last fdrop on failed open Arguably since the count is guaranteed to be 1 the code should be modified to avoid the work. Modified:

Re: svn commit: r368609 - in head/sys: kern sys

2020-12-13 Thread Mateusz Guzik
: > On Sun, 13 Dec 2020 at 18:06, Mateusz Guzik wrote: >> >> Author: mjg >> Date: Sun Dec 13 18:06:24 2020 >> New Revision: 368609 >> URL: https://svnweb.freebsd.org/changeset/base/368609 >> >> Log: >> fd: fix fdrop prediction when closing a fd

svn commit: r368609 - in head/sys: kern sys

2020-12-13 Thread Mateusz Guzik
Author: mjg Date: Sun Dec 13 18:06:24 2020 New Revision: 368609 URL: https://svnweb.freebsd.org/changeset/base/368609 Log: fd: fix fdrop prediction when closing a fd Most of the time this is the last reference, contrary to typical fdrop use. Modified: head/sys/kern/kern_descrip.c

Re: svn commit: r368571 - head/sys/netpfil/ipfw

2020-12-12 Thread Mateusz Guzik
.f = f, .arg = arg }; > > - rh = rt_tables_get_rnh(ti->data, AF_INET); > - if (rh != NULL) { > - RIB_RLOCK(rh); > - error = rh->rnh_walktree(>head, (walktree_f_t *)f, arg); > - RIB_RUNLOCK(rh); > - } > - > - rh = rt_tables_get_rnh(ti->data, AF_INET6); > - if (rh != NULL) { > - RIB_RLOCK(rh); > - error = rh->rnh_walktree(>head, (walktree_f_t *)f, arg); > - RIB_RUNLOCK(rh); > - } > + karg.family = AF_INET; > + rib_walk(ti->data, AF_INET, false, walk_wrapper_f, ); > + karg.family = AF_INET6; > + rib_walk(ti->data, AF_INET6, false, walk_wrapper_f, ); > } > > struct table_algo addr_kfib = { > ___ > svn-src-...@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org" > -- Mateusz Guzik ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r368516 - head/sys/kern

2020-12-10 Thread Mateusz Guzik
Author: mjg Date: Thu Dec 10 17:17:22 2020 New Revision: 368516 URL: https://svnweb.freebsd.org/changeset/base/368516 Log: fd: make serialization in fdescfree_fds conditional on hold count p_fd nullification in fdescfree serializes against new threads transitioning the count 1 -> 2,

Re: svn commit: r368375 - head/sys/kern

2020-12-06 Thread Mateusz Guzik
> > On 6 Dec 2020, at 04:59, Mateusz Guzik wrote: >> +static int >> +namei_getpath(struct nameidata *ndp) >> +{ >> +struct componentname *cnp; >> +int error; >> + >> +cnp = >ni_cnd; >> + >> +/* >> + * Get a b

svn commit: r368395 - head/sys/kern

2020-12-06 Thread Mateusz Guzik
Author: mjg Date: Sun Dec 6 19:24:38 2020 New Revision: 368395 URL: https://svnweb.freebsd.org/changeset/base/368395 Log: vfs: add cleanup on error missed in r368375 Noted by: jrtc27 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c

svn commit: r368375 - head/sys/kern

2020-12-05 Thread Mateusz Guzik
Author: mjg Date: Sun Dec 6 04:59:24 2020 New Revision: 368375 URL: https://svnweb.freebsd.org/changeset/base/368375 Log: vfs: factor buffer allocation/copyin out of namei Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c

Re: svn commit: r368159 - in head/sys: arm/conf conf

2020-12-05 Thread Mateusz Guzik
_DEBUGopt_gfb.h > -GFB_NO_FONT_LOADING opt_gfb.h > -GFB_NO_MODE_CHANGE opt_gfb.h > VFP opt_global.h > ___ > svn-src-...@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org" > -- Mateusz Guzik ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r368360 - head/sys/kern

2020-12-04 Thread Mateusz Guzik
Author: mjg Date: Sat Dec 5 05:56:23 2020 New Revision: 368360 URL: https://svnweb.freebsd.org/changeset/base/368360 Log: vfs: keep bad ops on vnode reclaim They were only modified to accomodate a redundant assertion. This runs into problems as lockless lookup can still try to use

Re: svn commit: r367714 - head/sys/kern

2020-12-01 Thread Mateusz Guzik
zoo.freebsd.org crashed with what appears to be the same bug, so I went ahead and committed the fix in r368271. On 12/1/20, Hans Petter Selasky wrote: > On 12/1/20 12:26 PM, Mateusz Guzik wrote: >> Does this fix it for you?https://people.freebsd.org/~mjg/poll.diff > > Will

Re: svn commit: r368271 - head/sys/kern

2020-12-01 Thread Mateusz Guzik
On 12/2/20, Mateusz Guzik wrote: > Author: mjg > Date: Wed Dec 2 00:48:15 2020 > New Revision: 368271 > URL: https://svnweb.freebsd.org/changeset/base/368271 > > Log: > select: make sure there are no wakeup attempts after selfdfree returns > > Prior to the patc

svn commit: r368271 - head/sys/kern

2020-12-01 Thread Mateusz Guzik
Author: mjg Date: Wed Dec 2 00:48:15 2020 New Revision: 368271 URL: https://svnweb.freebsd.org/changeset/base/368271 Log: select: make sure there are no wakeup attempts after selfdfree returns Prior to the patch returning selfdfree could still be racing against doselwakeup which set

Re: svn commit: r367714 - head/sys/kern

2020-12-01 Thread Mateusz Guzik
Does this fix it for you? https://people.freebsd.org/~mjg/poll.diff On 12/1/20, Hans Petter Selasky wrote: > On 12/1/20 12:06 PM, Mateusz Guzik wrote: >> I see what the bug is, will think about the right fix. >> >> Is this reproducible for you? > > Yes, I h

Re: svn commit: r367714 - head/sys/kern

2020-12-01 Thread Mateusz Guzik
I see what the bug is, will think about the right fix. Is this reproducible for you? On 12/1/20, Hans Petter Selasky wrote: > On 11/16/20 4:12 AM, Mateusz Guzik wrote: >> Author: mjg >> Date: Mon Nov 16 03:12:21 2020 >> New Revision: 367714 >> URL: https://svnweb

svn commit: r368048 - in head/sys: kern sys

2020-11-25 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 26 06:59:27 2020 New Revision: 368048 URL: https://svnweb.freebsd.org/changeset/base/368048 Log: thread: staticize thread_reap and move td_allocdomain thread_init is a much better fit as the the value is constant after initialization. Modified:

svn commit: r368039 - head/sys/kern

2020-11-25 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 25 22:53:21 2020 New Revision: 368039 URL: https://svnweb.freebsd.org/changeset/base/368039 Log: pipe: follow up cleanup to previous The commited patch was incomplete. - add back missing goto retry, noted by jhb - 'if (error)' -> 'if (error != 0)' -

svn commit: r368038 - head/sys/kern

2020-11-25 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 25 21:41:23 2020 New Revision: 368038 URL: https://svnweb.freebsd.org/changeset/base/368038 Log: pipe: drop spurious pipeunlock/pipelock cycle on write Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c

svn commit: r367978 - head/sys/kern

2020-11-23 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 24 03:49:37 2020 New Revision: 367978 URL: https://svnweb.freebsd.org/changeset/base/367978 Log: locks: push lock_delay_arg_init calls down Minor cleanup to skip doing them when recursing on locks and so that they can act on found lock value if need be.

svn commit: r367977 - head/sys/kern

2020-11-23 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 24 03:48:44 2020 New Revision: 367977 URL: https://svnweb.freebsd.org/changeset/base/367977 Log: sx: drop spurious volatile keyword Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c

svn commit: r367962 - in head/sys: kern sys

2020-11-23 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 23 18:27:21 2020 New Revision: 367962 URL: https://svnweb.freebsd.org/changeset/base/367962 Log: dtrace: stop using eventhandlers for the part compiled into the kernel Reviewed by: kib, markj Differential Revision:https://reviews.freebsd.org/D27311

svn commit: r367961 - in head/sys: kern sys

2020-11-23 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 23 18:26:47 2020 New Revision: 367961 URL: https://svnweb.freebsd.org/changeset/base/367961 Log: thread: stash domain id to work around vtophys problems on ppc64 Adding to zombie list can be perfomed by idle threads, which on ppc64 leads to panics as it requires

svn commit: r367852 - in head/sys: kern sys

2020-11-19 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 19 19:25:47 2020 New Revision: 367852 URL: https://svnweb.freebsd.org/changeset/base/367852 Log: pipe: thundering herd problem in pipelock All reads and writes are serialized with a hand-rolled lock, but unlocking it always wakes up all waiters. Existing flag

svn commit: r367842 - head/sys/kern

2020-11-19 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 19 10:00:48 2020 New Revision: 367842 URL: https://svnweb.freebsd.org/changeset/base/367842 Log: thread: numa-aware zombie reaping The current global list is a significant problem, in particular induces a lot of cross-domain thread frees. When running poudriere

svn commit: r367835 - head/sys/kern

2020-11-19 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 19 08:16:45 2020 New Revision: 367835 URL: https://svnweb.freebsd.org/changeset/base/367835 Log: pipe: tidy up pipelock Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c

svn commit: r367833 - in head/sys: kern security/mac sys

2020-11-18 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 19 06:30:25 2020 New Revision: 367833 URL: https://svnweb.freebsd.org/changeset/base/367833 Log: pipe: allow for lockless pipe_stat pipes get stated all thet time and this avoidably contributed to contention. The pipe lock is only held to accomodate MAC and to

Re: svn commit: r367695 - in head/sys: kern sys

2020-11-18 Thread Mateusz Guzik
On 11/19/20, John Baldwin wrote: > On 11/18/20 2:16 PM, Mateusz Guzik wrote: >> On 11/17/20, John Baldwin wrote: >>> On 11/14/20 11:22 AM, Mateusz Guzik wrote: >> Interested parties can check the consumer (also seen in the diff) to >> see this is for consisten

svn commit: r367830 - in head/sys: kern sys

2020-11-18 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 19 04:28:39 2020 New Revision: 367830 URL: https://svnweb.freebsd.org/changeset/base/367830 Log: cred: fix minor nits in r367695 Noted by: jhb Modified: head/sys/kern/kern_prot.c head/sys/sys/ucred.h Modified: head/sys/kern/kern_prot.c

svn commit: r367829 - head/sys/kern

2020-11-18 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 19 04:27:51 2020 New Revision: 367829 URL: https://svnweb.freebsd.org/changeset/base/367829 Log: smp: fix smp_rendezvous_cpus_retry usage before smp starts Since none of the other CPUs are running there is nobody to clear their entries and the routine spins

Re: svn commit: r367813 - head/lib/libutil

2020-11-18 Thread Mateusz Guzik
On 11/19/20, Stefan Esser wrote: > Am 18.11.20 um 23:39 schrieb Jessica Clarke: >> On 18 Nov 2020, at 22:32, Stefan Esser wrote: >>> >>> Am 18.11.20 um 22:40 schrieb Mateusz Guzik: >>>>> +{ >>>>> + static const int localbase_

Re: svn commit: r367695 - in head/sys: kern sys

2020-11-18 Thread Mateusz Guzik
On 11/17/20, John Baldwin wrote: > On 11/14/20 11:22 AM, Mateusz Guzik wrote: >> Author: mjg >> Date: Sat Nov 14 19:22:02 2020 >> New Revision: 367695 >> URL: https://svnweb.freebsd.org/changeset/base/367695 >> >> Log: >> thread: batch credenti

Re: svn commit: r367813 - head/lib/libutil

2020-11-18 Thread Mateusz Guzik
if a parallel update in another thread is not > + * detected and the non-NULL pointer is overwritten. > + */ > + if (tmppath[0] != '\0' && > + (volatile const char*)localbase == NULL) > +

Re: svn commit: r367819 - in head: sys/kern sys/sys usr.sbin/jail

2020-11-18 Thread Mateusz Guzik
bin/jail/jail.8 > == > --- head/usr.sbin/jail/jail.8 Wed Nov 18 20:59:58 2020(r367818) > +++ head/usr.sbin/jail/jail.8 Wed Nov 18 21:07:08 2020(r367819) > @@ -25,7 +25,7 @@ > .\" > .\" $Fr

svn commit: r367814 - head/sys/sys

2020-11-18 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 18 19:47:24 2020 New Revision: 367814 URL: https://svnweb.freebsd.org/changeset/base/367814 Log: fd: reorder struct file to reduce false sharing The size on LP64 is 80 bytes, which is just more than a cacheline, does not lend itself to easy shrinking and

Re: svn commit: r367713 - head/sys/kern

2020-11-18 Thread Mateusz Guzik
On 11/18/20, Konstantin Belousov wrote: > On Tue, Nov 17, 2020 at 03:36:31PM +0100, Mateusz Guzik wrote: >> On 11/17/20, Konstantin Belousov wrote: >> > On Tue, Nov 17, 2020 at 04:15:12AM +0100, Mateusz Guzik wrote: >> >> On 11/17/20, Konstantin Belousov wrote

Re: svn commit: r367713 - head/sys/kern

2020-11-17 Thread Mateusz Guzik
On 11/17/20, Konstantin Belousov wrote: > On Tue, Nov 17, 2020 at 04:15:12AM +0100, Mateusz Guzik wrote: >> On 11/17/20, Konstantin Belousov wrote: >> > On Mon, Nov 16, 2020 at 03:09:19AM +0000, Mateusz Guzik wrote: >> >> Author: mjg >> >> Date: M

Re: svn commit: r367713 - head/sys/kern

2020-11-16 Thread Mateusz Guzik
On 11/17/20, Konstantin Belousov wrote: > On Mon, Nov 16, 2020 at 03:09:19AM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Mon Nov 16 03:09:18 2020 >> New Revision: 367713 >> URL: https://svnweb.freebsd.org/changeset/base/367713 >> >> Log: >> s

svn commit: r367738 - head/sys/sys

2020-11-16 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 17 00:04:30 2020 New Revision: 367738 URL: https://svnweb.freebsd.org/changeset/base/367738 Log: cpuset: reorder so that cs_mask does not share cacheline with cs_ref Modified: head/sys/sys/cpuset.h Modified: head/sys/sys/cpuset.h

svn commit: r367737 - head/sys/kern

2020-11-16 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 17 00:04:05 2020 New Revision: 367737 URL: https://svnweb.freebsd.org/changeset/base/367737 Log: cpuset: refcount-clean Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c

svn commit: r367733 - head/sys/kern

2020-11-16 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 16 17:56:58 2020 New Revision: 367733 URL: https://svnweb.freebsd.org/changeset/base/367733 Log: malloc: make malloc_large closer to standalone This moves entire large alloc handling out of all consumers, apart from deciding to go there. This is a step

svn commit: r367714 - head/sys/kern

2020-11-15 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 16 03:12:21 2020 New Revision: 367714 URL: https://svnweb.freebsd.org/changeset/base/367714 Log: select: call seltdfini on process and thread exit Since thread_zone is marked NOFREE the thread_fini callback is never executed, meaning memory allocated by

svn commit: r367713 - head/sys/kern

2020-11-15 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 16 03:09:18 2020 New Revision: 367713 URL: https://svnweb.freebsd.org/changeset/base/367713 Log: select: replace reference counting with memory barriers in selfd Refcounting was added to combat a race between selfdfree and doselwakup, but it adds avoidable

svn commit: r367700 - head/sys/kern

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sun Nov 15 01:54:44 2020 New Revision: 367700 URL: https://svnweb.freebsd.org/changeset/base/367700 Log: sched: fix an incorrect comparison in sched_lend_user_prio_cond Compare with sched_lend_user_prio. Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c

Re: svn commit: r367692 - head/sys/sys

2020-11-14 Thread Mateusz Guzik
noying to developers. Regardless, I have no intention to working on any of this. Maybe PORTS_MODULES is just not advertised enough. On 11/14/20, Warner Losh wrote: > true, but a version bump forces that and versions are cheap enough... > > Warner > > On Sat, Nov 14, 2020 at 1:58 PM Mateusz

Re: svn commit: r367692 - head/sys/sys

2020-11-14 Thread Mateusz Guzik
you are expected to recompile all your kernel modules every time you update head On 11/14/20, Shawn Webb wrote: > Are there any kernel modules (in base, in ports, or out-of-both-trees) > that access struct ucred? > > On Sat, Nov 14, 2020 at 09:51:47PM +0100, Mateusz Guzik wrote: >

Re: svn commit: r367692 - head/sys/sys

2020-11-14 Thread Mateusz Guzik
I don't think so, it does not change any APIs On 11/14/20, Shawn Webb wrote: > On Sat, Nov 14, 2020 at 07:20:37PM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Sat Nov 14 19:20:37 2020 >> New Revision: 367692 >> URL: https://svnweb.freebsd.org/changeset/base/

svn commit: r367697 - head/sys/sys

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 14 19:56:11 2020 New Revision: 367697 URL: https://svnweb.freebsd.org/changeset/base/367697 Log: cred: annotate credbatch_process argument as unused Fixes libprocstat compilation as zfs defines _KERNEL. Modified: head/sys/sys/ucred.h Modified:

svn commit: r367696 - head/sys/contrib/openzfs/module/zfs

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 14 19:23:07 2020 New Revision: 367696 URL: https://svnweb.freebsd.org/changeset/base/367696 Log: zfs: disable periodic arc updates They are only there to provide less innacurate statistics for debuggers. However, this is quite heavy-weight and instead it would

svn commit: r367695 - in head/sys: kern sys

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 14 19:22:02 2020 New Revision: 367695 URL: https://svnweb.freebsd.org/changeset/base/367695 Log: thread: batch credential freeing Modified: head/sys/kern/kern_prot.c head/sys/kern/kern_thread.c head/sys/sys/ucred.h Modified: head/sys/kern/kern_prot.c

svn commit: r367694 - in head/sys: kern sys

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 14 19:21:46 2020 New Revision: 367694 URL: https://svnweb.freebsd.org/changeset/base/367694 Log: thread: batch resource limit free calls Modified: head/sys/kern/kern_resource.c head/sys/kern/kern_thread.c head/sys/sys/resourcevar.h Modified:

svn commit: r367693 - head/sys/kern

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 14 19:20:58 2020 New Revision: 367693 URL: https://svnweb.freebsd.org/changeset/base/367693 Log: thread: rework tid batch to use helpers Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c

svn commit: r367692 - head/sys/sys

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 14 19:20:37 2020 New Revision: 367692 URL: https://svnweb.freebsd.org/changeset/base/367692 Log: cred: reorder cr_audit to be closer to the lock This makes cr_uid avoid sharing. Modified: head/sys/sys/ucred.h Modified: head/sys/sys/ucred.h

svn commit: r367691 - head/sys/kern

2020-11-14 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 14 19:19:27 2020 New Revision: 367691 URL: https://svnweb.freebsd.org/changeset/base/367691 Log: thread: pad tid lock On a kernel with other changes this bumps 104-way thread creation/destruction from 0.96 mln ops/s to 1.1 mln ops/s. Modified:

svn commit: r367650 - head/sys/kern

2020-11-13 Thread Mateusz Guzik
Author: mjg Date: Fri Nov 13 19:22:53 2020 New Revision: 367650 URL: https://svnweb.freebsd.org/changeset/base/367650 Log: malloc: retire MALLOC_PROFILE The global array has prohibitive performance impact on multicore systems. The same data (and more) can be obtained with dtrace.

Re: svn commit: r367631 - in head/sys: kern sys

2020-11-13 Thread Mateusz Guzik
2 != NULL) > + ASSERT_VOP_ELOCKED(vp2, "vp2 ret"); > } > Multiple callers who get here with flipped addresses can end up failing against each other in an indefinite loop. Instead, after initial trylocking fails, the routine should establish ordering it will follow for itself, fo

Re: svn commit: r367626 - head/sys/geom/bde

2020-11-12 Thread Mateusz Guzik
On 11/12/20, Oliver Pinter wrote: > On Thursday, November 12, 2020, Mateusz Guzik wrote: > >> Author: mjg >> Date: Thu Nov 12 20:20:57 2020 >> New Revision: 367626 >> URL: https://svnweb.freebsd.org/changeset/base/367626 >> >> Log: >>

svn commit: r367627 - in head/sys: kern sys

2020-11-12 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 12 20:22:58 2020 New Revision: 367627 URL: https://svnweb.freebsd.org/changeset/base/367627 Log: malloc: retire malloc_last_fail The routine does not serve any practical purpose. Memory can be allocated in many other ways and most consumers pass the

svn commit: r367626 - head/sys/geom/bde

2020-11-12 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 12 20:20:57 2020 New Revision: 367626 URL: https://svnweb.freebsd.org/changeset/base/367626 Log: gbde: replace malloc_last_fail with a kludge This facilitates removal of malloc_last_fail without really impacting anything. Modified:

svn commit: r367605 - head/sys/kern

2020-11-11 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 12 00:29:23 2020 New Revision: 367605 URL: https://svnweb.freebsd.org/changeset/base/367605 Log: thread: move nthread management out of tid_alloc While this adds more work single-threaded, it also enables SMP-related speed ups. Modified:

svn commit: r367598 - head/sys/kern

2020-11-11 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 11 18:45:06 2020 New Revision: 367598 URL: https://svnweb.freebsd.org/changeset/base/367598 Log: thread: batch tid_free calls in thread_reap This eliminates the highly pessimal pattern of relocking from multiple CPUs in quick succession. Note this is still

svn commit: r367597 - in head/sys: kern sys

2020-11-11 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 11 18:43:51 2020 New Revision: 367597 URL: https://svnweb.freebsd.org/changeset/base/367597 Log: thread: lockless zombie list manipulation This gets rid of the most contended spinlock seen when creating/destroying threads in a loop. (modulo kstack) Tested

svn commit: r367585 - head/sys/kern

2020-11-11 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 11 08:51:04 2020 New Revision: 367585 URL: https://svnweb.freebsd.org/changeset/base/367585 Log: thread: add more fine-grained tidhash locking Note this still does not scale but is enough to move it out of the way for the foreseable future. In particular a

svn commit: r367584 - in head/sys: kern sys

2020-11-11 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 11 08:50:04 2020 New Revision: 367584 URL: https://svnweb.freebsd.org/changeset/base/367584 Log: thread: rework tidhash vs proc lock interaction Apart from minor clean up this gets rid of proc unlock/lock cycle on thread exit to work around LOR against tidhash

svn commit: r367583 - in head/sys: kern sys

2020-11-11 Thread Mateusz Guzik
Author: mjg Date: Wed Nov 11 08:48:43 2020 New Revision: 367583 URL: https://svnweb.freebsd.org/changeset/base/367583 Log: thread: fix thread0 tid allocation Startup code hardcodes the value instead of allocating it. The first spawned thread would then be a duplicate. Pointy hat:

svn commit: r367580 - head/sys/kern

2020-11-10 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 21:29:10 2020 New Revision: 367580 URL: https://svnweb.freebsd.org/changeset/base/367580 Log: thread: tidy up r367543 "locked" variable is spurious in the committed version. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c

svn commit: r367572 - head/sys/kern

2020-11-10 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 18:10:50 2020 New Revision: 367572 URL: https://svnweb.freebsd.org/changeset/base/367572 Log: Allow rtprio_thread to operate on threads of any process This in particular unbreaks rtkit. The limitation was a leftover of previous state, to quote a comment:

svn commit: r367569 - head/sys/contrib/openzfs/module/zfs

2020-11-10 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 14:23:46 2020 New Revision: 367569 URL: https://svnweb.freebsd.org/changeset/base/367569 Log: zfs: combine zio caches if possible This deduplicates 2 sets of caches using the same sizes. Memory savings fluctuate a lot, one sample result is buildworld on

svn commit: r367568 - head/sys/contrib/openzfs/module/zfs

2020-11-10 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 14:21:23 2020 New Revision: 367568 URL: https://svnweb.freebsd.org/changeset/base/367568 Log: zfs: g/c unused data_alloc_arena Modified: head/sys/contrib/openzfs/module/zfs/zio.c Modified: head/sys/contrib/openzfs/module/zfs/zio.c

svn commit: r367544 - in head/sys: kern sys

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 01:57:48 2020 New Revision: 367544 URL: https://svnweb.freebsd.org/changeset/base/367544 Log: thread: retire thread_find tdfind should be used instead. Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c

svn commit: r367543 - head/sys/kern

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 01:57:19 2020 New Revision: 367543 URL: https://svnweb.freebsd.org/changeset/base/367543 Log: thread: use tdfind in sysctl_kern_proc_kstack This treads linear scans for locked lookup, but more importantly removes the only consumer of thread_find. Modified:

svn commit: r367542 - head/sys/kern

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 01:31:06 2020 New Revision: 367542 URL: https://svnweb.freebsd.org/changeset/base/367542 Log: threads: remove the unused TID_BUFFER_SIZE macro Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c

svn commit: r367541 - head/sys/kern

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Tue Nov 10 01:13:58 2020 New Revision: 367541 URL: https://svnweb.freebsd.org/changeset/base/367541 Log: thread: adds newer bits for r367537 The committed patch was an older version. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c

svn commit: r367537 - head/sys/kern

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 23:05:28 2020 New Revision: 367537 URL: https://svnweb.freebsd.org/changeset/base/367537 Log: threads: reimplement tid allocation on top of a bitmap There are workloads with very bursty tid allocation and since unr tries very hard to have small-sized bitmaps

svn commit: r367536 - head/sys/kern

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 23:04:30 2020 New Revision: 367536 URL: https://svnweb.freebsd.org/changeset/base/367536 Log: threads: introduce a limit for total number The intent is to replace the current id allocation method and a known upper bound will be useful. Reviewed by: kib

svn commit: r367535 - in head/sys: kern sys

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 23:02:13 2020 New Revision: 367535 URL: https://svnweb.freebsd.org/changeset/base/367535 Log: vfs: group mount per-cpu vars into one struct While here move frequently read stuff into the same cacheline. This shrinks struct mount by 64 bytes. Tested

svn commit: r367534 - head/usr.bin/vmstat

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 23:00:29 2020 New Revision: 367534 URL: https://svnweb.freebsd.org/changeset/base/367534 Log: vmstat: drop the HighUse field from malloc dump It is hardwired to "-" since its introduction in 2005. Reviewed by: markj Differential Revision:

svn commit: r367533 - head/sys/kern

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 22:59:41 2020 New Revision: 367533 URL: https://svnweb.freebsd.org/changeset/base/367533 Log: malloc: provide 384 byte zone Total page count after buildworld on ZFS for 384 (if present) and 512 zones: before: 29713 after: 25946 per-zone page use:

svn commit: r367532 - in head/sys: kern sys

2020-11-09 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 22:58:29 2020 New Revision: 367532 URL: https://svnweb.freebsd.org/changeset/base/367532 Log: malloc: retire mt_stats_zone in favor of pcpu_zone_64 Reviewed by: markj, imp Differential Revision:https://reviews.freebsd.org/D27142 Modified:

svn commit: r367503 - in head/sys: kern vm

2020-11-08 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 00:34:23 2020 New Revision: 367503 URL: https://svnweb.freebsd.org/changeset/base/367503 Log: Add more per-cpu zones. This covers powers of 2 up to 64. Example pending user is ZFS. Modified: head/sys/kern/subr_pcpu.c head/sys/vm/uma.h Modified:

svn commit: r367501 - head/usr.bin/vmstat

2020-11-08 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 00:05:45 2020 New Revision: 367501 URL: https://svnweb.freebsd.org/changeset/base/367501 Log: vmstat: remove spurious newlines when reporting zones Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c

svn commit: r367500 - head/sys/kern

2020-11-08 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 00:05:21 2020 New Revision: 367500 URL: https://svnweb.freebsd.org/changeset/base/367500 Log: procdesc: convert the zone to a malloc type The object is 128 bytes in size. Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c

svn commit: r367499 - head/sys/sys

2020-11-08 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 00:04:58 2020 New Revision: 367499 URL: https://svnweb.freebsd.org/changeset/base/367499 Log: bufcache: convert bo_numoutput from long to int int is wide enough and it plugs a hole in struct vnode, taking it down from 496 to 488 bytes. Modified:

svn commit: r367498 - in head/sys: compat/linuxkpi/common/src dev/evdev kern sys

2020-11-08 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 9 00:04:35 2020 New Revision: 367498 URL: https://svnweb.freebsd.org/changeset/base/367498 Log: kqueue: save space by using only one func pointer for assertions Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/dev/evdev/uinput.c

svn commit: r367454 - head/sys/contrib/openzfs/module/os/freebsd/zfs

2020-11-07 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 7 16:58:38 2020 New Revision: 367454 URL: https://svnweb.freebsd.org/changeset/base/367454 Log: zfs: remove 2 assertions that teardown lock is not held They are not very useful and hard to implement with rms. This has a side effect of simplying the code.

svn commit: r367453 - in head/sys: kern sys

2020-11-07 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 7 16:57:53 2020 New Revision: 367453 URL: https://svnweb.freebsd.org/changeset/base/367453 Log: rms: several cleanups + debug read lockers handling This adds a dedicated counter updated with atomics when INVARIANTS is used. As a side effect one can reliably

svn commit: r367438 - head/sys/kern

2020-11-06 Thread Mateusz Guzik
Author: mjg Date: Sat Nov 7 01:32:16 2020 New Revision: 367438 URL: https://svnweb.freebsd.org/changeset/base/367438 Log: malloc: tweak the version check in r367432 to include type name While here fix a whitespace problem. Modified: head/sys/kern/kern_malloc.c Modified:

Re: svn commit: r367432 - in head: lib/libmemstat sys/cddl/dev/dtmalloc sys/kern sys/sys

2020-11-06 Thread Mateusz Guzik
You need to recompile all modules. On 11/7/20, Yasuhiro KIMURA wrote: > From: Mateusz Guzik > Subject: svn commit: r367432 - in head: lib/libmemstat sys/cddl/dev/dtmalloc > sys/kern sys/sys > Date: Fri, 6 Nov 2020 21:33:59 + (UTC) > >> Author: mjg >> Date: Fri

svn commit: r367432 - in head: lib/libmemstat sys/cddl/dev/dtmalloc sys/kern sys/sys

2020-11-06 Thread Mateusz Guzik
Author: mjg Date: Fri Nov 6 21:33:59 2020 New Revision: 367432 URL: https://svnweb.freebsd.org/changeset/base/367432 Log: malloc: move malloc_type_internal into malloc_type According to code comments the original motivation was to allow for malloc_type_internal changes without ABI

svn commit: r367400 - head/sys/dev/nvme

2020-11-05 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 5 21:44:58 2020 New Revision: 367400 URL: https://svnweb.freebsd.org/changeset/base/367400 Log: nvme: change namei_request_zone into a malloc type Both the size (128 bytes) and ephemeral nature of allocations make it a great fit for malloc. A dedicated

svn commit: r367389 - in head/sys: kern sys

2020-11-05 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 5 16:21:21 2020 New Revision: 367389 URL: https://svnweb.freebsd.org/changeset/base/367389 Log: malloc: add a helper returning size allocated for given request Sample usage: kernel modules can decide whether to stick to malloc or create their own zone.

svn commit: r367384 - in head/sys: kern sys vm

2020-11-05 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 5 15:08:56 2020 New Revision: 367384 URL: https://svnweb.freebsd.org/changeset/base/367384 Log: Rationalize per-cpu zones. The 2 provided zones had inconsistent naming between each other ("int" and "64") and other allocator zones (which use bytes). Follow

svn commit: r367379 - head/sys/kern

2020-11-05 Thread Mateusz Guzik
Author: mjg Date: Thu Nov 5 12:24:37 2020 New Revision: 367379 URL: https://svnweb.freebsd.org/changeset/base/367379 Log: poll/select: change selfd_zone into a malloc type On a sample box vmstat -z shows: ITEM SIZE LIMIT USED FREE REQ 64:

  1   2   3   4   5   6   7   8   9   10   >