Page MenuHomeFreeBSD

mjg (Mateusz Guzik)
nice guy

Projects

User Details

User Since
Jun 4 2014, 10:38 AM (434 w, 3 d)

Recent Activity

Wed, Sep 28

mjg requested review of D36775: ipsec: retire sadb_msg_reserved in order to facilitate per-cpu refcounting.
Wed, Sep 28, 5:14 PM
mjg added inline comments to D36774: crypto: move all zeroing into crypto_getreq.
Wed, Sep 28, 4:33 PM
mjg updated the diff for D36774: crypto: move all zeroing into crypto_getreq.
Wed, Sep 28, 4:33 PM
mjg added reviewers for D36774: crypto: move all zeroing into crypto_getreq: jhb, markj.
Wed, Sep 28, 4:10 PM
mjg requested review of D36774: crypto: move all zeroing into crypto_getreq.
Wed, Sep 28, 4:00 PM
mjg committed rGde56ac880999: zfs: bring per_txg_dirty_frees_percent back to 30 (authored by mjg).
zfs: bring per_txg_dirty_frees_percent back to 30
Wed, Sep 28, 1:29 AM

Mon, Sep 26

mjg accepted D36500: Fix O(n^2) behavior in sysctl.

sorry, forgot to respond

Mon, Sep 26, 9:31 PM

Thu, Sep 22

mjg added inline comments to D27600: __predict_true/false profiling.
Thu, Sep 22, 11:17 PM
mjg added a comment to D36318: Add new EVENTHANDLER types: PREEMPTIBLE and SLEEPABLE.

ping?

Thu, Sep 22, 11:12 PM
mjg updated the diff for D36640: remove support for LK_INTERLOCK from VOP_LOCK.
Thu, Sep 22, 10:56 AM
mjg retitled D36640: remove support for LK_INTERLOCK from VOP_LOCK from remove some LK_INTERLOCK uses to remove support for LK_INTERLOCK from VOP_LOCK.
Thu, Sep 22, 10:56 AM

Wed, Sep 21

mjg updated the summary of D36640: remove support for LK_INTERLOCK from VOP_LOCK.
Wed, Sep 21, 7:04 PM
mjg added a comment to D36390: cpuset: Add a -g mode to print the number of CPUs in the set.

can this go in please?

Wed, Sep 21, 1:48 AM

Tue, Sep 20

mjg requested review of D36640: remove support for LK_INTERLOCK from VOP_LOCK.
Tue, Sep 20, 10:03 PM
mjg committed rGd0b235c7152c: cxgbe: fix the build after e398922eaf66978b5e556f6b4b095693c865f329 (authored by mjg).
cxgbe: fix the build after e398922eaf66978b5e556f6b4b095693c865f329
Tue, Sep 20, 9:33 PM
mjg added a comment to D12889: Remove entropy harvesting from tmpfs atime.

I'm going to whack this altogether from tmpfs and ufs if there is no argument for keeping it within a week.

Tue, Sep 20, 7:16 PM
mjg abandoned D23587: Stop counting threads executing dynamic syscalls.

Looking at it now I think the feature needs to be whacked instead. I'll ship some diffs later.

Tue, Sep 20, 7:08 PM

Mon, Sep 19

mjg committed rG2c2ef670a79b: pseudofs: use the vget_prep/vget_finish idiom (authored by mjg).
pseudofs: use the vget_prep/vget_finish idiom
Mon, Sep 19, 8:09 PM
mjg committed rG4e1262ac9927: zfs: stop passing LK_INTERLOCK to VOP_LOCK (authored by mjg).
zfs: stop passing LK_INTERLOCK to VOP_LOCK
Mon, Sep 19, 8:06 PM
mjg committed rGa3ab1102e39b: vfs: silence a bogus LOR in freevnode (authored by mjg).
vfs: silence a bogus LOR in freevnode
Mon, Sep 19, 2:15 AM

Sun, Sep 18

mjg committed rGfa3eb3c97005: vfs: indent V_VALID_FLAGS with a tab (authored by mjg).
vfs: indent V_VALID_FLAGS with a tab
Sun, Sep 18, 9:33 PM

Sat, Sep 17

mjg updated the summary of D36318: Add new EVENTHANDLER types: PREEMPTIBLE and SLEEPABLE.
Sat, Sep 17, 11:58 PM
mjg updated the diff for D36318: Add new EVENTHANDLER types: PREEMPTIBLE and SLEEPABLE.
  • fix bugs
Sat, Sep 17, 11:58 PM
mjg committed rGc3707bd3d658: linuxkpi: use SI_SUB_EVENTHANDLER + 1, like other consumers (authored by mjg).
linuxkpi: use SI_SUB_EVENTHANDLER + 1, like other consumers
Sat, Sep 17, 11:55 PM
mjg committed rGa75d1ddd7431: vfs: introduce V_PCATCH to stop abusing PCATCH (authored by mjg).
vfs: introduce V_PCATCH to stop abusing PCATCH
Sat, Sep 17, 3:43 PM
mjg committed rG9e4f35ac2553: vfs: deperl msleep flag calculation in vn_start_*write (authored by mjg).
vfs: deperl msleep flag calculation in vn_start_*write
Sat, Sep 17, 3:43 PM
mjg committed rG1c7084fe5612: vfs: clean up parse_mount_dev_present (authored by mjg).
vfs: clean up parse_mount_dev_present
Sat, Sep 17, 12:43 PM
mjg committed rG298c7c516521: zfs: don't access nameidata unless namei succeeded (authored by mjg).
zfs: don't access nameidata unless namei succeeded
Sat, Sep 17, 12:27 PM
mjg closed D36542: vfs: always retain path buffer after lookup.

5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179

Sat, Sep 17, 12:19 PM
mjg committed rGb77bdfdb67c2: vfs: fix non-INVARIANTS build after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 (authored by mjg).
vfs: fix non-INVARIANTS build after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179
Sat, Sep 17, 10:46 AM
mjg committed rGaede6a9670aa: vfs: fixup parse_mount_dev_present after… (authored by mjg).
vfs: fixup parse_mount_dev_present after…
Sat, Sep 17, 10:37 AM
mjg committed rG5b5b7e2ca2fa: vfs: always retain path buffer after lookup (authored by mjg).
vfs: always retain path buffer after lookup
Sat, Sep 17, 9:12 AM
mjg committed rG3df3d88cc5e2: vfs: move cn_nameptr assignment out of namei_getpath (authored by mjg).
vfs: move cn_nameptr assignment out of namei_getpath
Sat, Sep 17, 9:12 AM
mjg committed rG41a0a99f855f: vfs: slightly reorganize error handling in chroot (authored by mjg).
vfs: slightly reorganize error handling in chroot
Sat, Sep 17, 9:12 AM

Fri, Sep 16

mjg committed rG50176b0296f0: locks: whack a failed experiment in form of restrict_starvation (authored by mjg).
locks: whack a failed experiment in form of restrict_starvation
Fri, Sep 16, 5:30 PM
mjg added a comment to D36608: Please go to https://github.com/lsof-org/lsof/pull/184 and help there! Much appreciated!.
In D36608#831108, @kib wrote:

Usually we do the reverse and introduce _WANT_SOMETHING when userspace really wants some kernel stuff, otherwise hidden under _KERNEL.

FREEBSD_LSOF_H is definitely a gross.

Fri, Sep 16, 4:54 PM
mjg added a comment to D36608: Please go to https://github.com/lsof-org/lsof/pull/184 and help there! Much appreciated!.

NO_KERNEL_PAUSE is definitely the better option here. there are other header abusers (most notably zfs) and a generic way to damage control this is needed.

Fri, Sep 16, 4:46 PM

Thu, Sep 15

mjg updated the summary of D36510: ipsec: plug use-after-free of SAH.
Thu, Sep 15, 11:23 PM
mjg added a reviewer for D36510: ipsec: plug use-after-free of SAH: network.
Thu, Sep 15, 11:22 PM

Wed, Sep 14

mjg committed rG145a50dcda7a: Unbreak the build after b3ee318b79d54a59190d35b8c76a63a8fb81b903 (authored by mjg).
Unbreak the build after b3ee318b79d54a59190d35b8c76a63a8fb81b903
Wed, Sep 14, 11:52 PM
mjg committed rGd04c7f10d43b: vfs: make delmntque return with the interlock held (authored by mjg).
vfs: make delmntque return with the interlock held
Wed, Sep 14, 11:33 PM
mjg committed rG43fbd0e7a74b: lockf: elide vnode interlock in the common case in lf_purgelocks (authored by mjg).
lockf: elide vnode interlock in the common case in lf_purgelocks
Wed, Sep 14, 11:33 PM
mjg committed rGad5e1f9c2d78: devfs: stop taking the interlock in devfs_delete (authored by mjg).
devfs: stop taking the interlock in devfs_delete
Wed, Sep 14, 10:53 PM
mjg committed rGa1c555f48ba4: devfs: retire the unused DEVFS_DEL_VNLOCKED flag (authored by mjg).
devfs: retire the unused DEVFS_DEL_VNLOCKED flag
Wed, Sep 14, 10:53 PM
mjg accepted D36584: ip_output: always increase "cantfrag" stat if ip_fragment() fails.
Wed, Sep 14, 10:51 PM
mjg added inline comments to D36500: Fix O(n^2) behavior in sysctl.
Wed, Sep 14, 6:40 PM
mjg updated subscribers of D36542: vfs: always retain path buffer after lookup.

@rmacklem can you give this patch a spin please concerning nfs parts? works for me(tm)

Wed, Sep 14, 6:28 PM
mjg committed rGa755fb921ed2: vfs: retire the V_MNTREF flag (authored by mjg).
vfs: retire the V_MNTREF flag
Wed, Sep 14, 6:18 PM
mjg committed rG61a1d5dde216: vfs: stop using the V_MNTREF flag (authored by mjg).
vfs: stop using the V_MNTREF flag
Wed, Sep 14, 6:18 PM
mjg closed D36521: vfs: retire V_MNTREF.
Wed, Sep 14, 6:17 PM
mjg committed rGdb5f85a4b268: ufs: stop using the V_MNTREF flag (authored by mjg).
ufs: stop using the V_MNTREF flag
Wed, Sep 14, 6:17 PM
mjg committed rG04f095a49165: ufs: try to elide the interlock in ufs_itimes (authored by mjg).
ufs: try to elide the interlock in ufs_itimes
Wed, Sep 14, 6:13 PM
mjg closed D36522: ufs: try to elide the interlock in ufs_itimes.
Wed, Sep 14, 6:13 PM
mjg committed rGbe931de6c99f: ufs: always call ufs_itimes on close (authored by mjg).
ufs: always call ufs_itimes on close
Wed, Sep 14, 6:13 PM

Tue, Sep 13

mjg committed rGf7dc4a71da2c: vfs: plug spurious error checks in namei (authored by mjg).
vfs: plug spurious error checks in namei
Tue, Sep 13, 11:19 PM

Mon, Sep 12

mjg added a comment to D36500: Fix O(n^2) behavior in sysctl.

So I just ran pkg build. pkg-static spams sysctlbyname security.jail.jailed for example.

Mon, Sep 12, 11:55 PM
mjg added inline comments to D36500: Fix O(n^2) behavior in sysctl.
Mon, Sep 12, 11:35 PM
mjg updated the diff for D36522: ufs: try to elide the interlock in ufs_itimes.
Mon, Sep 12, 11:29 PM
mjg requested review of D36542: vfs: always retain path buffer after lookup.
Mon, Sep 12, 11:10 PM
mjg committed rGb4137c9ed158: vfs: make NDVALIDATE private to vfs_lookup.c (authored by mjg).
vfs: make NDVALIDATE private to vfs_lookup.c
Mon, Sep 12, 10:53 PM
mjg added inline comments to D36500: Fix O(n^2) behavior in sysctl.
Mon, Sep 12, 9:23 PM
mjg added a comment to D36540: Pass stack size, limit, and (no)overcommit flag to image using auxv, to avoid syscalls on jemalloc and libthr startup..

it can also shave the issetugid call, see https://reviews.freebsd.org/D23779

Mon, Sep 12, 9:15 PM
mjg added a comment to D36500: Fix O(n^2) behavior in sysctl.

I don't know about vm.overcommit -- there were talks about replacing malloc and new one perhaps will not even look at this.

Mon, Sep 12, 1:12 PM

Sat, Sep 10

mjg added a comment to D36522: ufs: try to elide the interlock in ufs_itimes.

I'm guessing the original code was avoiding the call, expecting for it to happen in ufs_inactive later. This retains the ultimately racy nature, except avoids the interlock.

Sat, Sep 10, 10:12 PM
mjg requested review of D36522: ufs: try to elide the interlock in ufs_itimes.
Sat, Sep 10, 9:33 PM
mjg updated the summary of D36521: vfs: retire V_MNTREF.
Sat, Sep 10, 8:52 PM
mjg requested review of D36521: vfs: retire V_MNTREF.
Sat, Sep 10, 8:50 PM
mjg committed rG1760a6950a70: Fixup build after recent getsock changes (authored by mjg).
Fixup build after recent getsock changes
Sat, Sep 10, 8:41 PM
mjg committed rG3be2225fc845: Remove fflag argument from getsock_cap (authored by mjg).
Remove fflag argument from getsock_cap
Sat, Sep 10, 7:52 PM
mjg committed rG3212ad15abde: Add getsock (authored by mjg).
Add getsock
Sat, Sep 10, 7:52 PM
mjg committed rGa2ad70923f59: Add branch prediction hints to getsock_cap (authored by mjg).
Add branch prediction hints to getsock_cap
Sat, Sep 10, 7:52 PM
mjg added a comment to D36496: netgraph(4): Don't process NGQF_MESG items in NET_EPOCH context..

just get it in please so that i can close the ticket internally :) thanks

Sat, Sep 10, 1:09 PM

Fri, Sep 9

mjg added a comment to D36500: Fix O(n^2) behavior in sysctl.

I don't think arrays are a practical solution, because the key range is too large. oid_number can be as high as INT_MAX, so the arrays would have to be dynamically allocated, and they may have to resize on insertion.

It can't, I noted this is already clamped:

/*
 * The starting number for dynamically-assigned entries.  WARNING!
 * ALL static sysctl entries should have numbers LESS than this!
 */
#define CTL_AUTO_START  0x100

So worst case for static entries is not particularly bad. Resizing on insertion may still be sensible to do, but it wont affect lookups.

That's only for static entries, which are uncommon. Dynamically entries are much more common, and can range anywhere from 0x100 to 0x7fffffff.

Fri, Sep 9, 10:43 PM
mjg added a comment to D36500: Fix O(n^2) behavior in sysctl.
In D36500#829077, @mjg wrote:

What's up with lock conversion to sx and exclusive-locking everywhere? If you really need to hold the lock the entire time, you can use rms locks instead. If read-locking for normal use can't be achieved, then I'm afraid this patch is a non-starter -- there is *tons* of parallel sysctl calls in fork+exec heavy workloads (most notably for malloc), so this would degrade performance. (EDIT: now that i wrote it, splay rebalances itself also on lookup, so that's a non-starter here)

That's right, splay trees rebalancer on lookup. And that's pretty handy for sysctl, because typical use will lookup the exact same oid several times in a row. For example, sysctl security.jail.jailed searches for the OID 4 times, and each of those searches performs a SPLAY_FIND at three different levels of the heirarchy. All of that repetition is why I chose splay trees over RB trees.

That said I remember I proposed RB trees originally and I don't mind other trees if that's the general route, but looking at the problem some more I think this is a pessimal approach.

There are 2 kinds of lookups to take care of: name2oid which finds the right numerical set and regular lookup when you are provided all numbers.

For the latter one can employ arrays instead. You would have 2 arrays at each level, one for static and one for dynamic entries. Statically defined oids would index directly into one array. Dynamic oids would start with -1, -2, -3 etc. and would be indexed into their own array after you abs() - 1 their id, so -1 would index at 0, -2 would index at 1 etc. Consequently this is O(1) lookup at each level as opposed O(log n) with no generate cases to worry about.

I don't think arrays are a practical solution, because the key range is too large. oid_number can be as high as INT_MAX, so the arrays would have to be dynamically allocated, and they may have to resize on insertion.

Fri, Sep 9, 8:37 PM
mjg requested review of D36510: ipsec: plug use-after-free of SAH.
Fri, Sep 9, 8:11 PM
mjg committed rGe5d08f472977: pf: remove pf_bcmp_state_key (authored by mjg).
pf: remove pf_bcmp_state_key
Fri, Sep 9, 5:26 PM
mjg committed rG6b94546a7ea2: pf: partially depessimize pf_match_translation (authored by mjg).
pf: partially depessimize pf_match_translation
Fri, Sep 9, 5:04 PM
mjg added a comment to D36500: Fix O(n^2) behavior in sysctl.

I looked around, OpenBSD has everything hardcoded, like so:

Fri, Sep 9, 2:26 PM
mjg added inline comments to D36500: Fix O(n^2) behavior in sysctl.
Fri, Sep 9, 2:07 PM
mjg added a comment to D36500: Fix O(n^2) behavior in sysctl.

What's up with lock conversion to sx and exclusive-locking everywhere? If you really need to hold the lock the entire time, you can use rms locks instead. If read-locking for normal use can't be achieved, then I'm afraid this patch is a non-starter -- there is *tons* of parallel sysctl calls in fork+exec heavy workloads (most notably for malloc), so this would degrade performance.

Fri, Sep 9, 2:04 PM

Thu, Sep 8

mjg committed rGdda6376b04fc: net: employ newly added pfil_mbuf_{in,out} where approriate (authored by mjg).
net: employ newly added pfil_mbuf_{in,out} where approriate
Thu, Sep 8, 4:22 PM
mjg committed rG0b70e3e78b02: net: add pfil_mbuf_{in,out} (authored by mjg).
net: add pfil_mbuf_{in,out}
Thu, Sep 8, 4:22 PM
mjg closed D36454: net: add pfil_run_hooks_{in,out}.
Thu, Sep 8, 4:22 PM
mjg committed rGcb6abe87cf1c: hwpmc: purge EOL release compatibility (authored by ehem_freebsd_m5p.com).
hwpmc: purge EOL release compatibility
Thu, Sep 8, 4:18 PM
mjg added a comment to D36454: net: add pfil_run_hooks_{in,out}.

There is a very valid use case, and I'm talking about my work, where we compile firewall in statically and then unhook it from ip_input/ip_output and enable only on the driver level. Given that interface level filtering is the way packet filtering is done on most router equipment (Cisco, Juniper, etc.), I would say even argue that the default hooks are a legacy, rather than a standard.

Thu, Sep 8, 4:09 PM
mjg updated the diff for D36454: net: add pfil_run_hooks_{in,out}.
  • rename
Thu, Sep 8, 4:08 PM
mjg added a comment to D36454: net: add pfil_run_hooks_{in,out}.

I don't mind the names.

Thu, Sep 8, 3:33 PM

Wed, Sep 7

mjg updated the summary of D36485: ipsec key_havesp changes.
Wed, Sep 7, 8:43 PM
mjg updated the diff for D36485: ipsec key_havesp changes.
Wed, Sep 7, 8:41 PM
mjg requested review of D36485: ipsec key_havesp changes.
Wed, Sep 7, 8:41 PM
mjg committed rG3e0b4868869d: vfs: flip a condition around in kern_statat (authored by mjg).
vfs: flip a condition around in kern_statat
Wed, Sep 7, 8:12 PM
mjg added a comment to D36454: net: add pfil_run_hooks_{in,out}.

you mean a dedicated set for memptr users which also avoids branching on in/out? i'm on it :)

Wed, Sep 7, 7:22 PM
mjg updated the diff for D36454: net: add pfil_run_hooks_{in,out}.
  • add back consumer conversion
Wed, Sep 7, 6:43 PM
mjg updated the diff for D36454: net: add pfil_run_hooks_{in,out}.
Wed, Sep 7, 6:38 PM
mjg updated the diff for D36454: net: add pfil_run_hooks_{in,out}.
Wed, Sep 7, 6:34 PM
mjg added a comment to D35560: sys: purge EOL release compatibility.

Send me a diff to whack the hwpmc stuff and I'll commit that bit. Commit message needs to start with "hwpmc: "

Wed, Sep 7, 2:36 PM
mjg added a comment to D36454: net: add pfil_run_hooks_{in,out}.

All the places I patched to use the new routines are used a lot and don't pass the flag in question, yet with the current code they pay for its existence -- once by checking for it to begin with, and later by checking for realloc.

Wed, Sep 7, 11:49 AM
mjg closed D36452: net: retire PFIL_FWD.
Wed, Sep 7, 10:05 AM
mjg committed rG14c9a2dbfbb0: net: retire PFIL_FWD (authored by mjg).
net: retire PFIL_FWD
Wed, Sep 7, 10:05 AM
mjg committed rG223a73a1c4d1: net: remove stale altq_input reference (authored by mjg).
net: remove stale altq_input reference
Wed, Sep 7, 10:04 AM