Page MenuHomeFreeBSD
Feed Advanced Search

Jun 23 2023

alc accepted D40721: vm_radix: eliminate reload in _remove.
Jun 23 2023, 11:03 PM
alc added a comment to D39845: VM anonymous clustering: be more persistent.
In D39845#926656, @kib wrote:

Yes, I believe this is only one change from the three present in my branch. I do not have objections.

Jun 23 2023, 4:26 PM
alc added inline comments to D40721: vm_radix: eliminate reload in _remove.
Jun 23 2023, 4:21 PM

Jun 22 2023

alc added a comment to D39845: VM anonymous clustering: be more persistent.

After mulling this over for a while, I'm going to suggest a different approach to address the clustering problem. Essentially, I'm pushing down the point at which we convert a hint of zero to a minimum address into vm_map_find_min().

diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index f5863a9b9939..4fd0aff24b75 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -1981,14 +1981,14 @@ SYSCTL_INT(_vm, OID_AUTO, cluster_anon, CTLFLAG_RW,
     "Cluster anonymous mappings: 0 = no, 1 = yes if no hint, 2 = always");
Jun 22 2023, 5:29 AM

Jun 21 2023

alc added a comment to D39845: VM anonymous clustering: be more persistent.

The following aspect of the previous version of the patch has an unintended consequence:

else if (!clustering_anon_loc_const() &&
    !vm_map_lookup_entry(map, curr_min_addr, &entry))
        curr_min_addr = entry->end;

With cluster_anon set to its default value of 1, the first time that a clustered allocation is attempted (line 7186) the above code effectively lowers anon_loc to the end of the previous map entry, far from the address originally generated for anon_loc.

7195 map: 0xfffffe018592ec30, hint: 0x33c594562000, len: 0x400000, (find: 0, align: 0x200000), addr: 0x33cbdf200000
7194 map: 0xfffffe018592ec30, anon_loc: 0x33cbdf200000, addr: 0x33cbdf200000
7193 map: 0xfffffe018592ec30, hint: 0x33c594562000, len: 0x200000, (find: 0, align: 0x1000), addr: 0x33cbdf000000
7192 map: 0xfffffe018592ec30, anon_loc: 0x33cbdf000000, addr: 0x33cbdf000000
7191 map: 0xfffffe018592ec30, hint: 0x33c594562000, len: 0x200000, (find: 0, align: 0x200000), addr: 0x33cbdee00000
7190 map: 0xfffffe018592ec30, anon_loc: 0x33cbded54000, addr: 0x33cbdee00000
7189 map: 0xfffffe018592ec30, hint: 0x33c594562000, len: 0x3f0000, (find: 2, align: 0), addr: 0x33c5b69b1000
7188 map: 0xfffffe018592ec30, hint: 0x33c594562000, len: 0x17000, (find: 2, align: 0), addr: 0x33c5b6009000
7187 map: 0xfffffe018592ec30, hint: 0x33c594562000, len: 0x21000, (find: 2, align: 0), addr: 0x33cbded33000
7186 map: 0xfffffe018592ec30, anon_loc: 0x49b32b000000, addr: 0x33cbded33000
7185 map: 0xfffffe018592ec30, hint: 0x33c594562000, len: 0x20000000, (find: 1, align: 0), addr: 0x33c595237000
7184 map: 0xfffffe018592ec30, interp addr: 0x33cbded13000
7183 map: 0xfffffe018592ec30, anon_loc: 0x49b32b000000
7182 map: 0xfffffe018592ec30, dyn addr: 0x33bd94558000
7181 map: 0xfffffe018592ec30, maxv: 0x7ffffffff000

Consequently, the initial alignment of anon_loc is lost.

Jun 21 2023, 4:32 PM
alc created P581 clang compiling sqlite3.
Jun 21 2023, 5:58 AM
alc accepted D40586: vm_radix: use bool, drop function.
Jun 21 2023, 4:40 AM

Jun 20 2023

alc accepted D40585: radix_trie: eliminate iteration in keydiff.
Jun 20 2023, 5:54 AM
alc added inline comments to D40585: radix_trie: eliminate iteration in keydiff.
Jun 20 2023, 5:02 AM

Jun 19 2023

alc added a comment to D39845: VM anonymous clustering: be more persistent.

I did some testing with and without the previous version of the patch. I simply did a "buildworld" as the workload.

Jun 19 2023, 6:59 PM
alc added a comment to D40402: vm_phys: Simplify vm_phys_scan_contig() a bit.

I believe that this particular change has been subsumed by 9e8174289236.

Jun 19 2023, 6:14 PM
alc added inline comments to D40585: radix_trie: eliminate iteration in keydiff.
Jun 19 2023, 6:11 PM

Jun 18 2023

alc created P579 clang aslr.
Jun 18 2023, 8:53 PM

Jun 16 2023

alc added inline comments to D39845: VM anonymous clustering: be more persistent.
Jun 16 2023, 5:10 PM
alc committed rG58d427172157: vm_phys: Fix typo in 9e8174289236 (authored by alc).
vm_phys: Fix typo in 9e8174289236
Jun 16 2023, 8:16 AM
alc accepted D40058: vm: reduce work of reclamation search.
Jun 16 2023, 6:35 AM

Jun 15 2023

alc added inline comments to D39845: VM anonymous clustering: be more persistent.
Jun 15 2023, 7:34 AM

Jun 14 2023

alc added inline comments to D39845: VM anonymous clustering: be more persistent.
Jun 14 2023, 11:27 PM
alc added a comment to D39845: VM anonymous clustering: be more persistent.
In D39845#922683, @kib wrote:

Misalignment is perhaps a different issue. We can select aligned top for stack, and aligned anon_loc each time we have to choose one.

Jun 14 2023, 8:00 PM

Jun 13 2023

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

Another option would be to pick a random virtual address for anon_loc at execve() time, and never update it. So, all virtual address allocations would be performed using an address-ordered, first-fit policy, just like we do when ASLR is turned off.

Are you proposing yet another mode for cluster_anon, or you mean to replace the mode 2 'always cluster' with this variant?

Jun 13 2023, 5:25 PM

Jun 12 2023

alc committed rG34eeabff5a86: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion (authored by alc).
amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion
Jun 12 2023, 6:42 PM
alc closed D40478: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion.
Jun 12 2023, 6:42 PM
alc added inline comments to D40478: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion.
Jun 12 2023, 4:35 PM
alc added a comment to D40058: vm: reduce work of reclamation search.

The arm64 code for the binary search is

dd4: 90000008      adrp    x8, 0x0 <vm_phys_paddr_to_vm_page+0x8>
dd8: 2a1f03e9      mov     w9, wzr
ddc: b940010a      ldr     w10, [x8]
de0: 90000008      adrp    x8, 0x0 <vm_phys_paddr_to_vm_page+0x14>
de4: 91000108      add     x8, x8, #0
de8: 3400018a      cbz     w10, 0xe18 <vm_phys_paddr_to_vm_page+0x4c>
dec: 5280070b      mov     w11, #56
df0: 2a0a03ec      mov     w12, w10
df4: 4b09018d      sub     w13, w12, w9
df8: 0b4d052d      add     w13, w9, w13, lsr #1
dfc: 9bab21ae      umaddl  x14, w13, w11, x8
e00: f94005ce      ldr     x14, [x14, #8]
e04: eb0001df      cmp     x14, x0
e08: 1a8d8529      csinc   w9, w9, w13, hi
e0c: 1a8c81ac      csel    w12, w13, w12, hi
e10: 6b09019f      cmp     w12, w9
e14: 54ffff01      b.ne    0xdf4 <vm_phys_paddr_to_vm_page+0x28>
Jun 12 2023, 2:29 PM
alc added inline comments to D33906: Drop duplicate ascending range enqueing.
Jun 12 2023, 2:28 PM

Jun 11 2023

alc added inline comments to D40478: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion.
Jun 11 2023, 10:17 PM
alc updated the diff for D40478: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion.

Address Mark's comments.

Jun 11 2023, 10:16 PM

Jun 10 2023

alc added inline comments to D40478: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion.
Jun 10 2023, 6:54 AM

Jun 9 2023

alc updated the summary of D40478: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion.
Jun 9 2023, 6:09 PM
alc requested review of D40478: amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion.
Jun 9 2023, 6:04 PM
alc added inline comments to D40058: vm: reduce work of reclamation search.
Jun 9 2023, 5:31 PM

Jun 8 2023

alc added a comment to D39845: VM anonymous clustering: be more persistent.

Another option would be to pick a random virtual address for anon_loc at execve() time, and never update it. So, all virtual address allocations would be performed using an address-ordered, first-fit policy, just like we do when ASLR is turned off.

Jun 8 2023, 5:44 PM

Jun 5 2023

alc added inline comments to D40058: vm: reduce work of reclamation search.
Jun 5 2023, 7:50 PM

Jun 2 2023

alc added inline comments to D40403: vm_page: Implement lazy page initialization.
Jun 2 2023, 10:52 PM
alc accepted D40401: vm_phys: Change the return type of vm_phys_unfree_page() to bool.
Jun 2 2023, 10:08 PM

May 29 2023

alc committed rG3e7e2bb2467e: arm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation (authored by alc).
arm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation
May 29 2023, 4:24 PM
alc closed D40306: arm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation.
May 29 2023, 4:24 PM

May 28 2023

alc updated the summary of D40306: arm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation.
May 28 2023, 5:58 AM
alc requested review of D40306: arm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation.
May 28 2023, 5:27 AM

May 27 2023

alc committed rG5d1ee799de65: arm64 pmap: Eliminate an unused global variable (authored by alc).
arm64 pmap: Eliminate an unused global variable
May 27 2023, 7:12 AM

May 9 2023

alc accepted D39827: arm64 pmap: introduce PTE_TO_PHYS macro.
May 9 2023, 4:58 PM

May 6 2023

alc added inline comments to D39827: arm64 pmap: introduce PTE_TO_PHYS macro.
May 6 2023, 7:46 PM

May 5 2023

alc accepted D39739: vm: implement vm_page_reclaim_contig_domain_ext() to reclaim multiple contiguous regions at once.
May 5 2023, 11:18 PM

May 1 2023

alc added inline comments to D39890: amd64: store pcids pmap data in pcpu zone.
May 1 2023, 4:35 PM

Apr 30 2023

alc added inline comments to D39739: vm: implement vm_page_reclaim_contig_domain_ext() to reclaim multiple contiguous regions at once.
Apr 30 2023, 7:59 PM
alc added inline comments to D39739: vm: implement vm_page_reclaim_contig_domain_ext() to reclaim multiple contiguous regions at once.
Apr 30 2023, 7:50 PM

Apr 27 2023

alc added a comment to D39827: arm64 pmap: introduce PTE_TO_PHYS macro.

The riscv pmap names this macro PTE_TO_PHYS, and I will argue for using the same name both here and there. Whether that happens by renaming it here, or there, I don't care. I just don't want them to use different names for doing similar things.

Apr 27 2023, 6:30 PM

Apr 24 2023

alc added a comment to D39739: vm: implement vm_page_reclaim_contig_domain_ext() to reclaim multiple contiguous regions at once.

I am in the middle of making up a final exam for my class. I will take a final look at this on Wednesday.

Apr 24 2023, 5:55 PM

Apr 21 2023

alc added a comment to D39739: vm: implement vm_page_reclaim_contig_domain_ext() to reclaim multiple contiguous regions at once.

Overall, I think that this is okay.

Apr 21 2023, 6:21 AM

Mar 8 2023

alc accepted D38985: vm_fault: Update a comment to reflect the removal of the default pager.
Mar 8 2023, 5:19 PM

Dec 29 2022

alc accepted D37770: amd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG.
Dec 29 2022, 10:21 PM
alc added a comment to D37770: amd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG.

I assume that you did not modify pmap_pti_pcid_invlpg and pmap_pti_pcid_invlrng in support.S because the broken do not require PTI. Is that correct?

Dec 29 2022, 7:23 PM

Dec 21 2022

alc added a comment to D37770: amd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG.

Do you have any guess as to how long we might be stuck with this workaround? If the need for it persists, then we may want to have a wrapper to optimize the range operations to avoid repeating INVPCID_CTXGLOB.

Dec 21 2022, 5:58 PM

Dec 12 2022

alc committed rGf0878da03b37: pmap: standardize promotion conditions between amd64 and arm64 (authored by alc).
pmap: standardize promotion conditions between amd64 and arm64
Dec 12 2022, 6:09 PM
alc closed D36916: pmap: standardize promotion conditions between amd64 and arm64.
Dec 12 2022, 6:09 PM

Nov 20 2022

alc accepted D37399: Support the arm64 pmap_remove_write for stage 2.
Nov 20 2022, 1:16 AM

Nov 19 2022

alc added inline comments to D37254: Support arm64 stage2 TLB invalidation.
Nov 19 2022, 7:08 PM

Nov 16 2022

alc added inline comments to D37254: Support arm64 stage2 TLB invalidation.
Nov 16 2022, 8:10 AM
alc added inline comments to D37399: Support the arm64 pmap_remove_write for stage 2.
Nov 16 2022, 7:21 AM

Nov 7 2022

alc accepted D37302: Rename the arm64 pmap_invalidate_* functions.
Nov 7 2022, 4:41 PM

Nov 5 2022

alc added inline comments to D37254: Support arm64 stage2 TLB invalidation.
Nov 5 2022, 6:10 PM

Nov 4 2022

alc accepted D37255: arm64: Disable per-thread stack-smashing protection in data_abort().
Nov 4 2022, 5:36 PM

Nov 2 2022

alc accepted D37231: arm64: Handle translation faults for thread structures.
Nov 2 2022, 5:24 PM

Oct 29 2022

alc accepted D37204: iommu_gas: drop fini cleanup loop.
Oct 29 2022, 5:46 PM
alc accepted D36624: iommu_gas: start space search from first free space.
Oct 29 2022, 3:58 AM

Oct 13 2022

alc updated subscribers of D36978: swap_pager: Reduce code duplication for swp_page_meta_build callers.

Add @dougm

Oct 13 2022, 5:21 PM

Oct 10 2022

alc accepted D36919: amd64 pmap: two trivial changes.
Oct 10 2022, 9:31 PM
alc updated the diff for D36916: pmap: standardize promotion conditions between amd64 and arm64.

Update comment.

Oct 10 2022, 5:12 PM
alc added inline comments to D36919: amd64 pmap: two trivial changes.
Oct 10 2022, 4:33 PM

Oct 8 2022

alc added inline comments to D36916: pmap: standardize promotion conditions between amd64 and arm64.
Oct 8 2022, 8:59 PM
alc added a comment to D36916: pmap: standardize promotion conditions between amd64 and arm64.

As an aside, in a few weeks, I may eliminate the requirement that PG_A/ATTR_AF is set, add a call to pmap_promote_{pde,l2}() from pmap_enter_quick_locked(), and change pmap_advise(MADV_FREE) to simply write protect one 4KB mapping after demotion (rather than destroying it).

Oct 8 2022, 6:34 PM
alc updated the summary of D36916: pmap: standardize promotion conditions between amd64 and arm64.
Oct 8 2022, 5:58 PM
alc requested review of D36916: pmap: standardize promotion conditions between amd64 and arm64.
Oct 8 2022, 5:57 PM

Oct 7 2022

alc added a comment to D36685: sys: Consolidate common implementation details of PV entries..
In D36685#838132, @jhb wrote:
In D36685#838118, @alc wrote:

Everything in _pv_entry.h except for the notion of there being a struct pv_entry with at least a virtual address and TAILQ is original to peter@. I don't see a reason for a Regents copyright.

Mmmm, ok. I can drop the UCB copyright, but @peter would have to be the one to change it to a 2 clause license.

Oct 7 2022, 6:20 PM
alc added a comment to D36685: sys: Consolidate common implementation details of PV entries..

Everything in _pv_entry.h except for the notion of there being a struct pv_entry with at least a virtual address and TAILQ is original to peter@. I don't see a reason for a Regents copyright.

Oct 7 2022, 5:49 PM

Oct 5 2022

alc added inline comments to D36885: riscv: handle kernel PTE edge-case in pmap_enter_l2().
Oct 5 2022, 4:40 PM
alc accepted D36563: riscv: handle existing mapping in pmap_enter_l2().
Oct 5 2022, 7:48 AM

Oct 4 2022

alc added inline comments to D36801: Micro-optimize the application of MADV_WILLNEED to existing superpage mappings.
Oct 4 2022, 5:32 PM

Sep 30 2022

alc committed rG1d5ebad06c20: pmap: optimize MADV_WILLNEED on existing superpages (authored by alc).
pmap: optimize MADV_WILLNEED on existing superpages
Sep 30 2022, 5:15 PM
alc closed D36801: Micro-optimize the application of MADV_WILLNEED to existing superpage mappings.
Sep 30 2022, 5:15 PM
alc accepted D36839: vm_page: Fix a logic error in the handling of PQ_ACTIVE operations.
Sep 30 2022, 5:09 PM
alc added a comment to D36563: riscv: handle existing mapping in pmap_enter_l2().

See D36801 for changes to the amd64 and arm64 pmaps to avoid the unnecessary pmap_enter_quick_locked() calls. I recommend merging those changes to riscv.

Sep 30 2022, 4:54 PM
alc accepted D36840: riscv: Apply 8d7ee2047c5e to the riscv pmap.
Sep 30 2022, 4:21 PM

Sep 29 2022

alc requested review of D36801: Micro-optimize the application of MADV_WILLNEED to existing superpage mappings.
Sep 29 2022, 6:16 PM

Sep 26 2022

alc updated subscribers of D36500: Fix O(n^2) behavior in sysctl.

You might ask @dougm to take a look at this.

Sep 26 2022, 10:52 PM
alc accepted D36646: rb_tree: add augmentation comments.
Sep 26 2022, 5:34 PM
alc added inline comments to D36697: arm64: Handle 1GB mappings in pmap_enter_quick_locked().
Sep 26 2022, 5:04 PM

Sep 25 2022

alc accepted D36697: arm64: Handle 1GB mappings in pmap_enter_quick_locked().
Sep 25 2022, 5:55 PM
alc accepted D36698: arm64: Fix an assertion in pmap_enter_largepage().
Sep 25 2022, 5:36 PM

Sep 24 2022

alc added inline comments to D36563: riscv: handle existing mapping in pmap_enter_l2().
Sep 24 2022, 5:30 PM
alc added a comment to D36563: riscv: handle existing mapping in pmap_enter_l2().

pmap_enter_object() is used only to prefault mappings [of a single VM object], so it is allowed to do nothing. I'm not sure if that was the intent behind the interface when it was first introduced, since the name doesn't suggest that it is advisory.

Sep 24 2022, 6:02 AM
alc accepted D36675: amd64: Ignore 1GB mappings in pmap_advise().

Shouldn't the same change be made on arm64?

Sep 24 2022, 5:56 AM
alc accepted D36673: amd64: Make it possible to grow the KERNBASE region of KVA.
Sep 24 2022, 5:50 AM
alc accepted D36370: smr: Fix synchronization in smr_enter().
Sep 24 2022, 5:18 AM

Sep 23 2022

alc accepted D36674: amd64: Handle 1GB mappings in pmap_enter_quick_locked().

Shouldn't the same change be made on arm64?

Sep 23 2022, 9:36 PM
alc added inline comments to D36673: amd64: Make it possible to grow the KERNBASE region of KVA.
Sep 23 2022, 5:54 PM
alc added inline comments to D36674: amd64: Handle 1GB mappings in pmap_enter_quick_locked().
Sep 23 2022, 4:39 PM

Sep 21 2022

alc accepted D36509: rb_tree: augmentation shortcut.
Sep 21 2022, 4:18 AM
alc added inline comments to D36509: rb_tree: augmentation shortcut.
Sep 21 2022, 4:11 AM
alc added inline comments to D36509: rb_tree: augmentation shortcut.
Sep 21 2022, 3:55 AM