Page MenuHomeFreeBSD

alc (Alan Cox)
User

Projects

User Details

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

Recent Activity

Today

alc accepted D22392: Fix locking in vm_reserv_reclaim_contig()..
Fri, Nov 22, 5:26 AM

Yesterday

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.

Thu, Nov 21, 7:40 PM

Wed, Nov 20

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
Wed, Nov 20, 4:32 PM
alc accepted D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Wed, Nov 20, 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.

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

Tue, Nov 19

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
Tue, Nov 19, 7:05 PM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Tue, Nov 19, 3:09 AM
alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Tue, Nov 19, 2:53 AM

Mon, Nov 18

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).

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

Shouldn't this be closed?

Mon, Nov 18, 6:36 PM

Sun, Nov 17

alc committed rS354799: MFC r352847,352930,354585.
MFC r352847,352930,354585
Sun, Nov 17, 10:44 PM
alc accepted D22402: Create swp_pager_free_empty_swblk function to free if a swblk is free..
Sun, Nov 17, 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
Sun, Nov 17, 5:39 PM
alc closed D22388: Teach arm64's pmap_remove_all() to skip pmap_invalidate_page() unless ATTR_AF is set.
Sun, Nov 17, 5:39 PM
alc accepted D22405: look for in-transition status in each map entry.
Sun, Nov 17, 6:46 AM

Sat, Nov 16

alc added inline comments to D22348: When traversing vm_map entries, don't look up the same neighbor twice.
Sat, Nov 16, 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.

Sat, Nov 16, 7:13 PM
alc added inline comments to D22394: Update the checks in vm_page_zone_import()..
Sat, Nov 16, 7:04 PM
alc accepted D22397: Widen aflags to 16 bits..
Sat, Nov 16, 6:17 PM
alc added inline comments to D22405: look for in-transition status in each map entry.
Sat, Nov 16, 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.

Sat, Nov 16, 4:42 PM
alc added inline comments to D20091: Fix another race between vm_map_protect() and vm_map_wire()..
Sat, Nov 16, 5:54 AM

Fri, Nov 15

alc updated the diff for D22388: Teach arm64's pmap_remove_all() to skip pmap_invalidate_page() unless ATTR_AF is set.

Add context.

Fri, Nov 15, 6:43 PM
alc created D22388: Teach arm64's pmap_remove_all() to skip pmap_invalidate_page() unless ATTR_AF is set.
Fri, Nov 15, 6:40 PM

Tue, Nov 12

alc accepted D22142: Implement vm.pmap.kernel_maps for arm64..
Tue, Nov 12, 4:25 AM

Mon, Nov 11

alc added inline comments to D22280: exploit sparsity in swap_pager_copy.
Mon, Nov 11, 5:02 PM
alc accepted D22280: exploit sparsity in swap_pager_copy.
Mon, Nov 11, 4:43 PM
alc added a comment to D22280: exploit sparsity in swap_pager_copy.

This looks like a reasonable change.

Mon, Nov 11, 9:30 AM

Sun, Nov 10

alc committed rS354585: Eliminate a redundant pmap_load() from pmap_remove_pages()..
Eliminate a redundant pmap_load() from pmap_remove_pages().
Sun, Nov 10, 5:22 AM

Sat, Nov 9

alc accepted D22163: reduce vm_map consistency assertions.
Sat, Nov 9, 4:53 PM

Thu, Nov 7

alc accepted D22242: Include caching zones into zone_foreach() where appropriate..
Thu, Nov 7, 8:21 AM
alc added inline comments to D22142: Implement vm.pmap.kernel_maps for arm64..
Thu, Nov 7, 8:08 AM

Wed, Nov 6

alc added inline comments to D22142: Implement vm.pmap.kernel_maps for arm64..
Wed, Nov 6, 4:48 PM
alc added inline comments to D22142: Implement vm.pmap.kernel_maps for arm64..
Wed, Nov 6, 4:45 PM

Tue, Nov 5

alc added inline comments to D22141: Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX..
Tue, Nov 5, 3:49 PM
alc accepted D22241: Use the VM_MEMATTR macros to describe the MAIR offsets.
Tue, Nov 5, 3:34 PM

Mon, Nov 4

alc added inline comments to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Mon, Nov 4, 7:13 PM
alc accepted D22234: Fix a race in release_page()..
Mon, Nov 4, 6:49 PM
alc accepted D22141: Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX..
Mon, Nov 4, 6:46 PM
alc added inline comments to D22141: Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX..
Mon, Nov 4, 6:35 PM
alc accepted D22141: Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX..
Mon, Nov 4, 6:24 PM
alc accepted D22229: ksyms: Lock the object while setting NOSPLIT..
Mon, Nov 4, 3:51 PM
alc added a comment to D22229: ksyms: Lock the object while setting NOSPLIT..
In D22229#485773, @kib wrote:

Although unlocked manipulations of the flags were removed AFAIR.

Mon, Nov 4, 3:51 PM

Sun, Nov 3

alc added inline comments to D22229: ksyms: Lock the object while setting NOSPLIT..
Sun, Nov 3, 9:21 PM
alc closed D21922: A patch for using ASIDs in the arm64 pmap.
Sun, Nov 3, 5:45 PM
alc committed rS354286: Utilize ASIDs to reduce both the direct and indirect costs of context.
Utilize ASIDs to reduce both the direct and indirect costs of context
Sun, Nov 3, 5:45 PM
alc accepted D22229: ksyms: Lock the object while setting NOSPLIT..

I think that we should consider adding a vm_object_allocate_flags().

Sun, Nov 3, 5:20 PM
alc updated the diff for D21922: A patch for using ASIDs in the arm64 pmap.

Add a comment to efi_arch_enter() explaining why we don't update curpmap.

Sun, Nov 3, 8:59 AM

Sat, Nov 2

alc updated the summary of D21922: A patch for using ASIDs in the arm64 pmap.
Sat, Nov 2, 7:47 PM
alc updated the diff for D21922: A patch for using ASIDs in the arm64 pmap.

Add some comments.

Sat, Nov 2, 7:31 PM

Wed, Oct 30

alc updated the diff for D21922: A patch for using ASIDs in the arm64 pmap.

No functional changes: Add two comments about memory ordering on context switches. Add a KASSERT that the given pmap is the curpmap in pmap_remove_pages(), just like amd64.

Wed, Oct 30, 6:25 PM
alc added inline comments to D22163: reduce vm_map consistency assertions.
Wed, Oct 30, 3:38 PM
alc added a comment to D22163: reduce vm_map consistency assertions.

I spoke with Doug about this in person. I suggested that to him that instead of completely eliminating the check over the entire map that we try to reduce the frequency with which it occurs. In particular, I suggested that the consistency check be deferred until we are releasing the write lock on the map, so that, for example, an mprotect that coalesced multiple map entries would only do the consistency check once. In addition, I suggested that we might perform the consistency check 1 out of N times that we modify the vm map.

Wed, Oct 30, 4:35 AM

Sun, Oct 27

alc updated the summary of D21922: A patch for using ASIDs in the arm64 pmap.
Sun, Oct 27, 6:26 AM

Sat, Oct 26

alc updated the summary of D21922: A patch for using ASIDs in the arm64 pmap.
Sat, Oct 26, 6:50 PM
alc updated the summary of D21922: A patch for using ASIDs in the arm64 pmap.
Sat, Oct 26, 6:37 PM
alc updated the summary of D21922: A patch for using ASIDs in the arm64 pmap.
Sat, Oct 26, 6:26 PM
alc updated the summary of D21922: A patch for using ASIDs in the arm64 pmap.
Sat, Oct 26, 6:23 PM
alc updated the summary of D21922: A patch for using ASIDs in the arm64 pmap.
Sat, Oct 26, 6:21 PM
alc updated the test plan for D21922: A patch for using ASIDs in the arm64 pmap.
Sat, Oct 26, 6:05 PM
alc updated the diff for D21922: A patch for using ASIDs in the arm64 pmap.

Tidy up PCPU_MD_FIELDS.

Sat, Oct 26, 6:03 PM

Fri, Oct 25

alc accepted D22138: amd64: move pcb out of kstack to struct thread.
Fri, Oct 25, 6:04 PM

Thu, Oct 24

alc added inline comments to D22138: amd64: move pcb out of kstack to struct thread.
Thu, Oct 24, 10:07 PM
alc added inline comments to D22142: Implement vm.pmap.kernel_maps for arm64..
Thu, Oct 24, 5:13 PM
alc accepted D22141: Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX..
Thu, Oct 24, 4:50 PM
alc added a comment to D21922: A patch for using ASIDs in the arm64 pmap.

If you don't see any mysterious application (or kernel) crashes with the previous patch, then please test this new version. I believe that this new version could reasonably be committed, so also consider this message a request for review.

Thu, Oct 24, 4:45 PM
alc updated the diff for D21922: A patch for using ASIDs in the arm64 pmap.

Implement a realistic ASID allocator. This should work with either 8- or 16-bit ASIDs.

Thu, Oct 24, 5:05 AM
alc accepted D22112: Add a tunable to set the pgcache zone's maxcache.
Thu, Oct 24, 4:01 AM

Wed, Oct 23

alc added a comment to D21922: A patch for using ASIDs in the arm64 pmap.

I also found that this patch very slightly reduced the time for a "make -j16 buildkernel" on a 16-core machine. Specifically, the reduction was about 6 seconds out of about 4 minutes 35 seconds. I suspect that this is because a context switch by any core currently triggers a global TLB invalidation that affects all cores (as opposed to a local invalidation that just affects the context switching core).

Wed, Oct 23, 10:15 PM
alc added inline comments to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Wed, Oct 23, 6:28 PM
alc added a comment to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..

If we are going to start setting a color by default on DEFAULT and SWAP objects, then the following code that appears in two places in vm_reserv.c needs to change. Specifically, it should test for the absence of the OBJ_ANON rather than the object being OBJT_VNODE.

/*                                                                                                                                                              
 * Would the last new reservation extend past the end of the object?                                                                                            
 */
if (first + maxpages > object->size) {
        /*                                                                                                                                                      
         * Don't allocate the last new reservation if the object is a                                                                                           
         * vnode or backed by another object that is a vnode.                                                                                                   
         */
        if (object->type == OBJT_VNODE ||
            (object->backing_object != NULL &&
            object->backing_object->type == OBJT_VNODE)) {
                if (maxpages == VM_LEVEL_0_NPAGES)
                        return (NULL);
                allocpages = minpages;
        }
        /* Speculate that the object may grow. */
}
Wed, Oct 23, 6:19 PM
alc added inline comments to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Wed, Oct 23, 6:07 PM

Oct 23 2019

alc accepted D22124: Fix a couple of issues in the recent work on page busying..
Oct 23 2019, 3:36 PM

Oct 22 2019

alc accepted D22113: Assert that vm_fault_lock_vnode() returns locked saved vnode..
Oct 22 2019, 11:07 PM
alc added a comment to D21922: A patch for using ASIDs in the arm64 pmap.

Unfortunately I haven't been able to get a ThunderX from packet.net this week

We have a couple of 1S ThunderX and one 2S ThunderX hosted at Sentex, coordinate with @gnn for use of them

I have access to one now, I will be testing today.

Oct 22 2019, 3:32 PM

Oct 16 2019

alc added a comment to D22056: Port D22041/r353622 to sparc64 and arm v4..

I believe that arm/arm/pmap-v4.c also needs this fix.

Oct 16 2019, 6:44 PM
alc accepted D22056: Port D22041/r353622 to sparc64 and arm v4..
Oct 16 2019, 6:38 PM
alc added a comment to D21922: A patch for using ASIDs in the arm64 pmap.

I can boot with it on the dual package ThunderX in Sentex (2 x 48 cores). Unfortunately I was unable to test it as I hit an unrelated nfs locking issue.

Oct 16 2019, 6:36 PM
alc accepted D22040: Further constrain the use of per-CPU page caches..
Oct 16 2019, 5:40 PM
alc accepted D22041: Fix assert in powerpc pmaps after introduction of object busy..
Oct 16 2019, 4:49 AM
alc accepted D22044: Clear PGA_WRITEABLE in moea_remove_pvo()..
Oct 16 2019, 2:50 AM

Oct 15 2019

alc added a comment to D22041: Fix assert in powerpc pmaps after introduction of object busy..

If my recollection of the sparc64 pmap is correct, it will have the same issue.

Oct 15 2019, 7:27 PM
alc added a comment to D22007: amd64: Ensure that the state of the switched-out thread is fully flushed.
In D22007#481438, @kib wrote:

BTW, I did tried to find a reference in the SDM vol.3 that would certainly witness that interrupts and exceptions are serialized, and failed. I know for sure that sysenter is not serializing.

Oct 15 2019, 7:22 PM
alc added a comment to D22041: Fix assert in powerpc pmaps after introduction of object busy..

Why not use PMAP_ENTER_NOSLEEP instead of introducing a new flag?

Oct 15 2019, 7:05 PM
alc added a comment to D22007: amd64: Ensure that the state of the switched-out thread is fully flushed.
In D22007#481354, @cem wrote:
In D22007#481240, @kib wrote:

I remembered why I did not wanted to put the SFENCE instruction in pmap_activate_sw(). Description of e.g. CLFLUSHOPT (as well as e.g. AMD CLZERO) explicitly state that SFENCE is required, they do not mention serialization instructions.

Vol 2A, p.3-144:

Executions of the CLFLUSHOPT instruction are ordered with respect to fence instructions and to locked read-modify-write instructions; they are also ordered with respect to the following accesses to the cache line being invalidated: older writes and older executions of CLFLUSH. They are not ordered with respect to writes, executions of CLFLUSH that access other cache lines, or executions of CLFLUSHOPT regardless of cache line; to enforce CLFLUSHOPT ordering with any write, CLFLUSH, or CLFLUSHOPT operation, software can insert an SFENCE instruction between CLFLUSHOPT and that operation.

The "can" language in that last sentence is unclear to me. It seems possible that some other serializing instruction might be adequate, although I agree it is unclear why those others are not spelled out in the list above.
I find the CLWB language a little more precise (p. 3-149):

CLWB instruction is ordered only by store-fencing operations. For example, software can use an SFENCE, MFENCE, XCHG, or LOCK-prefixed instructions to ensure that previous stores are included in the write-back.

Ok, are serializing events not store-fencing operations? Or is Intel just providing examples of performant ways to order these operations rather than an exhaustive list?

Oct 15 2019, 5:15 PM
alc added a comment to D22007: amd64: Ensure that the state of the switched-out thread is fully flushed.
In D22007#481175, @cem wrote:
In D22007#481143, @alc wrote:

Intel SDM states that interrupts and exceptions flush store buffers, but this is said in context of WB memory.

Which section?

Vol. 3A, Chapter 11 "MEMORY CACHE CONTROL" (and specifically for store buffers in §11.10 "STORE BUFFER").

The processor ensures that ... the contents of the store buffer are always drained to memory in the following situations:
• When an exception or interrupt is generated.

But the intro says this:

Write Combining (WC) ... If the WC buffer is partially filled, the writes may be delayed until the next occurrence of a serializing event; such as, an SFENCE or MFENCE instruction, CPUID execution, a read or write to uncached memory, an interrupt occurrence, or a LOCK instruction execution.

The list is oddly specific and does not include 'mov to control registers,' but the "such as" language and cpuid example suggest to me that setting cr3 may be sufficient (if, as Konstantin points out, we actually did so).

Oct 15 2019, 4:59 PM

Oct 14 2019

alc added a comment to D22007: amd64: Ensure that the state of the switched-out thread is fully flushed.

Intel SDM states that interrupts and exceptions flush store buffers, but this is said in context of WB memory.

Oct 14 2019, 9:46 PM
alc added a comment to D21922: A patch for using ASIDs in the arm64 pmap.

I would appreciate it if folks would exercise this patch a bit, particularly on ThunderX, ThunderX2, and eMAG machines. I want know if there are issues with this patch, e.g., mysterious program crashes, before I rewrite the ASID allocator.

Oct 14 2019, 8:37 PM
alc added a comment to D22007: amd64: Ensure that the state of the switched-out thread is fully flushed.

I'm confused as to why this is necessary. pmap_activate_sw() performs a serializing instruction, specifically, a move to cr3. And, Section 8.2.5 of Volume 3 says,

Program synchronization can also be carried out with serializing instructions (see Section 8.3). These instructions
are typically used at critical procedure or task boundaries to force completion of all previous instructions before a
jump to a new section of code or a context switch occurs. Like the I/O and locking instructions, the processor waits
until all previous instructions have been completed and all buffered writes have been drained to memory before
executing the serializing instruction.

And, the next paragraph discusses the use of fences, e.g., sfence, instead of serializing instructions, e.g., cpuid.

Oct 14 2019, 8:15 PM
alc added a comment to D21964: Make vm_map a threaded tree.
In D21964#480590, @pho wrote:

I ran all of the stress2 test on 63130. I found one problem, which to me looks unrelated.
https://people.freebsd.org/~pho/stress/log/quota10-2.txt

Oct 14 2019, 5:36 PM

Oct 13 2019

alc updated the diff for D21922: A patch for using ASIDs in the arm64 pmap.

Tidy up locore.S. Specifically, allow callers of build_l1_block_pagetable to control other lower attributes besides cacheability.

Oct 13 2019, 7:15 PM
alc added inline comments to D21922: A patch for using ASIDs in the arm64 pmap.
Oct 13 2019, 3:29 AM
alc updated the test plan for D21922: A patch for using ASIDs in the arm64 pmap.
Oct 13 2019, 2:50 AM
alc updated the test plan for D21922: A patch for using ASIDs in the arm64 pmap.
Oct 13 2019, 2:49 AM

Oct 12 2019

alc accepted D21992: Restore nofaulting operations after r352807.
Oct 12 2019, 5:44 PM
alc updated the diff for D21922: A patch for using ASIDs in the arm64 pmap.

Workaround Cavium erratum 27456.

Oct 12 2019, 5:31 PM