Page MenuHomeFreeBSD

markj (Mark Johnston)
User

Projects

User Details

User Since
Mar 12 2014, 1:00 AM (310 w, 6 d)

Recent Activity

Today

markj accepted D22901: [iicbus] Add support for ACPI-based children enumeration.
Tue, Feb 25, 2:45 AM
markj added inline comments to D23824: A pair of UMA optimizations to improve cache behavior..
Tue, Feb 25, 1:52 AM

Sun, Feb 23

markj accepted D23810: drop swp_pager_getswapspace parameter.
Sun, Feb 23, 9:49 PM
markj closed D23763: Allow swap_pager_putpages() to allocate one block at a time..
Sun, Feb 23, 6:00 PM
markj committed rS358261: Allow swap_pager_putpages() to allocate one block at a time..
Allow swap_pager_putpages() to allocate one block at a time.
Sun, Feb 23, 6:00 PM
markj added a comment to D23763: Allow swap_pager_putpages() to allocate one block at a time..

This change makes the second argument to swp_pager_getswapspace redundant. A future change might as well eliminate it.

Sun, Feb 23, 5:56 PM
markj updated the diff for D23723: Add a blocking counter KPI, blockcount(9)..
  • No need for DEVOLATILE.
  • pip_add may be called with a value of 0, handle this.
Sun, Feb 23, 5:38 PM

Sat, Feb 22

markj accepted D23798: sys/kern: quiet -Wwrite-strings.
Sat, Feb 22, 10:11 PM
markj accepted D23796: sys/vm: quiet -Wwrite-strings.
Sat, Feb 22, 10:09 PM
markj accepted D23797: vfs: quiet -Wwrite-strings.
Sat, Feb 22, 10:05 PM
markj committed rS358249: Constify uma_zcache_create() and uma_zsecond_create()'s "name" argument..
Constify uma_zcache_create() and uma_zsecond_create()'s "name" argument.
Sat, Feb 22, 5:44 PM

Fri, Feb 21

markj added inline comments to D23782: Add label checks when DW_AT_range and DW_AT_low_pc cannot be used.
Fri, Feb 21, 4:48 PM
markj added a comment to D23782: Add label checks when DW_AT_range and DW_AT_low_pc cannot be used.

It looks like it's just the allocated memory for labels, as most of the memory used by check_labels are given back (freed) according to the picture.
Kernel probably has a lot of assembly files with a lot of labels. Is memory usage a problem?

Fri, Feb 21, 4:21 PM
markj updated the diff for D23723: Add a blocking counter KPI, blockcount(9)..

Rebase, add copyrights.

Fri, Feb 21, 4:01 PM
markj abandoned D2271: defer inactive processing (re: D1677).
Fri, Feb 21, 3:54 PM
markj commandeered D2271: defer inactive processing (re: D1677).
Fri, Feb 21, 3:54 PM
markj added a comment to D2271: defer inactive processing (re: D1677).

This is superseded by https://reviews.freebsd.org/rS332974 .

Fri, Feb 21, 3:54 PM
markj 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.

Fri, Feb 21, 2:59 PM
markj accepted D23626: Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (M of N).

I am fairly confident that none of the sysctls in this review require Giant, if only because Giant is not referenced at all in ath(9) or the ieee80211 stack. It is just a matter of going through and convincing oneself in each case. I did a few more, but if you prefer to just commit and revisit later, it is ok with me.

Fri, Feb 21, 2:53 PM
markj committed rS358222: MFC r357862 (by emaste):.
MFC r357862 (by emaste):
Fri, Feb 21, 2:46 PM
markj committed rS358221: Revert r350515 for now..
Revert r350515 for now.
Fri, Feb 21, 2:40 PM

Thu, Feb 20

markj added inline comments to D23626: Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (M of N).
Thu, Feb 20, 2:05 PM
markj added inline comments to D23723: Add a blocking counter KPI, blockcount(9)..
Thu, Feb 20, 1:36 PM

Wed, Feb 19

markj accepted D23765: clamp kernel dump compression level when using gzip.
Wed, Feb 19, 10:54 PM
markj accepted D23760: Fix IPv6 checksums when exthdrs are present..
Wed, Feb 19, 9:01 PM
markj updated the summary of D23763: Allow swap_pager_putpages() to allocate one block at a time..
Wed, Feb 19, 8:43 PM
markj created D23763: Allow swap_pager_putpages() to allocate one block at a time..
Wed, Feb 19, 8:41 PM
markj added inline comments to D23449: Add unlocked variants of grab functions..
Wed, Feb 19, 7:05 PM
markj accepted D23446: Add a lockless lookup mechanism that uses a SMR zone..
Wed, Feb 19, 6:57 PM
markj accepted D23740: ip6_output: improve extension header handling.
Wed, Feb 19, 5:58 PM
markj accepted D23673: Use per-domain locks for the zone layer..
Wed, Feb 19, 5:37 PM
markj added inline comments to D23626: Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (M of N).
Wed, Feb 19, 4:26 PM
markj committed rS358122: MFC r357576:.
MFC r357576:
Wed, Feb 19, 4:18 PM
markj committed rS358121: MFC r357576:.
MFC r357576:
Wed, Feb 19, 4:18 PM
markj updated the diff for D23723: Add a blocking counter KPI, blockcount(9)..
  • Use func consistently in KASSERT()s.
  • Rename "count" to "bc".
Wed, Feb 19, 4:08 PM
markj added a comment to D23723: Add a blocking counter KPI, blockcount(9)..

I am still open to suggestions regarding the name.

Wed, Feb 19, 3:36 PM
markj added reviewers for D23723: Add a blocking counter KPI, blockcount(9).: mjg, jeff, kib.
Wed, Feb 19, 3:36 PM
markj updated the diff for D23723: Add a blocking counter KPI, blockcount(9)..

Fix the !INVARIANTS build.

Wed, Feb 19, 3:36 PM
markj added a comment to D23723: Add a blocking counter KPI, blockcount(9)..
In D23723#521189, @mjg wrote:

Thank you for working on this.
I think this is a good opportunity to introduce struct blockcount to prevent accidental misuse. Then BLOCKCOUNT_COUNT can be blockcount_read or so. Some casts will probably also drop.

Wed, Feb 19, 3:36 PM
markj updated the diff for D23723: Add a blocking counter KPI, blockcount(9)..
  • Move blockcount code into distinct headers. I did not add a copyright statement yet.
  • Apply mjg's notes: handle Giant, fix assertion message.
  • Add a blockcount_t to make the counter opaque. Add blockcount_read() to allow the counter value to be read (masking off the waiter flag).
  • Add some barriers: blockcount_release() issues a release fence and _blockcount_wait() issues an acquire fence before returning.
  • Avoid re-reading the counter value more than necessary when checking whether to go to sleep.
Wed, Feb 19, 3:35 PM

Tue, Feb 18

markj added inline comments to D23462: Deferred write seq advancement.
Tue, Feb 18, 4:09 PM
markj added inline comments to D23740: ip6_output: improve extension header handling.
Tue, Feb 18, 2:28 PM
markj accepted D23711: Type validating smr protected pointer accessors..
Tue, Feb 18, 1:43 AM

Mon, Feb 17

markj accepted D23729: powerpc: unconditionally mark SLB zones UMA_ZONE_CONTIG.

The issue in general is whether it is okay for objects from these zones to be backed by physical memory that is not contiguous, which UMA multipage slabs may cause unless the UMA_ZONE_CONTIG flag is specified or uma_zone_set_allocf is used.
Note that this is not a revert of the change in r357548, this is adding the UMA_ZONE_CONTIG flag unconditionally.

Mon, Feb 17, 9:07 PM
markj committed rS358032: MFC r357450, r357462:.
MFC r357450, r357462:
Mon, Feb 17, 6:40 PM
markj committed rS358031: MFC r350515:.
MFC r350515:
Mon, Feb 17, 6:40 PM
markj added a comment to D23729: powerpc: unconditionally mark SLB zones UMA_ZONE_CONTIG.

Can you explain why this makes a difference, at least for slbt_zone? I think I am missing something.

Mon, Feb 17, 6:36 PM
markj added inline comments to D23673: Use per-domain locks for the zone layer..
Mon, Feb 17, 4:27 PM
markj committed rS358026: Remove swblk_t..
Remove swblk_t.
Mon, Feb 17, 3:11 PM
markj closed D23666: Remove swblk_t..
Mon, Feb 17, 3:11 PM
markj committed rS358025: Fix a swap block allocation race..
Fix a swap block allocation race.
Mon, Feb 17, 3:10 PM
markj closed D23665: Fix a swap block allocation race..
Mon, Feb 17, 3:10 PM
markj committed rS358024: Fix object locking races in swapoff(2)..
Fix object locking races in swapoff(2).
Mon, Feb 17, 3:10 PM
markj closed D23664: Fix object locking races in swapoff..
Mon, Feb 17, 3:10 PM
markj added inline comments to D23712: Correct use of UMA_ZONE_VM.
Mon, Feb 17, 2:42 PM
markj accepted D23712: Correct use of UMA_ZONE_VM.
Mon, Feb 17, 2:22 PM
markj added a comment to D23723: Add a blocking counter KPI, blockcount(9)..
In D23723#521117, @jeff wrote:

I don't mind this in principal but I would rather it was a new api entirely. We need relatively few of the refcount features. Just acquiren/releasen/wait. So I'd rather have it named as some kind of barrier or semaphore.

Mon, Feb 17, 2:26 AM
markj added a comment to D23469: fd: convert f_count to long.
In D23469#520752, @mjg wrote:

Some observations/personal feelings:

  • I'm not sure about the int/long refcount split. How does a developer know which to choose? There is at least one situation (struct file) where we certainly must handle 32-bit overflows, but in general it seems hard to know whether it's necessary. What about ucred? We would have to look at all kernel resources which may hold a ucred reference. That said, I like the simplification that comes from not having to check fhold()'s return value, but I'm still not 100% convinced that it is really necessary to try and sanely handle the case (i.e., return EBADF) where a file ref count has overflowed _if_ we're also detecting saturation and we wrap all f_count operations using refcount(9).

ucred is an excellent example of something which if in legitimate danger of not fitting in an int should use long. crhold() is called all over with no error checking and trying to add it is probably a futile effort. At the same time the struct comes with void *cr_pspare2[2]; meaning we can convert int to long without growing it, all while not creating unfreeable objects due to saturation limit being reached.

Mon, Feb 17, 1:26 AM
markj updated the diff for D23723: Add a blocking counter KPI, blockcount(9)..

Remove unintended diff.

Mon, Feb 17, 1:20 AM
markj created D23723: Add a blocking counter KPI, blockcount(9)..
Mon, Feb 17, 1:19 AM

Sun, Feb 16

markj accepted D23699: Fix build..

Something is still needed to fix a "make -C sys/modules/dtrace/systrace". I will commit the patch I suggested earlier if no one has any objections.

Sun, Feb 16, 2:54 AM
markj added a comment to D23480: Add new refcount API.

So what about my comments in D23469? Why do we have to have 3 refcount APIs?

Sun, Feb 16, 2:47 AM
markj accepted D23709: refcount: add missing release fence to refcount_release_if_gt.
Sun, Feb 16, 2:45 AM

Sat, Feb 15

markj added a comment to D23699: Fix build..
In D23699#520446, @kib wrote:

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:36 PM
markj accepted D23694: sysv_sem: fix the loop that compacts sem array on semaphores removal..
Sat, Feb 15, 10:31 PM
markj 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. Right now a standalone build of systrace.ko will fail because it doesn't define KDTRACE_HOOKS. With this patch it fails also, but for a different reason (SYSDIR is not defined in standalone builds).

Sat, Feb 15, 10:08 PM

Fri, Feb 14

markj updated the diff for D23664: Fix object locking races in swapoff..

Avoid busying valid pages, to avoid a deadlock involving
kernel stack pages.

Fri, Feb 14, 8:53 PM
markj accepted D23676: Add pthread_peekjoin_np(3)..
In D23676#520058, @kib wrote:

I see that Linux has a non-blocking join, pthread_tryjoin_np(). Is that not sufficient for your purposes?

The tryjoin() method joins, while peekjoin() keeps the thread unjoined, which allows to peek or join again. The use for me was to see whether the thread exited, without disrupting an existing code that joined.
Our timedjoin() can be used as tryjoin() by providing the time in past. I can implement tryjoin() as well, if it is considered worth having explicit interface, to be source-compatible with Linux.

Fri, Feb 14, 7:29 PM
markj added inline comments to D23506: Don't drop xbusy on kmem pages..
Fri, Feb 14, 5:56 PM
markj added a comment to D23676: Add pthread_peekjoin_np(3)..

I see that Linux has a non-blocking join, pthread_tryjoin_np(). Is that not sufficient for your purposes?

Fri, Feb 14, 5:46 PM
markj updated the diff for D23664: Fix object locking races in swapoff..

If the object is dead, wait for pending paging operations
to complete before returning.

Fri, Feb 14, 5:11 PM
markj abandoned D23663: Fix object locking races in swapoff..
Fri, Feb 14, 5:10 PM
markj added a comment to D23666: Remove swblk_t..
In D23666#519989, @kib wrote:

This change probably can't be MFCed.

Why ?

We could fix the problem in a different way, by changing swaponsomething() to allocate block ranges more carefully. The current algorithm just scans the list of existing swap devices and places the new one after the end of the last one. I think I will just commit the change and make the block range allocation smarter in a follow-up change.

swdevt is kernel-internal, more it is sys/vm internal. The external userspace view on it is provided by struct xswdev.

Fri, Feb 14, 4:37 PM
markj added a comment to D23666: Remove swblk_t..

This change probably can't be MFCed. We could fix the problem in a different way, by changing swaponsomething() to allocate block ranges more carefully. The current algorithm just scans the list of existing swap devices and places the new one after the end of the last one. I think I will just commit the change and make the block range allocation smarter in a follow-up change.

Fri, Feb 14, 4:04 PM
markj added inline comments to D23664: Fix object locking races in swapoff..
Fri, Feb 14, 3:53 PM
markj added inline comments to D23665: Fix a swap block allocation race..
Fri, Feb 14, 3:35 PM
markj added inline comments to D23672: Restructure zalloc for better code generation..
Fri, Feb 14, 3:25 PM

Thu, Feb 13

markj committed rS357893: Fix handling of WAITFAIL in vm_page_grab() and vm_page_grab_pages()..
Fix handling of WAITFAIL in vm_page_grab() and vm_page_grab_pages().
Thu, Feb 13, 11:18 PM
markj committed rS357892: Update the zone-global count of cached items in bucket_cache_reclaim()..
Update the zone-global count of cached items in bucket_cache_reclaim().
Thu, Feb 13, 11:15 PM
markj accepted D23672: Restructure zalloc for better code generation..
Thu, Feb 13, 9:30 PM
markj updated the diff for D23665: Fix a swap block allocation race..

Wake up sleepers when incrementing nsw_wcount_async.

Thu, Feb 13, 6:28 PM
markj added reviewers for D23666: Remove swblk_t.: alc, dougm, kib, jeff.
Thu, Feb 13, 5:26 PM
markj added reviewers for D23665: Fix a swap block allocation race.: alc, dougm, kib, jeff.
Thu, Feb 13, 5:26 PM
markj added reviewers for D23664: Fix object locking races in swapoff.: alc, dougm, kib, jeff.
Thu, Feb 13, 5:26 PM
markj created D23666: Remove swblk_t..
Thu, Feb 13, 5:24 PM
markj created D23665: Fix a swap block allocation race..
Thu, Feb 13, 5:24 PM
markj created D23664: Fix object locking races in swapoff..
Thu, Feb 13, 5:23 PM
markj created D23663: Fix object locking races in swapoff..
Thu, Feb 13, 5:22 PM

Wed, Feb 12

markj added inline comments to D23549: zgrep: Allow multiple options '-e'.
Wed, Feb 12, 11:08 PM
markj accepted D23501: Added ranges to Addr2line.
Wed, Feb 12, 9:24 PM
markj committed rS357825: MFC r357575:.
MFC r357575:
Wed, Feb 12, 3:51 PM
markj committed rS357824: MFC r357573:.
MFC r357573:
Wed, Feb 12, 3:46 PM

Tue, Feb 11

markj committed rS357777: libmemstat: Catch up with r357776..
libmemstat: Catch up with r357776.
Tue, Feb 11, 9:21 PM
markj added inline comments to D23449: Add unlocked variants of grab functions..
Tue, Feb 11, 8:45 PM
markj added a comment to D23091: netgraph/ng_nat: Prevent crash by malformated packets.

I have no objection to this. I think the checks are cheap enough that they won't hurt, and after spending some time reading libalias I believe they are sufficient.

Tue, Feb 11, 8:12 PM
markj accepted D23091: netgraph/ng_nat: Prevent crash by malformated packets.
Tue, Feb 11, 8:08 PM
markj closed D23532: Optimize keg_drain()..
Tue, Feb 11, 8:06 PM
markj committed rS357776: Reduce lock hold time in keg_drain()..
Reduce lock hold time in keg_drain().
Tue, Feb 11, 8:06 PM
markj added inline comments to D23446: Add a lockless lookup mechanism that uses a SMR zone..
Tue, Feb 11, 7:33 PM
markj added a comment to D23501: Added ranges to Addr2line.
  1. I tested the performance with curlopc and with resetting cu to first cu every time(v2), below is the results:


r=reverse
seq=sequential
rand=random
v1 is addr2line with curlopc
v2 is the version that resets cu to first cu for every translation
10000seq stores 10k sorted addr of first 20k kernel addr.
1000rand stores 1k rand addr in all of kernel addr
r10000seq is 10000seq reversed
Which version should I keep?

Tue, Feb 11, 7:19 PM