Page MenuHomeFreeBSD
Feed Advanced Search

Tue, Apr 9

alc committed rG841cf52595b6: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2] (authored by alc).
arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2]
Tue, Apr 9, 4:22 PM
alc closed D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Tue, Apr 9, 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?

Tue, Apr 9, 4:02 PM

Mon, Apr 8

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.

Mon, Apr 8, 7:13 PM

Sun, Apr 7

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

Update to reflect committed change.

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

Sat, Apr 6

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

Eliminate an unnecessary variable.

Sat, Apr 6, 10:47 PM
alc accepted D44646: swap_pager: Unbusy readahead pages after an I/O error.
Sat, Apr 6, 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.

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

Add KASSERT to vm_reserv_is_populated().

Sat, Apr 6, 4:59 AM

Wed, Apr 3

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.

Wed, Apr 3, 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()
Wed, Apr 3, 4:20 PM
alc added inline comments to D44575: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 2].
Wed, Apr 3, 5:02 AM

Mon, Apr 1

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

Sat, Mar 30

alc committed rGe0388a906ca7: arm64: enable superpage mappings by pmap_mapdev{,_attr}() (authored by alc).
arm64: enable superpage mappings by pmap_mapdev{,_attr}()
Sat, Mar 30, 8:55 PM
alc closed D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Sat, Mar 30, 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]
Sat, Mar 30, 6:47 PM

Sun, Mar 24

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

Reopen after reservation size fix was committed.

Sun, Mar 24, 6:11 PM
alc reopened D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Sun, Mar 24, 6:09 PM
alc closed D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Sun, Mar 24, 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
Sun, Mar 24, 5:48 PM

Mon, Mar 18

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

Correct VM_NFREEORDER for 16KB page size.

Mon, Mar 18, 5:13 PM
alc updated subscribers of D42737: arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1].
Mon, Mar 18, 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

Nov 9 2023

alc added a comment to D42512: vm_page_advise(9): expand from vm_page_dontneed(9).

I'm kind of skeptical that this man page is useful at all. vm_page_advise() really exists just to implement the madvise() system call, it's not going to be called externally. And, it's just a piece of that system call. vm_map_madvise(), vm_object_madvise(), pmap_advise() also implement parts of madvise(); why are they not documented as well? IMHO it's somewhat more useful to focus on improving madvise.3, which is user-facing and describes the user-visible effect for each type of advice. With a high-level understanding of what MADV_FREE etc. are supposed to do, it becomes easier to understand why vm_page_advise() does what it does.

Nov 9 2023, 9:31 PM
alc added inline comments to D42513: vm_page_advise(): reformat conditional statements.
Nov 9 2023, 7:08 AM
alc accepted D42517: vm_fault: revert D19670.
Nov 9 2023, 2:31 AM

Nov 2 2023

alc accepted D42446: amd64: Remove PMAP_INLINE.
Nov 2 2023, 4:41 PM

Oct 26 2023

alc added a comment to D40772: Tentative physical memory compaction.

Note this became more important since we have ASLR turned on for 64 bit processes since 13.2-RELEASE. And ASLR adds great deal of fragmentation. It leads to significant performance degradation over long run due to superpages becoming unusable due memory fragmentation.

Oct 26 2023, 7:30 PM

Oct 20 2023

alc accepted D42287: riscv: Retire PMAP_INLINE.
Oct 20 2023, 4:09 PM

Oct 18 2023

alc accepted D42274: pmap: Prefer consistent naming for loader tunable.
Oct 18 2023, 4:01 PM

Oct 17 2023

alc added inline comments to D42233: amd64: Add sysctl knobs for loader tunables.
Oct 17 2023, 5:09 PM
alc added inline comments to D42080: arm64: Set the Guarded Page flag in the kernel.
Oct 17 2023, 5:05 PM

Oct 10 2023

alc added a comment to D35709: fix pmcstat .
In D35709#961602, @alc wrote:

Before I forget, we also ran into a second bug: Specifying ",usr" on a counter no longer worked. Essentially, the ",usr" was just being ignored. We haven't checked if any of the recent changes might have addressed this issue.

I am not surprised, and I doubt anyone has fixed it (though it should be straightforward). This is on an AMD machine?

Oct 10 2023, 7:29 PM
alc added a comment to D35709: fix pmcstat .
In D35709#950482, @alc wrote:
In D35709#950480, @alc wrote:

One of my graduate students found that this change had a seriously bad side effect. Specifically, on a Ryzen processor, instead of being able to collect data from 6 counters simultaneously, he could only configure 3 counters. So, we backed out this change locally.

Thanks Alan, I have found the same, and I have a fix for it. The problem is that we now allocate the requested event twice on CPU 0, thus reducing the total number of available counters by two.

I will put the fix up for review within the next week, and make sure it is present in 14.0.

I forgot to follow up here. The fix (c362fe939f6f) has landed in stable/14, and I will request to merge it to releng/14.0 on Thursday.

That's good to hear!

Out of curiosity, is anyone working on PEBS/IBS support?

Sort of. @br has developed a new "Hardware Tracing" framework, separate from pmc/hwpmc, which aims to enable these types of profiling features. The work currently focuses on supporting Coresight/ARM SPE, rather than x86, but this paves the way so that adding classes for e.g. Intel PT will be the "easy part".

See D40466, D40477, D40728.

Oct 10 2023, 5:39 PM

Oct 8 2023

alc added a comment to D41635: i386 pmap: allocate leaf page table page for wired userspace superpages.

@markj Are you overloaded? Should I commit this?

Oct 8 2023, 7:47 PM
alc accepted D42080: arm64: Set the Guarded Page flag in the kernel.

For the most part, these changes are setting the guarded bit on mappings that are already no-execute. Is there a reason to do that? To be clear, I don't object to doing so. It just seems redundant.

Oct 8 2023, 7:43 PM
alc added a comment to D42080: arm64: Set the Guarded Page flag in the kernel.

Can you set this flag on intermediate translation table entries as well?

Oct 8 2023, 7:19 PM

Sep 30 2023

alc added a comment to D39845: VM anonymous clustering: be more persistent.
In D39845#952794, @kib wrote:
In D39845#952791, @alc wrote:

@kib, it has never been clear to me why we update anon_loc. Is it meant solely as an optimization to free address space finding, or is it done for some other reason?

I probably never ever considered not updating anon_loc. When I asked myself why, the most obvious reason is the failure mode: if looking for free space after anon_loc failing, we need to move the clustering point somewhere, otherwise it would fail on the first try forever.

Sep 30 2023, 5:47 PM

Sep 28 2023

alc accepted D41635: i386 pmap: allocate leaf page table page for wired userspace superpages.
Sep 28 2023, 7:02 AM
alc added a comment to D41635: i386 pmap: allocate leaf page table page for wired userspace superpages.
In D41635#954945, @alc wrote:

@markj I think that you should apply 34eeabff5a8636155bb02985c5928c1844fd3178 to i386 and riscv. Otherwise, I suspect that there will be assertion failures in places like pmap_remove_pde():

KASSERT(vm_page_all_valid(mpte),
    ("pmap_remove_pde: pte page not promoted"));

I was away for a few weeks and am only now getting caught up. I can spend some time on the riscv pmap if you aren't already working on it.

Sep 28 2023, 6:59 AM

Sep 26 2023

alc added a comment to D41635: i386 pmap: allocate leaf page table page for wired userspace superpages.

I've just committed 902ed64fecbe which eliminates the need for zeroing the PTP and the possibility of an assertion failure if you pass the same arguments to pmap_insert_pt_page() as you did on amd64. pmap_insert_pt_page() now has the needed extra argument.

Sep 26 2023, 6:21 PM
alc closed D41944: i386 pmap: catch up with amd64 superpage improvements.
Sep 26 2023, 5:42 PM
alc committed rG902ed64fecbe: i386 pmap: Adapt recent amd64/arm64 superpage improvements (authored by alc).
i386 pmap: Adapt recent amd64/arm64 superpage improvements
Sep 26 2023, 5:42 PM

Sep 25 2023

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

From Ryzen 3000 onward, AMD's MMU automatically promotes four contiguous 16KB-aligned virtual pages mapping four contiguous 16KB-aligned physical pages, creating a single 16KB TLB entry. With this change, the physical contiguity and alignment is guaranteed. Could we dynamically adjust the guard size at runtime to achieve the required virtual alignment?

Sep 25 2023, 6:38 AM