Page MenuHomeFreeBSD

alc (Alan Cox)
User

Projects

User Details

User Since
Dec 14 2014, 5:52 AM (491 w, 10 h)

Recent Activity

Yesterday

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

Fri, May 3

alc updated the test plan for D44983: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3].
Fri, May 3, 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.

Fri, May 3, 5:41 PM

Mon, Apr 29

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

Sun, Apr 28

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

Eliminate unnecessary parentheses.

Sun, Apr 28, 8:19 PM

Sat, Apr 27

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

Wed, Apr 24

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.

Wed, Apr 24, 6:10 AM

Wed, Apr 17

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.

Wed, Apr 17, 8:15 AM

Tue, Apr 16

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.

Tue, Apr 16, 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

Jan 27 2024

alc accepted D40400: vm_phys: Factor out some calls to vm_freelist_add().
Jan 27 2024, 8:36 PM
alc accepted D40399: vm_page: Let vm_page_init_page() take a pool parameter.
Jan 27 2024, 8:21 PM
alc added a comment to D40403: vm_page: Implement lazy page initialization.

What happens if we increase VM_NFREEORDER, e.g., 262144, to support 1 GB allocations? I think that you might might want to have a different constant to cap the lazy init chunk size.

Jan 27 2024, 8:19 PM
alc added inline comments to D40403: vm_page: Implement lazy page initialization.
Jan 27 2024, 7:51 PM

Jan 18 2024

alc accepted D43503: arm64: Add a VM_FREELIST_DMA32 freelist.
Jan 18 2024, 11:08 PM

Jan 11 2024

alc accepted D43358: vnode_pager_generic_putpages(): correctly handle clean block at EOF.
Jan 11 2024, 6:44 AM

Dec 21 2023

alc accepted D43140: vmm iommu: stop transiently wiring already wired pages.
Dec 21 2023, 6:54 PM

Dec 1 2023

alc accepted D42853: Allow sbrk on arm64 and riscv.
Dec 1 2023, 8:27 AM

Nov 30 2023

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

Eliot and I have addressed most of Mark's comments.

Nov 30 2023, 7:37 PM
alc added inline comments to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 30 2023, 7:35 PM

Nov 29 2023

alc accepted D42788: vm: Add kva_alloc_aligned.
Nov 29 2023, 5:35 PM
alc accepted D42831: vm: Use vmem_xalloc in kva_alloc.
Nov 29 2023, 5:09 PM

Nov 28 2023

alc added inline comments to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 28 2023, 8:44 PM
alc added inline comments to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 28 2023, 8:43 PM
alc added inline comments to D42732: arm64: Use the DMAP region in pmap_mapbios.
Nov 28 2023, 6:49 PM
alc added inline comments to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 28 2023, 6:03 PM
alc added inline comments to D42788: vm: Add kva_alloc_aligned.
Nov 28 2023, 5:18 PM

Nov 27 2023

alc added a comment to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
In D42737#975855, @alc wrote:

Thanks, Mark. We'd like to see the output from sysctl vm.pmap.kernel_maps too.

That's what I provided in the links - did you mean something else?

In both cases, this was the output of sysctl vm.pmap.kernel_maps immediately after booting. I can grab it from after the buildworld too, if that's useful.

Nov 27 2023, 5:38 PM
alc added a comment to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
In D42737#975855, @alc wrote:

Thanks, Mark. We'd like to see the output from sysctl vm.pmap.kernel_maps too.

Nov 27 2023, 5:22 PM
alc added a comment to D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].

Thanks, Mark. We'd like to see the output from sysctl vm.pmap.kernel_maps too.

Nov 27 2023, 5:19 PM
alc updated subscribers of D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 27 2023, 5:12 PM

Nov 25 2023

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

There was one function where PTE_TO_PHYS/PHYS_TO_PTE conversion hadn't been done yet.

Nov 25 2023, 6:07 PM

Nov 24 2023

alc updated the summary of D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 24 2023, 9:09 PM
alc updated the diff for D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].

pmap_kremove_device: fix 2MB mapping removal; optimize TLB invalidation

Nov 24 2023, 8:54 PM

Nov 23 2023

alc updated the summary of D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 23 2023, 8:52 PM
alc updated the test plan for D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 23 2023, 7:42 PM
alc updated the test plan for D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 23 2023, 7:41 PM
alc requested review of D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Nov 23 2023, 6:32 PM

Nov 13 2023

alc accepted D42509: vm_phys: fix freelist_contig.
Nov 13 2023, 5:39 PM

Nov 12 2023

alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 12 2023, 9:56 PM
alc added inline comments to D38852: vm: improve kstack_object pindex calculation scheme to avoid pindex holes.
Nov 12 2023, 9:24 PM
alc added inline comments to D38852: vm: improve kstack_object pindex calculation scheme to avoid pindex holes.
Nov 12 2023, 9:14 AM

Nov 11 2023

alc added a comment to D42509: vm_phys: fix freelist_contig.

I'm convinced that it's correct. That said, even the person who reported the problem is probably not exercising this while loop:

while (!vm_addr_ok(VM_PAGE_TO_PHYS(m_ret),
    size, alignment, boundary) &&
    ...
Nov 11 2023, 10:24 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 11 2023, 10:09 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 11 2023, 10:07 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 11 2023, 10:03 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 11 2023, 10:01 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 11 2023, 9:39 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 11 2023, 8:02 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 11 2023, 7:52 PM
alc added a comment to D42509: vm_phys: fix freelist_contig.

We may want to issue this as an errata for 14.0, so can we have a minimal version without style changes?

Nov 11 2023, 7:15 PM

Nov 10 2023

alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 10 2023, 6:42 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 10 2023, 6:32 PM
alc added inline comments to D42509: vm_phys: fix freelist_contig.
Nov 10 2023, 6:29 PM