Page MenuHomeFreeBSD

alc (Alan Cox)
User

Projects

User Details

User Since
Dec 14 2014, 5:52 AM (276 w, 2 d)

Recent Activity

Fri, Mar 13

alc accepted D24032: Retire vm_page_sbusy/vm_page_xbusy. They are unsafe with lockless lookup..
Fri, Mar 13, 6:09 AM

Feb 29 2020

alc added a comment to D23895: Ensure that arm64 thread structures are allocated from the direct map..
In D23895#525319, @alc wrote:

The _NOFREE reminds me that we still need a way to segregate _NOFREE allocations in physical memory. Such segregation would most likely provide contiguity inherently.

The freepool approach requires some work in order to segregate KVA allocations, I believe, but I think that should be straightforward.

Feb 29 2020, 6:37 PM
alc accepted D23895: Ensure that arm64 thread structures are allocated from the direct map..

The _NOFREE reminds me that we still need a way to segregate _NOFREE allocations in physical memory. Such segregation would most likely provide contiguity inherently.

Feb 29 2020, 6:01 PM

Feb 25 2020

alc accepted D23831: Generalise the arm64 ASID allocator.

Is your overall strategy to incrementally replace PMAP_ASSERT_STAGE1(pmap)'s by correct handling of stage 2 PTE?

Feb 25 2020, 4:51 PM

Feb 22 2020

alc accepted D23763: Allow swap_pager_putpages() to allocate one block at a time..
Feb 22 2020, 9:30 PM

Jan 18 2020

alc added inline comments to D23237: [uma-multipage 1/3] uma: add UMA_ZONE_CONTIG, and a default contig_alloc.
Jan 18 2020, 5:52 PM
alc added inline comments to D23237: [uma-multipage 1/3] uma: add UMA_ZONE_CONTIG, and a default contig_alloc.
Jan 18 2020, 5:33 PM

Jan 4 2020

alc committed rS356354: When a copy-on-write fault occurs, pmap_enter() is called on to replace the.
When a copy-on-write fault occurs, pmap_enter() is called on to replace the
Jan 4 2020, 7:50 PM
alc closed D23027: Perform TLB invalidation before acquiring the PV list lock in pmap_enter().
Jan 4 2020, 7:50 PM

Jan 3 2020

alc created D23027: Perform TLB invalidation before acquiring the PV list lock in pmap_enter().
Jan 3 2020, 8:41 PM
alc accepted D23024: Fix a page leak in the md(4) swap I/O path..
Jan 3 2020, 6:05 PM

Jan 2 2020

alc accepted D23001: Clear queue operation flags when migrating a page to another queue..
Jan 2 2020, 6:16 PM

Dec 31 2019

alc accepted D22897: clip without corrupting map.
Dec 31 2019, 10:05 PM

Dec 30 2019

alc added inline comments to D22897: clip without corrupting map.
Dec 30 2019, 8:53 PM
alc committed rS356207: Determine whether the MMU hardware is capable of updating a page table.
Determine whether the MMU hardware is capable of updating a page table
Dec 30 2019, 8:30 PM
alc closed D22907: Enable hardware updates to the accessed flag and dirty state on recent arm64 processors .
Dec 30 2019, 8:30 PM
alc added a comment to D22907: Enable hardware updates to the accessed flag and dirty state on recent arm64 processors .

I also tested this patch with the following added changes:

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index 7f96431648d..ea394d12ee0 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -5983,8 +5983,8 @@ pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_t sz
)
        }
 }
Dec 30 2019, 8:03 AM

Dec 29 2019

alc updated the diff for D22907: Enable hardware updates to the accessed flag and dirty state on recent arm64 processors .

Remove diagnostic printf() calls. This version is ready to commit.

Dec 29 2019, 11:17 PM
alc committed rS356168: Correctly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel.
Correctly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel
Dec 29 2019, 5:36 AM
alc closed D22890: Apply r355883 to i386.
Dec 29 2019, 5:36 AM

Dec 22 2019

alc created D22907: Enable hardware updates to the accessed flag and dirty state on recent arm64 processors .
Dec 22 2019, 11:32 PM

Dec 21 2019

alc committed rS355991: Micro-optimize the control flow in _pmap_unwire_ptp(), and eliminate.
Micro-optimize the control flow in _pmap_unwire_ptp(), and eliminate
Dec 21 2019, 10:32 PM
alc closed D22893: Micro-optimize _pmap_unwire_ptp().
Dec 21 2019, 10:32 PM

Dec 20 2019

alc created D22893: Micro-optimize _pmap_unwire_ptp().
Dec 20 2019, 9:54 PM
alc committed rS355946: Correct a mistakenly inverted condition in r355833..
Correct a mistakenly inverted condition in r355833.
Dec 20 2019, 8:48 PM
alc added inline comments to D22890: Apply r355883 to i386.
Dec 20 2019, 6:58 PM
alc updated the diff for D22890: Apply r355883 to i386.

Correct a mistakenly inverted condition.

Dec 20 2019, 6:56 PM
alc added a comment to D22890: Apply r355883 to i386.

Peter, can you please test this patch on i386?

Dec 20 2019, 7:40 AM
alc created D22890: Apply r355883 to i386.
Dec 20 2019, 7:37 AM

Dec 19 2019

alc accepted D22874: make tmpfs.h friendly with _KERNEL undefined.
Dec 19 2019, 4:36 PM

Dec 18 2019

alc accepted D22868: Fix VPO_UNMANAGED handling in vm_page_reclaim_run()..
Dec 18 2019, 10:21 PM
alc committed rS355883: When pmap_enter_{l2,pde}() are called to create a kernel mapping, they are.
When pmap_enter_{l2,pde}() are called to create a kernel mapping, they are
Dec 18 2019, 6:21 PM
alc closed D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.
Dec 18 2019, 6:21 PM

Dec 15 2019

alc committed rS355787: Apply a small optimization to pmap_remove_l3_range(). Specifically, hoist a.
Apply a small optimization to pmap_remove_l3_range(). Specifically, hoist a
Dec 15 2019, 10:42 PM

Dec 14 2019

alc updated the summary of D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.
Dec 14 2019, 10:49 PM
alc updated the summary of D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.
Dec 14 2019, 10:46 PM
alc updated the diff for D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.

Refactor the interface between pmap_alloc{_l2,pde}() and its callers to reduce duplicated code and handle kernel page table pages. The only downside to this update being that I had to abandon a micro-optimization in pmap_enter_l2() on arm64: When calling pmap_remove_l2(), I still have to repeat a pmap_l1() call that the previous version eliminated.

Dec 14 2019, 10:45 PM
alc accepted D22666: Simplify leaf_alloc, improve some hints.
Dec 14 2019, 6:21 PM

Dec 13 2019

alc updated the diff for D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.

Handle a possible page table page leak in pmap_copy(). Suppose that we are determining whether to copy a superpage mapping. If we abort because there is already a mapping in the destination pmap at the current address, then simply decrementing the page table page's ref count is correct, because the page table page must have a ref count > 1. However, if we abort because we failed to allocate a PV entry, this might be a just allocated page table page that has a ref count = 1, so we should call pmap_abort_ptp().

Dec 13 2019, 11:44 PM
alc added inline comments to D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.
Dec 13 2019, 9:30 PM
alc updated the diff for D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.

Use Ln_ENTRIES on arm64.

Dec 13 2019, 7:21 PM

Dec 12 2019

alc added a comment to D22666: Simplify leaf_alloc, improve some hints.

On the whole, this is okay. Just ask Peter to test it.

Dec 12 2019, 4:37 PM
alc accepted D22753: Implement atomic state updates using the new vm_page_astate_t structure..
Dec 12 2019, 8:27 AM

Dec 11 2019

alc created D22763: Properly manage kernel page table pages in pmap_enter_{l2,pde}.
Dec 11 2019, 4:44 PM
alc added inline comments to D22654: Add a deferred mechanism for deleting swap space without the object lock held..
Dec 11 2019, 12:41 AM

Dec 9 2019

alc added inline comments to D22731: Handle pagein clustering for vm_page_grab_valid() so that exec can use it..
Dec 9 2019, 4:37 PM
alc added inline comments to D22731: Handle pagein clustering for vm_page_grab_valid() so that exec can use it..
Dec 9 2019, 4:32 PM
alc added inline comments to D22654: Add a deferred mechanism for deleting swap space without the object lock held..
Dec 9 2019, 4:27 PM
alc added inline comments to D22654: Add a deferred mechanism for deleting swap space without the object lock held..
Dec 9 2019, 4:08 PM

Dec 6 2019

alc added inline comments to D22606: Switch to an empty ttbr0 pagetable when the MMU is enabled.
Dec 6 2019, 4:46 PM

Dec 5 2019

alc closed D22622: Handle the possibility of preemption after an "ic" or "tlbi" instruction.
Dec 5 2019, 7:26 PM
alc committed rS355427: On a context switch, handle the possibility that the old thread was.
On a context switch, handle the possibility that the old thread was
Dec 5 2019, 7:26 PM

Dec 4 2019

alc accepted D22650: Introduce vm_page_astate..
Dec 4 2019, 8:02 PM
alc accepted D22678: Fix an off-by-one in vm_map_pmap_enter()..
Dec 4 2019, 6:54 PM
alc added a comment to D22622: Handle the possibility of preemption after an "ic" or "tlbi" instruction.
In D22622#495862, @kib wrote:
In D22622#495703, @alc wrote:

Which context synchronization event are you using after the dsb? ARMv8.5 adds the ARMv8.5-CSEH (Context synchronization and exception handling) extension that allows us to remove exceptions as a context synchronization event. It might pay to document where we know we are relying on exception entry/exit for these to help later if we decide to use the extension.

None really. Suppose that I am a thread that is preempted in the middle of a function F, which is one of the various "ic" or "tlbi" issuing functions. Further, suppose that I am then migrated to a new processor. If switching to a new thread on my old processor requires an address space change, then we are guaranteed that an "isb" instruction will be performed. In contrast, where the new thread and I share the same address space, we are not certain to perform an "isb" instruction as part of the context switch. However, I'm going to argue that this doesn't matter. Until I have completed F, and this new thread has synchronized with me in some way, it really isn't entitled to make any assumptions about the state in which I left the old processor. Simply having a context synchronization event as part of the context switch doesn't really achieve anything.

But isn't the problem that we modified page table entry on one processor, while issued isb on another ?

Dec 4 2019, 5:22 PM
alc added a comment to D22622: Handle the possibility of preemption after an "ic" or "tlbi" instruction.

Which context synchronization event are you using after the dsb? ARMv8.5 adds the ARMv8.5-CSEH (Context synchronization and exception handling) extension that allows us to remove exceptions as a context synchronization event. It might pay to document where we know we are relying on exception entry/exit for these to help later if we decide to use the extension.

Dec 4 2019, 12:08 AM

Dec 3 2019

alc added inline comments to D22651: Add a helper function to the swapout daemon's deactivation code..
Dec 3 2019, 10:23 PM

Dec 2 2019

alc added a comment to D22606: Switch to an empty ttbr0 pagetable when the MMU is enabled.
In D22606#494706, @mmel wrote:

i just realized that this breaks EARLY_UART because SOCDEV_PA mapping is not passed to initarm().
So I think that we should postpone change of kernel ttbt0 until cninit() is processed.

@@ -1164,6 +1164,7 @@ initarm(struct arm64_bootparams *abp)
        valid = bus_probe();
        cninit();
+       set_ttbr0((uint64_t)pagetable_l0_ttbr0 - abp->kern_delta);
        if (!valid)
                panic("Invalid bus configuration: %s",

Also, summary is slightly misleading. This patch doesn't fully remove architectural undefined behavior (and I'm able to demonstrate this on RK3399) because it still exist - same physical memory is mapped in identity map as uncached and in kernel map as cached. This is direct violation of B2.9 in ARMv8 ARM, and it causes lost of coherency visible later in boot process.

Dec 2 2019, 7:16 PM
alc accepted D22610: Fix the last few cases that grab without busy or wired. This also happens to fix two cases of direct valid bit modification..
Dec 2 2019, 4:48 PM

Dec 1 2019

alc created D22622: Handle the possibility of preemption after an "ic" or "tlbi" instruction.
Dec 1 2019, 5:42 PM

Nov 30 2019

alc added inline comments to D22541: Store the bottom of the shadow chain in OBJ_ANON object->handle member..
Nov 30 2019, 10:38 PM
alc accepted D22541: Store the bottom of the shadow chain in OBJ_ANON object->handle member..
Nov 30 2019, 7:44 PM
alc added inline comments to D22606: Switch to an empty ttbr0 pagetable when the MMU is enabled.
Nov 30 2019, 6:27 PM
alc added inline comments to D22611: Fix a few places that free a page from an object without busy held..
Nov 30 2019, 6:07 PM
alc added inline comments to D22610: Fix the last few cases that grab without busy or wired. This also happens to fix two cases of direct valid bit modification..
Nov 30 2019, 5:41 PM

Nov 29 2019

alc accepted D22606: Switch to an empty ttbr0 pagetable when the MMU is enabled.

Feel free to cross this task off from the list at https://wiki.freebsd.org/PmapReview :-)

Nov 29 2019, 7:20 PM

Nov 27 2019

alc added a comment to D22544: Use macros to search vm_map.
In D22544#493747, @alc wrote:

Can you explain why this change reduces the number of L1 data cache misses?

I haven't observed that. I didn't expect to impact L1 data cache misses.

Nov 27 2019, 8:57 PM
alc closed D22502: Eliminate thread pinning from broadcast TLB invalidation functions on arm64.
Nov 27 2019, 8:34 PM
alc committed rS355145: There is no reason why we need to pin the underlying thread to its current.
There is no reason why we need to pin the underlying thread to its current
Nov 27 2019, 8:34 PM
alc committed rS355136: MFC r350579,r350741,r352584.
MFC r350579,r350741,r352584
Nov 27 2019, 7:34 PM
alc added a comment to D22544: Use macros to search vm_map.

Can you explain why this change reduces the number of L1 data cache misses?

Nov 27 2019, 7:24 PM

Nov 26 2019

alc added inline comments to D22541: Store the bottom of the shadow chain in OBJ_ANON object->handle member..
Nov 26 2019, 7:23 AM

Nov 24 2019

alc accepted D22458: Consistent vm_map_entry loop naming.
Nov 24 2019, 11:27 PM
alc added inline comments to D22458: Consistent vm_map_entry loop naming.
Nov 24 2019, 11:16 PM

Nov 22 2019

alc created D22502: Eliminate thread pinning from broadcast TLB invalidation functions on arm64.
Nov 22 2019, 7:09 PM
alc accepted D22392: Fix locking in vm_reserv_reclaim_contig()..
Nov 22 2019, 5:26 AM

Nov 21 2019

alc added a comment to D22423: Only insert objects into a shadow list if they can later be collapsed..
In D22423#490985, @jeff wrote:

...

Maybe Alan has some thoughts. I feel like this set of patches is a welcome bandaid but I would've preferred to have done something more architectural to solve it better in the long run.

Nov 21 2019, 7:40 PM

Nov 20 2019

alc committed rS354898: Until every possible root cause for an "invalid ASID" assertion failure is.
Until every possible root cause for an "invalid ASID" assertion failure is
Nov 20 2019, 4:32 PM
alc accepted D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 20 2019, 3:58 PM
alc added a comment to D22348: When traversing vm_map entries, don't look up the same neighbor twice.

While I like the suggestion that we use a consistent variable naming schema, I felt like those style changes were overwhelming the functional changes. So, I asked Doug to separate the functional and stylistic changes.

Nov 20 2019, 3:49 PM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 20 2019, 3:35 PM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 20 2019, 5:23 AM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 20 2019, 5:19 AM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 20 2019, 5:15 AM

Nov 19 2019

alc committed rS354860: Achieve two goals at once: (1) Avoid an unnecessary broadcast TLB.
Achieve two goals at once: (1) Avoid an unnecessary broadcast TLB
Nov 19 2019, 7:05 PM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 19 2019, 3:09 AM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 19 2019, 2:53 AM

Nov 18 2019

alc added a comment to D22394: Update the checks in vm_page_zone_import()..
In D22394#490201, @jeff wrote:

We run all of our paging threads constantly now. I would prefer not to disable creating cache buckets from pageproc unless we're in low memory situation. Even then it may be preferable to simply flush the buckets at the end of paging in that case.

The page daemon threads don't regularly allocate pages as far as I know. Maybe infrequently when unmapping a page will cause a superpage demotion and the leaf PTP is not cached in the pmap, and I believe that will only happen when the mapping was created with pmap_enter(psind==1).

Nov 18 2019, 7:33 PM
alc added a comment to D21768: Remove the wire_count field from struct vm_page..

Shouldn't this be closed?

Nov 18 2019, 6:36 PM

Nov 17 2019

alc committed rS354799: MFC r352847,352930,354585.
MFC r352847,352930,354585
Nov 17 2019, 10:44 PM
alc accepted D22402: Create swp_pager_free_empty_swblk function to free if a swblk is free..
Nov 17 2019, 6:25 PM
alc committed rS354792: Achieve two goals at once: (1) Avoid an unnecessary broadcast TLB.
Achieve two goals at once: (1) Avoid an unnecessary broadcast TLB
Nov 17 2019, 5:39 PM
alc closed D22388: Teach arm64's pmap_remove_all() to skip pmap_invalidate_page() unless ATTR_AF is set.
Nov 17 2019, 5:39 PM
alc accepted D22405: look for in-transition status in each map entry.
Nov 17 2019, 6:46 AM

Nov 16 2019

alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Nov 16 2019, 7:33 PM
alc added a comment to D22405: look for in-transition status in each map entry.

While I think that this change is unquestionably correct, I would still ask Peter to test it.

Nov 16 2019, 7:13 PM
alc added inline comments to D22394: Update the checks in vm_page_zone_import()..
Nov 16 2019, 7:04 PM
alc accepted D22397: Widen aflags to 16 bits..
Nov 16 2019, 6:17 PM
alc added inline comments to D22405: look for in-transition status in each map entry.
Nov 16 2019, 5:28 PM
alc added a comment to D22405: look for in-transition status in each map entry.

The code is correct, but the summary is wrong.

Nov 16 2019, 4:42 PM