Page MenuHomeFreeBSD
Feed Advanced Search

Yesterday

alc requested review of D45502: arm64 pmap: Defer bti lookup.
Wed, Jun 5, 6:56 PM
alc accepted D45486: vm_page_insert: use pctrie combined insert/lookup.

In principle, this is fine, but in practice. we mostly call vm_page_insert_after(). So, the impact will be limited. That said, I'm still excited by where I think this is headed.

Wed, Jun 5, 6:23 PM
alc committed rG60847070f908: vm: Eliminate a redundant call to vm_reserv_break_all() (authored by alc).
vm: Eliminate a redundant call to vm_reserv_break_all()
Wed, Jun 5, 5:43 PM
alc closed D45495: vm: Eliminate a redundant call to vm_reserv_break_all().
Wed, Jun 5, 5:42 PM
alc requested review of D45495: vm: Eliminate a redundant call to vm_reserv_break_all().
Wed, Jun 5, 7:00 AM
alc closed D45431: pmap: Skip some superpage promotion attempts that will fail.

For some reason, this revision did not automatically close upon commit.

Wed, Jun 5, 5:31 AM
alc committed rG41dfea24eec2: arm64 pmap: Enable L3C promotions by pmap_enter_quick() (authored by alc).
arm64 pmap: Enable L3C promotions by pmap_enter_quick()
Wed, Jun 5, 4:28 AM
alc closed D45445: arm64 pmap: Enable L3C promotions by pmap_enter_quick().
Wed, Jun 5, 4:28 AM

Tue, Jun 4

alc added inline comments to D45483: x86: simplify ceil(log2(x)) function.
Tue, Jun 4, 5:53 PM
alc accepted D45483: x86: simplify ceil(log2(x)) function.
Tue, Jun 4, 5:52 PM
alc added inline comments to D45445: arm64 pmap: Enable L3C promotions by pmap_enter_quick().
Tue, Jun 4, 5:48 PM
alc accepted D45331: vm_phys: use ilog2(x) instead of fls(x)-1.

Please coordinate this with @markj given his lazy init change.

Tue, Jun 4, 5:03 PM
alc committed rGf1d73aacdc47: pmap: Skip some superpage promotion attempts that will fail (authored by alc).
pmap: Skip some superpage promotion attempts that will fail
Tue, Jun 4, 5:39 AM

Mon, Jun 3

alc added a comment to D45431: pmap: Skip some superpage promotion attempts that will fail.

@jhibbits I would encourage you to apply https://reviews.freebsd.org/D40478 and a few other superpage related follow on commits from amd64 to mmu_radix,c. This change would then apply to mmu_radix.c.

Mon, Jun 3, 7:09 PM
alc accepted D45235: libkern: add ilog2 helpers.
Mon, Jun 3, 4:35 PM
alc accepted D40403: vm_page: Implement lazy page initialization.

@alc @dougm Do you have any more comments on this patch?

Mon, Jun 3, 6:45 AM

Sun, Jun 2

alc added a comment to D40403: vm_page: Implement lazy page initialization.

@alc @dougm Do you have any more comments on this patch?

Sun, Jun 2, 11:56 PM
alc added a comment to D45431: pmap: Skip some superpage promotion attempts that will fail.

From a (very) quick check, it looks like the same change in amd64 should be made to mmu_radix for powerpc.

Sun, Jun 2, 11:28 PM
alc updated the diff for D45431: pmap: Skip some superpage promotion attempts that will fail.

Set VM_PROT_NO_PROMOTE in vm_fault_prefault().

Sun, Jun 2, 8:02 PM
alc added inline comments to D45431: pmap: Skip some superpage promotion attempts that will fail.
Sun, Jun 2, 7:49 PM

Sat, Jun 1

alc updated the diff for D45445: arm64 pmap: Enable L3C promotions by pmap_enter_quick().

Revise comment.

Sat, Jun 1, 9:51 PM
alc requested review of D45445: arm64 pmap: Enable L3C promotions by pmap_enter_quick().
Sat, Jun 1, 9:33 PM

Fri, May 31

alc requested review of D45431: pmap: Skip some superpage promotion attempts that will fail.
Fri, May 31, 10:51 PM
alc committed rG3dc2a8848986: arm64 pmap: Convert panic()s to KASSERT()s (authored by alc).
arm64 pmap: Convert panic()s to KASSERT()s
Fri, May 31, 9:55 PM
alc closed D45424: arm64 pmap: Convert panic()s to KASSERT()s.
Fri, May 31, 9:55 PM
alc updated the summary of D45424: arm64 pmap: Convert panic()s to KASSERT()s.
Fri, May 31, 5:37 PM
alc requested review of D45424: arm64 pmap: Convert panic()s to KASSERT()s.
Fri, May 31, 5:36 PM

Fri, May 24

alc accepted D45330: subr_pctrie: use ilog2(x) instead of fls(x)-1.
Fri, May 24, 5:59 AM

Thu, May 23

alc committed rG9fc5e3fb39ca: arm64: set ATTR_CONTIGUOUS on the DMAP's L2 blocks (authored by alc).
arm64: set ATTR_CONTIGUOUS on the DMAP's L2 blocks
Thu, May 23, 3:11 AM
alc closed D45224: arm64: Set ATTR_CONTIGUOUS on DMAP's L2 blocks.
Thu, May 23, 3:11 AM

Wed, May 22

alc accepted D45288: vm_pageout_scan_inactive: take a lock break.
Wed, May 22, 6:57 PM
alc accepted D45288: vm_pageout_scan_inactive: take a lock break.
Wed, May 22, 6:38 PM
alc added a comment to D45224: arm64: Set ATTR_CONTIGUOUS on DMAP's L2 blocks.

@markj Do you have any other comments on this change?

Wed, May 22, 5:43 PM
alc accepted D45244: Stop treating size 0 as unknown size in vnode_create_vobject()..
Wed, May 22, 5:12 AM
alc added inline comments to D45235: libkern: add ilog2 helpers.
Wed, May 22, 4:22 AM

Mon, May 20

alc accepted D45191: amd64: use INVLPGB for kernel pmap invalidations.
Mon, May 20, 6:14 PM
alc added inline comments to D45224: arm64: Set ATTR_CONTIGUOUS on DMAP's L2 blocks.
Mon, May 20, 6:10 PM

Sun, May 19

alc committed rG4f77144279f2: arm64 pmap: eliminate a redundant variable (authored by alc).
arm64 pmap: eliminate a redundant variable
Sun, May 19, 7:44 PM

Fri, May 17

alc added a comment to D45224: arm64: Set ATTR_CONTIGUOUS on DMAP's L2 blocks.
In D45224#1031599, @alc wrote:

@gallatin @markj Could you please test this patch? I've also tested this patch on EC2 VMs with both 4K and 16K base pages, but their device mappings don't trigger any L1 or L2C demotions in the direct map.

I tried this on my ampere altra test box. Our (netflix) tree is roughly 1 month old (based at 63b0165cdcbb178df63ac57dcd39c29cf77f346e).
I cherry-picked a803837cec6e17e04849d59afac7b6431c70cb93 c1ebd76c3f283b10afe6b64f29fe68c4d1be3f8c b5a1f0406b9d6bba28e57377dcfc8b83bce987ad and then applied the patch. Its possible that I missed something critical elsewhere.. I just looked at the history of sys/arm64/arm64/pmap.c and cherry-picked what seemed to have come in after our latest upstream sync.

In the new kernel, I see:

# sysctl vm.pmap
vm.pmap.l3c.promotions: 4284
vm.pmap.l3c.p_failures: 156
vm.pmap.l3c.mappings: 348
vm.pmap.l3c.demotions: 795
vm.pmap.l2.promotions: 276
vm.pmap.l2.p_failures: 0
vm.pmap.l2.mappings: 0
vm.pmap.l2.demotions: 120
vm.pmap.l2c.demotions: 0
vm.pmap.l1.demotions: 0
vm.pmap.superpages_enabled: 1
vm.pmap.vmid.epoch: 0
vm.pmap.vmid.next: 2
vm.pmap.vmid.bits: 16
vm.pmap.asid.epoch: 0
vm.pmap.asid.next: 12760
vm.pmap.asid.bits: 16
# sysctl vm.pmap.kernel_maps | tail -15
0xffff001d14fb8000-0xffff001d17b0c000 rw--sg     WB 0 0 0 21 85
0xffff007fffe24000-0xffff007fffffc000 rw--sg     WT 0 0 0 0 118
0xffff007fffffc000-0xffff008000000000 rw--sg    DEV 0 0 0 0 1

Direct map:
0xffffa00088300000-0xffffa00088400000 rw--sg     WB 0 0 0 0 64
0xffffa00090000000-0xffffa000ebf28000 rw--sg     WB 0 0 45 15 74
0xffffa000ec308000-0xffffa000ec30c000 rw--sg     WB 0 0 0 0 1
0xffffa000ec310000-0xffffa000ec530000 rw--sg     WB 0 0 0 0 136
0xffffa000ec540000-0xffffa000ee550000 rw--sg     WB 0 0 0 15 132
0xffffa000eeab8000-0xffffa000ffc8c000 rw--sg     WB 0 0 7 24 117
0xffffa000ffc90000-0xffffa00100000000 rw--sg     WB 0 0 0 1 92
0xffffa80000000000-0xffffa80080000000 rw--sg     WB 0 2 0 0 0
0xffffa80100000000-0xffffa82000000000 rw--sg     WB 0 124 0 0 0
Fri, May 17, 11:50 PM
alc added inline comments to D45191: amd64: use INVLPGB for kernel pmap invalidations.
Fri, May 17, 7:50 PM

Thu, May 16

alc added a comment to D45224: arm64: Set ATTR_CONTIGUOUS on DMAP's L2 blocks.

@gallatin @markj Could you please test this patch? I've also tested this patch on EC2 VMs with both 4K and 16K base pages, but their device mappings don't trigger any L1 or L2C demotions in the direct map.

Thu, May 16, 6:32 PM
alc requested review of D45224: arm64: Set ATTR_CONTIGUOUS on DMAP's L2 blocks.
Thu, May 16, 5:58 PM

Sun, May 12

alc committed rG94b09d388b81: arm64: map kernel using large pages when page size is 16K (authored by alc).
arm64: map kernel using large pages when page size is 16K
Sun, May 12, 11:49 PM
alc closed D45162: arm64: Set ATTR_CONTIGUOUS on the kernel code and data sections when the page size is 16K.
Sun, May 12, 11:49 PM

Sat, May 11

alc updated the diff for D45162: arm64: Set ATTR_CONTIGUOUS on the kernel code and data sections when the page size is 16K.

Add requirements comment.

Sat, May 11, 6:42 PM
alc requested review of D45162: arm64: Set ATTR_CONTIGUOUS on the kernel code and data sections when the page size is 16K.
Sat, May 11, 7:47 AM
alc accepted D44699: arm64: add page-to-pte convenience macros.
Sat, May 11, 5:57 AM
alc added inline comments to D44699: arm64: add page-to-pte convenience macros.
Sat, May 11, 5:27 AM

Thu, May 9

alc added inline comments to D45113: cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once.
Thu, May 9, 5:40 AM

Wed, May 8

alc added inline comments to D45113: cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once.
Wed, May 8, 6:51 PM
alc accepted D45113: cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once.
Wed, May 8, 6:47 PM
alc added inline comments to D45113: cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once.
Wed, May 8, 6:31 PM
alc added inline comments to D45113: cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once.
Wed, May 8, 5:25 PM
alc accepted D45113: cdev_pager_allocate(): ensure that the cdev_pager_ops ctr is called only once.
Wed, May 8, 5:09 PM
alc added a comment to D45042: arm64: Make jemalloc safe for 16k / 4k interoperability.
In D45042#1028058, @alc wrote:

Do we have any idea what the downsides of the change are? If we make the default 64KB, then I'd expect memory usage to increase; do we have any idea what the looks like? It'd be nice to, for example, compare memory usage on a newly booted system with and without this change.

I had the same question. It will clearly impact a lot of page granularity counters, at the very least causing some confusion for people who look at those counters, e.g.,

./include/jemalloc/internal/arena_inlines_b.h-          arena_stats_add_u64(tsdn, &arena->stats,
./include/jemalloc/internal/arena_inlines_b.h-              &arena->decay_dirty.stats->nmadvise, 1);
./include/jemalloc/internal/arena_inlines_b.h-          arena_stats_add_u64(tsdn, &arena->stats,
./include/jemalloc/internal/arena_inlines_b.h:              &arena->decay_dirty.stats->purged, extent_size >> LG_PAGE);
./include/jemalloc/internal/arena_inlines_b.h-          arena_stats_sub_zu(tsdn, &arena->stats, &arena->stats.mapped,
./include/jemalloc/internal/arena_inlines_b.h-              extent_size);

However, it's not so obvious what the effect on the memory footprint will be. For example, the madvise(MADV_FREE) calls will have coarser granularity. If we set the page size to 64KB, then one in-use 4KB page within a 64KB region will be enough to block the application of madvise(MADV_FREE) to the other 15 pages. Quantifying the impact that this coarsening has will be hard.

This does, however, seem to be the intended workaround: https://github.com/jemalloc/jemalloc/issues/467

Buried in that issue is the claim that Firefox's builtin derivative version of jemalloc eliminated the statically compiled page size.

What direction does the kernel grow the vm map? They apparently reverted support for lg page size values larger than the runtime page size because it caused fragmentation when the kernel grows the vm map downwards..

Wed, May 8, 4:33 AM
alc committed rGa803837cec6e: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3] (authored by alc).
arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3]
Wed, May 8, 2:37 AM
alc closed D44983: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3].
Wed, May 8, 2:37 AM

May 3 2024

alc updated the test plan for D44983: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3].
May 3 2024, 7:08 PM
alc added a comment to D45042: arm64: Make jemalloc safe for 16k / 4k interoperability.

Do we have any idea what the downsides of the change are? If we make the default 64KB, then I'd expect memory usage to increase; do we have any idea what the looks like? It'd be nice to, for example, compare memory usage on a newly booted system with and without this change.

May 3 2024, 5:41 PM

Apr 29 2024

alc added inline comments to D44983: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3].
Apr 29 2024, 9:41 AM

Apr 28 2024

alc updated the diff for D44983: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3].

Eliminate unnecessary parentheses.

Apr 28 2024, 8:19 PM

Apr 27 2024

alc requested review of D44983: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3].
Apr 27 2024, 6:54 PM

Apr 24 2024

alc accepted D44677: arm64: Check DMAP address is valid in PHYS_IN_DMAP.

We could look at that as a follow up, however I'm unlikely to have time to make such a change and have it ready and well tested for 14.1 given it's due to be branched in just over 2 weeks.

Apr 24 2024, 6:10 AM

Apr 17 2024

alc added a comment to D44677: arm64: Check DMAP address is valid in PHYS_IN_DMAP.
In D44677#1021479, @alc wrote:

Why not deal with this issue in pmap_mapdev{,_attr}()? Specifically, if the given physical address falls within the DMAP region, don't call kva_alloc{,_aligned}(); instead, map the physical address at its corresponding DMAP virtual address. This is not all that different from amd64, where the DMAP (with appropriate attr settings) is used to access a good bit of device memory.

Apr 17 2024, 8:15 AM

Apr 16 2024

alc added a comment to D44677: arm64: Check DMAP address is valid in PHYS_IN_DMAP.

Why not deal with this issue in pmap_mapdev{,_attr}()? Specifically, if the given physical address falls within the DMAP region, don't call kva_alloc{,_aligned}(); instead, map the physical address at its corresponding DMAP virtual address. This is not all that different from amd64, where the DMAP (with appropriate attr settings) is used to access a good bit of device memory.

Apr 16 2024, 5:12 PM

Apr 9 2024

alc committed rG841cf52595b6: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2] (authored by alc).
arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2]
Apr 9 2024, 4:22 PM
alc closed D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 9 2024, 4:22 PM
alc accepted D38852: vm: improve kstack_object pindex calculation scheme to avoid pindex holes.
In D38852#1018877, @kib wrote:
In D38852#1018757, @alc wrote:

Just so we're all on the same page, I want to point out the following: While this patch achieves contiguity, it doesn't guarantee 2 MB alignment. Let 'F' represent a fully populated 2 MB reservation, 'E', represent a partially populated reservation, where the population begins in the middle and goes to the end, and 'B' is the complement of 'E', where the population begins at the start and ends in the middle. Typically, the physical memory allocation for one chunk of stacks on amd64 looks like 'EFFFB'. While it would be nice to achieve 'FFFF', this patch is already a great improvement over the current state of affairs.

But is it possible at all (perhaps a better word is it worth at all) since we do have the guard pages?

Apr 9 2024, 4:02 PM

Apr 8 2024

alc added a comment to D38852: vm: improve kstack_object pindex calculation scheme to avoid pindex holes.

Just so we're all on the same page, I want to point out the following: While this patch achieves contiguity, it doesn't guarantee 2 MB alignment. Let 'F' represent a fully populated 2 MB reservation, 'E', represent a partially populated reservation, where the population begins in the middle and goes to the end, and 'B' is the complement of 'E', where the population begins at the start and ends in the middle. Typically, the physical memory allocation for one chunk of stacks on amd64 looks like 'EFFFB'. While it would be nice to achieve 'FFFF', this patch is already a great improvement over the current state of affairs.

Apr 8 2024, 7:13 PM

Apr 7 2024

alc updated the diff for D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].

Update to reflect committed change.

Apr 7 2024, 5:40 PM
alc reopened D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 7 2024, 5:33 PM

Apr 6 2024

alc added inline comments to D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 6 2024, 10:58 PM
alc added inline comments to D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 6 2024, 10:53 PM
alc updated the diff for D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].

Eliminate an unnecessary variable.

Apr 6 2024, 10:47 PM
alc accepted D44646: swap_pager: Unbusy readahead pages after an I/O error.
Apr 6 2024, 7:10 PM
alc added a comment to D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].

I do, however, want to point out that a good portion of the reduction in buildworld time is coming from performing a smaller number of icache flushes when creating executable mappings.

Have you looked at teaching the vm code to manage the icache? We currently call cpu_icache_sync_range more than we need to, e.g. if mapping the same physical address as twice we will call it twice.

We discussed this a while ago. To minimize icache syncing, I believe we need to identify all of the places where a kernel might modify a user-mapped page via the direct map. I think that hooking uiomove_* would get us most of the way there, but it's hard to be confident that that's sufficient.

Apr 6 2024, 5:50 AM
alc updated subscribers of D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 6 2024, 5:21 AM
alc added inline comments to D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 6 2024, 5:19 AM
alc updated the diff for D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].

Add KASSERT to vm_reserv_is_populated().

Apr 6 2024, 4:59 AM

Apr 3 2024

alc updated the diff for D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].

Rename pmap_enter_object()'s helpers to not have 64k or 2m in their names.

Apr 3 2024, 6:52 PM
alc committed rG22c098843127: arm64: correctly handle a failed BTI check in pmap_enter_l2() (authored by alc).
arm64: correctly handle a failed BTI check in pmap_enter_l2()
Apr 3 2024, 4:20 PM
alc added inline comments to D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 3 2024, 5:02 AM

Apr 1 2024

alc updated the test plan for D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 1 2024, 9:49 PM
alc added inline comments to D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 1 2024, 5:39 AM
alc updated the summary of D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 1 2024, 5:28 AM
alc requested review of D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Apr 1 2024, 5:26 AM

Mar 30 2024

alc committed rGe0388a906ca7: arm64: enable superpage mappings by pmap_mapdev{,_attr}() (authored by alc).
arm64: enable superpage mappings by pmap_mapdev{,_attr}()
Mar 30 2024, 8:55 PM
alc closed D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Mar 30 2024, 6:47 PM
alc committed rGfd6cb031f577: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1] (authored by ehs3_rice.edu).
arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]
Mar 30 2024, 6:47 PM

Mar 24 2024

alc updated the diff for D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].

Reopen after reservation size fix was committed.

Mar 24 2024, 6:11 PM
alc reopened D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Mar 24 2024, 6:09 PM
alc closed D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Mar 24 2024, 5:48 PM
alc committed rG9fabf97682ce: arm64: fix free queue and reservation configuration for 16KB pages (authored by ehs3_rice.edu).
arm64: fix free queue and reservation configuration for 16KB pages
Mar 24 2024, 5:48 PM

Mar 18 2024

alc updated the diff for D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].

Correct VM_NFREEORDER for 16KB page size.

Mar 18 2024, 5:13 PM
alc updated subscribers of D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Mar 18 2024, 4:58 PM

Mar 13 2024

alc updated the diff for D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].

Teach sysctl vm.pmap.kernel_maps to correctly count ATTR_CONTIGUOUS superpages when the base page size is 16KB.

Mar 13 2024, 7:07 AM

Mar 12 2024

alc updated the diff for D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].

Add (void) casts. Refill a comment whose lines were too long.

Mar 12 2024, 7:08 PM
alc added inline comments to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Mar 12 2024, 5:18 PM

Mar 10 2024

alc added a comment to D38852: vm: improve kstack_object pindex calculation scheme to avoid pindex holes.

I'd really like to see this committed.

Mar 10 2024, 7:51 AM

Jan 28 2024

alc accepted D43636: vm_phys: Add a vm_phys_seg_paddr_to_vm_page() helper.

Despite the long name, it's still two characters shorter than the original code. :-)

Jan 28 2024, 6:09 PM