svn commit: r367281 - in head/sys: amd64/amd64 arm64/arm64 mips/mips powerpc/powerpc riscv/riscv

2020-11-02 Thread Alan Cox
Author: alc Date: Mon Nov 2 19:20:06 2020 New Revision: 367281 URL: https://svnweb.freebsd.org/changeset/base/367281 Log: Tidy up the #includes. Recent changes, such as the introduction of VM_ALLOC_WAITOK and vm_page_unwire_noq(), have eliminated the need for many of the #includes. Re

svn commit: r367087 - head/lib/libc/sys

2020-10-27 Thread Alan Cox
Author: alc Date: Tue Oct 27 18:08:33 2020 New Revision: 367087 URL: https://svnweb.freebsd.org/changeset/base/367087 Log: Revise the description of MAP_STACK. In particular, describe the guard in more detail. Reviewed by: bcr, kib, markj MFC after:1 week Differential Revision:

svn commit: r366960 - head/sys/vm

2020-10-22 Thread Alan Cox
Author: alc Date: Fri Oct 23 06:24:38 2020 New Revision: 366960 URL: https://svnweb.freebsd.org/changeset/base/366960 Log: Conditionally compile struct vm_phys_seg's md_first field. This field is only used by arm64's pmap. Reviewed by: kib, markj, scottph Differential Revision:

svn commit: r366944 - head/sys/arm64/arm64

2020-10-22 Thread Alan Cox
Author: alc Date: Thu Oct 22 17:47:51 2020 New Revision: 366944 URL: https://svnweb.freebsd.org/changeset/base/366944 Log: Micro-optimize uma_small_alloc(). Replace bzero(..., PAGE_SIZE) by pagezero(). Ultimately, they use the same method for bulk zeroing, but the generality of bzero() req

Re: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux

2020-08-04 Thread Alan Cox
On 8/4/20 10:25 AM, Emmanuel Vadot wrote: Author: manu Date: Tue Aug 4 15:25:22 2020 New Revision: 363842 URL: https://svnweb.freebsd.org/changeset/base/363842 Log: linuxkpi: Add clear_bit_unlock This calls clear_bit and adds a memory barrier. Sponsored by: The FreeBSD Foundat

Re: svn commit: r358733 - head/sys/sys

2020-03-12 Thread Alan Cox
On 3/11/20 9:16 PM, Mateusz Guzik wrote: On 3/10/20, Konstantin Belousov wrote: On Tue, Mar 10, 2020 at 12:22:09AM +0100, Mateusz Guzik wrote: On 3/9/20, Konstantin Belousov wrote: On Mon, Mar 09, 2020 at 01:56:17AM +0100, Mateusz Guzik wrote: On 3/8/20, Mateusz Guzik wrote: Author: mjg

svn commit: r356354 - in head/sys: amd64/amd64 arm64/arm64 i386/i386

2020-01-04 Thread Alan Cox
Author: alc Date: Sat Jan 4 19:50:25 2020 New Revision: 356354 URL: https://svnweb.freebsd.org/changeset/base/356354 Log: When a copy-on-write fault occurs, pmap_enter() is called on to replace the mapping to the old read-only page with a mapping to the new read-write page. To destroy the o

Re: svn commit: r356207 - in head/sys/arm64: arm64 include

2019-12-30 Thread Alan Cox
On 12/30/19 2:59 PM, Colin Percival wrote: On 2019-12-30 12:30, Alan Cox wrote: Author: alc Date: Mon Dec 30 20:30:31 2019 New Revision: 356207 URL: https://svnweb.freebsd.org/changeset/base/356207 Log: Determine whether the MMU hardware is capable of updating a page table entry&#

svn commit: r356207 - in head/sys/arm64: arm64 include

2019-12-30 Thread Alan Cox
Author: alc Date: Mon Dec 30 20:30:31 2019 New Revision: 356207 URL: https://svnweb.freebsd.org/changeset/base/356207 Log: Determine whether the MMU hardware is capable of updating a page table entry's access flag and dirty state, and enable this feature when it's available. Ensure that

svn commit: r356168 - head/sys/i386/i386

2019-12-28 Thread Alan Cox
Author: alc Date: Sun Dec 29 05:36:01 2019 New Revision: 356168 URL: https://svnweb.freebsd.org/changeset/base/356168 Log: Correctly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel mappings. Reduce code duplication by defining a function, pmap_abort_ptp(), for handling

svn commit: r355991 - head/sys/amd64/amd64

2019-12-21 Thread Alan Cox
Author: alc Date: Sat Dec 21 22:32:24 2019 New Revision: 355991 URL: https://svnweb.freebsd.org/changeset/base/355991 Log: Micro-optimize the control flow in _pmap_unwire_ptp(), and eliminate unnecessary parentheses. Reviewed by: kib, markj MFC after:1 week Differential Revision:

svn commit: r355946 - in head/sys: amd64/amd64 arm64/arm64

2019-12-20 Thread Alan Cox
Author: alc Date: Fri Dec 20 20:46:26 2019 New Revision: 355946 URL: https://svnweb.freebsd.org/changeset/base/355946 Log: Correct a mistakenly inverted condition in r355833. Noticed by: kib X-MFC with: r355833 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c Mo

svn commit: r355883 - in head/sys: amd64/amd64 arm64/arm64

2019-12-18 Thread Alan Cox
Author: alc Date: Wed Dec 18 18:21:39 2019 New Revision: 355883 URL: https://svnweb.freebsd.org/changeset/base/355883 Log: When pmap_enter_{l2,pde}() are called to create a kernel mapping, they are incrementing (and decrementing) the ref_count on kernel page table pages. They should not do t

svn commit: r355787 - head/sys/arm64/arm64

2019-12-15 Thread Alan Cox
Author: alc Date: Sun Dec 15 22:41:57 2019 New Revision: 355787 URL: https://svnweb.freebsd.org/changeset/base/355787 Log: Apply a small optimization to pmap_remove_l3_range(). Specifically, hoist a PHYS_TO_VM_PAGE() operation that always returns the same vm_page_t out of the loop. (Since

svn commit: r355427 - head/sys/arm64/arm64

2019-12-05 Thread Alan Cox
Author: alc Date: Thu Dec 5 19:25:49 2019 New Revision: 355427 URL: https://svnweb.freebsd.org/changeset/base/355427 Log: On a context switch, handle the possibility that the old thread was preempted after an "ic" or "tlbi" instruction but before it performed a "dsb" instruction. The "ic"

Re: svn commit: r355145 - head/sys/arm64/arm64

2019-11-29 Thread Alan Cox
On 11/28/19 7:52 AM, Konstantin Belousov wrote: On Thu, Nov 28, 2019 at 09:17:15AM +, Andrew Turner wrote: On 28 Nov 2019, at 08:48, Michal Meloun wrote: On 27.11.2019 21:33, Alan Cox wrote: Author: alc Date: Wed Nov 27 20:33:49 2019 New Revision: 355145 URL: https

svn commit: r355145 - head/sys/arm64/arm64

2019-11-27 Thread Alan Cox
Author: alc Date: Wed Nov 27 20:33:49 2019 New Revision: 355145 URL: https://svnweb.freebsd.org/changeset/base/355145 Log: There is no reason why we need to pin the underlying thread to its current processor in pmap_invalidate_{all,page,range}(). These functions are using an instruction tha

svn commit: r354898 - head/sys/arm64/arm64

2019-11-20 Thread Alan Cox
Author: alc Date: Wed Nov 20 16:32:13 2019 New Revision: 354898 URL: https://svnweb.freebsd.org/changeset/base/354898 Log: Until every possible root cause for an "invalid ASID" assertion failure is resolved, assign every pmap a valid ASID when it is first initialized. Modified: head/sys/arm

svn commit: r354860 - head/sys/arm64/arm64

2019-11-19 Thread Alan Cox
Author: alc Date: Tue Nov 19 19:05:05 2019 New Revision: 354860 URL: https://svnweb.freebsd.org/changeset/base/354860 Log: Achieve two goals at once: (1) Avoid an unnecessary broadcast TLB invalidation in reclaim_pv_chunk(). (2) Prevent an "invalid ASID" assertion failure in reclaim_pv_chunk

svn commit: r354792 - head/sys/arm64/arm64

2019-11-17 Thread Alan Cox
Author: alc Date: Sun Nov 17 17:38:53 2019 New Revision: 354792 URL: https://svnweb.freebsd.org/changeset/base/354792 Log: Achieve two goals at once: (1) Avoid an unnecessary broadcast TLB invalidation in pmap_remove_all(). (2) Prevent an "invalid ASID" assertion failure in pmap_remove_all()

svn commit: r354585 - head/sys/arm64/arm64

2019-11-09 Thread Alan Cox
Author: alc Date: Sun Nov 10 05:22:01 2019 New Revision: 354585 URL: https://svnweb.freebsd.org/changeset/base/354585 Log: Eliminate a redundant pmap_load() from pmap_remove_pages(). There is no reason why the pmap_invalidate_all() in pmap_remove_pages() must be performed before the final

svn commit: r354286 - in head/sys/arm64: arm64 include

2019-11-03 Thread Alan Cox
Author: alc Date: Sun Nov 3 17:45:30 2019 New Revision: 354286 URL: https://svnweb.freebsd.org/changeset/base/354286 Log: Utilize ASIDs to reduce both the direct and indirect costs of context switching. The indirect costs being unnecessary TLB misses that are incurred when ASIDs are not us

svn commit: r353163 - in head/sys: arm64/include riscv/include

2019-10-06 Thread Alan Cox
Author: alc Date: Mon Oct 7 04:22:03 2019 New Revision: 353163 URL: https://svnweb.freebsd.org/changeset/base/353163 Log: Eliminate an unused declaration. The variable in question is only defined and used on sparc64. MFC after:1 week Modified: head/sys/arm64/include/vmparam.h h

svn commit: r353162 - head/sys/arm64/arm64

2019-10-06 Thread Alan Cox
Author: alc Date: Mon Oct 7 03:37:28 2019 New Revision: 353162 URL: https://svnweb.freebsd.org/changeset/base/353162 Log: Eliminate a redundant bzero(). The l0 page table page was already zeroed by efi_1t1_page(). MFC after:1 week Modified: head/sys/arm64/arm64/efirt_machdep.c M

svn commit: r353096 - head/sys/arm64/include

2019-10-03 Thread Alan Cox
Author: alc Date: Fri Oct 4 03:55:53 2019 New Revision: 353096 URL: https://svnweb.freebsd.org/changeset/base/353096 Log: The implementation of arm64_tlb_flushID_SE() was removed from cpufunc_asm.S in r313347. Eliminate its declaration from this file. MFC after:1 week Modified: h

svn commit: r352930 - head/sys/arm64/arm64

2019-10-01 Thread Alan Cox
Author: alc Date: Tue Oct 1 15:33:47 2019 New Revision: 352930 URL: https://svnweb.freebsd.org/changeset/base/352930 Log: In short, pmap_enter_quick_locked("user space", ..., VM_PROT_READ) doesn't work. More precisely, it doesn't set ATTR_AP(ATTR_AP_USER) in the page table entry, so any at

svn commit: r352847 - head/sys/arm64/arm64

2019-09-28 Thread Alan Cox
Author: alc Date: Sat Sep 28 17:16:03 2019 New Revision: 352847 URL: https://svnweb.freebsd.org/changeset/base/352847 Log: Eliminate redundant calls to critical_enter() and critical_exit() from pmap_update_entry(). It suffices that interrupts are blocked. Reviewed by: andrew, markj MF

svn commit: r352584 - head/sys/arm64/arm64

2019-09-21 Thread Alan Cox
Author: alc Date: Sat Sep 21 19:51:57 2019 New Revision: 352584 URL: https://svnweb.freebsd.org/changeset/base/352584 Log: In case a translation fault on the kernel address space occurs from within a critical section, we must perform a lock-free check on the faulting address. Reported b

svn commit: r350741 - in head/sys/arm64: arm64 include

2019-08-07 Thread Alan Cox
Author: alc Date: Thu Aug 8 06:26:34 2019 New Revision: 350741 URL: https://svnweb.freebsd.org/changeset/base/350741 Log: Ordinarily, during a superpage promotion or demotion within a pmap, the pmap's lock ensures that other operations on the pmap don't observe the old mapping being broken

svn commit: r350579 - head/sys/arm64/arm64

2019-08-04 Thread Alan Cox
Author: alc Date: Mon Aug 5 02:44:04 2019 New Revision: 350579 URL: https://svnweb.freebsd.org/changeset/base/350579 Log: Enable superpage promotion within the kernel pmap. Reviewed by: markj X-MFC after: r350004 Differential Revision:https://reviews.freebsd.org/D21149 Modif

svn commit: r350546 - head/sys/arm64/arm64

2019-08-02 Thread Alan Cox
Author: alc Date: Fri Aug 2 22:36:42 2019 New Revision: 350546 URL: https://svnweb.freebsd.org/changeset/base/350546 Log: Because of AArch64's weak memory consistency model, we need to include a memory barrier between the stores for initializing a page table page and the store for adding th

svn commit: r350463 - in head/sys: amd64/amd64 arm64/arm64 i386/i386

2019-07-30 Thread Alan Cox
Author: alc Date: Wed Jul 31 05:38:39 2019 New Revision: 350463 URL: https://svnweb.freebsd.org/changeset/base/350463 Log: In pmap_advise(), when we encounter a superpage mapping, we first demote the mapping and then destroy one of the 4 KB page mappings so that there is a potential trigger

svn commit: r350347 - head/sys/arm64/arm64

2019-07-25 Thread Alan Cox
Author: alc Date: Fri Jul 26 05:07:09 2019 New Revision: 350347 URL: https://svnweb.freebsd.org/changeset/base/350347 Log: Implement pmap_advise(). (Without a working pmap_advise() implementation madvise(MADV_DONTNEED) and madvise(MADV_FREE) are NOPs.) Reviewed by: markj X-MFC after:

svn commit: r350335 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 riscv/riscv

2019-07-25 Thread Alan Cox
Author: alc Date: Thu Jul 25 22:02:55 2019 New Revision: 350335 URL: https://svnweb.freebsd.org/changeset/base/350335 Log: Simplify the handling of superpages in pmap_clear_modify(). Specifically, if a demotion succeeds, then all of the 4KB page mappings within the superpage-sized region mu

svn commit: r350202 - head/sys/arm64/arm64

2019-07-21 Thread Alan Cox
Author: alc Date: Sun Jul 21 17:00:19 2019 New Revision: 350202 URL: https://svnweb.freebsd.org/changeset/base/350202 Log: With the introduction of software dirty bit emulation for managed mappings, we should test ATTR_SW_DBM, not ATTR_AP_RW, to determine whether to set PGA_WRITEABLE. In ef

svn commit: r350191 - head/sys/arm64/arm64

2019-07-20 Thread Alan Cox
Author: alc Date: Sun Jul 21 03:26:26 2019 New Revision: 350191 URL: https://svnweb.freebsd.org/changeset/base/350191 Log: Introduce pmap_store(), and use it to replace pmap_load_store() in places where the page table entry was previously invalid. (Note that I did not replace pmap_load_stor

svn commit: r350021 - head/sys/i386/i386

2019-07-15 Thread Alan Cox
Author: alc Date: Tue Jul 16 03:09:03 2019 New Revision: 350021 URL: https://svnweb.freebsd.org/changeset/base/350021 Log: Revert r349973. Upon further reflection, I realized that the comment deleted by r349973 is still valid on i386. Restore it. Discussed with: markj Modified

svn commit: r349975 - head/sys/arm64/arm64

2019-07-13 Thread Alan Cox
Author: alc Date: Sat Jul 13 16:32:19 2019 New Revision: 349975 URL: https://svnweb.freebsd.org/changeset/base/349975 Log: Revert r349442, which was a workaround for bus errors caused by an errant TLB entry. Specifically, at the start of pmap_enter_quick_locked(), we would sometimes have a

svn commit: r349973 - head/sys/i386/i386

2019-07-13 Thread Alan Cox
Author: alc Date: Sat Jul 13 15:53:28 2019 New Revision: 349973 URL: https://svnweb.freebsd.org/changeset/base/349973 Log: Remove a stale comment. Reported by: markj MFC after:1 week Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c =

svn commit: r349905 - head/sys/arm64/arm64

2019-07-10 Thread Alan Cox
Author: alc Date: Thu Jul 11 02:43:23 2019 New Revision: 349905 URL: https://svnweb.freebsd.org/changeset/base/349905 Log: According to Section D5.10.3 "Maintenance requirements on changing System register values" of the architecture manual, an isb instruction should be executed after updati

svn commit: r349866 - head/sys/arm64/arm64

2019-07-09 Thread Alan Cox
Author: alc Date: Tue Jul 9 20:28:53 2019 New Revision: 349866 URL: https://svnweb.freebsd.org/changeset/base/349866 Log: Introduce pmap_clear(), which zeroes a page table entry, and use it, instead of pmap_load_clear(), in places where we don't care about the page table entry's prior conte

svn commit: r349798 - head/sys/arm64/arm64

2019-07-06 Thread Alan Cox
Author: alc Date: Sun Jul 7 06:06:48 2019 New Revision: 349798 URL: https://svnweb.freebsd.org/changeset/base/349798 Log: Three changes to pmap_enter(): 1. Use _pmap_alloc_l3() instead of pmap_alloc_l3() in order to handle the possibility that a superpage mapping for "va" was created whi

svn commit: r349768 - head/sys/arm64/arm64

2019-07-05 Thread Alan Cox
Author: alc Date: Fri Jul 5 20:01:06 2019 New Revision: 349768 URL: https://svnweb.freebsd.org/changeset/base/349768 Log: Restructure cache_handle_range to avoid repeated barriers. Specifically, restructure cache_handle_range so that all of the data cache operations are performed before an

svn commit: r349760 - head/sys/riscv/riscv

2019-07-04 Thread Alan Cox
Author: alc Date: Fri Jul 5 05:23:23 2019 New Revision: 349760 URL: https://svnweb.freebsd.org/changeset/base/349760 Log: Merge r349526 from amd64. When we protect an L3 entry, we only call vm_page_dirty() when, in fact, we are write protecting the page and the L3 entry has PTE_D set. How

svn commit: r349618 - head/sys/arm64/arm64

2019-07-02 Thread Alan Cox
Author: alc Date: Tue Jul 2 23:02:52 2019 New Revision: 349618 URL: https://svnweb.freebsd.org/changeset/base/349618 Log: Implement pmap_copy(). (This includes the changes applied to the amd64 pmap_copy() in r349585.) Reviewed by: kib, markj Differential Revision:https://revi

svn commit: r349585 - head/sys/amd64/amd64

2019-07-01 Thread Alan Cox
Author: alc Date: Mon Jul 1 22:00:42 2019 New Revision: 349585 URL: https://svnweb.freebsd.org/changeset/base/349585 Log: Tidy up pmap_copy(). Notably, deindent the innermost loop by making a simple change to the control flow. Replace an unnecessary test by a KASSERT. Add a comment expla

svn commit: r349526 - in head/sys: amd64/amd64 i386/i386

2019-06-28 Thread Alan Cox
Author: alc Date: Fri Jun 28 22:40:34 2019 New Revision: 349526 URL: https://svnweb.freebsd.org/changeset/base/349526 Log: When we protect PTEs (as opposed to PDEs), we only call vm_page_dirty() when, in fact, we are write protecting the page and the PTE has PG_M set. However, pmap_protect_p

svn commit: r349442 - head/sys/arm64/arm64

2019-06-26 Thread Alan Cox
Author: alc Date: Wed Jun 26 21:43:41 2019 New Revision: 349442 URL: https://svnweb.freebsd.org/changeset/base/349442 Log: Revert one of the changes from r349323. Specifically, undo the change that replaced a pmap_invalidate_page() with a dsb(ishst) in pmap_enter_quick_locked(). Even thoug

svn commit: r349323 - head/sys/arm64/arm64

2019-06-23 Thread Alan Cox
Author: alc Date: Sun Jun 23 21:06:56 2019 New Revision: 349323 URL: https://svnweb.freebsd.org/changeset/base/349323 Log: pmap_enter_quick_locked() never replaces a valid mapping, so it need not perform a TLB invalidation. A barrier suffices. (See r343876.) Add a comment to pmap_enter_

svn commit: r349290 - head/sys/arm64/arm64

2019-06-22 Thread Alan Cox
Author: alc Date: Sat Jun 22 16:26:38 2019 New Revision: 349290 URL: https://svnweb.freebsd.org/changeset/base/349290 Log: Introduce pmap_remove_l3_range() and use it in two places: (1) pmap_remove(), where it eliminates redundant TLB invalidations by pmap_remove() and pmap_remove_l3(), and

svn commit: r349183 - head/sys/arm64/arm64

2019-06-18 Thread Alan Cox
Author: alc Date: Wed Jun 19 03:33:00 2019 New Revision: 349183 URL: https://svnweb.freebsd.org/changeset/base/349183 Log: Correct an error in r349122. pmap_unwire() should update the pmap's wired count, not its resident count. X-MFC with: r349122 Modified: head/sys/arm64/arm64/pmap

svn commit: r349129 - head/sys/arm64/arm64

2019-06-16 Thread Alan Cox
Author: alc Date: Mon Jun 17 01:58:25 2019 New Revision: 349129 URL: https://svnweb.freebsd.org/changeset/base/349129 Log: Eliminate a redundant call to pmap_invalidate_page() from pmap_ts_referenced(). MFC after:14 days Differential Revision:https://reviews.freebsd.org/D127

svn commit: r349122 - head/sys/arm64/arm64

2019-06-16 Thread Alan Cox
Author: alc Date: Sun Jun 16 22:13:27 2019 New Revision: 349122 URL: https://svnweb.freebsd.org/changeset/base/349122 Log: Three changes to arm64's pmap_unwire(): Implement wiring changes on superpage mappings. Previously, a superpage mapping was unconditionally demoted by pmap_unwire(),

svn commit: r349117 - head/sys/arm64/arm64

2019-06-16 Thread Alan Cox
Author: alc Date: Sun Jun 16 16:45:01 2019 New Revision: 349117 URL: https://svnweb.freebsd.org/changeset/base/349117 Log: Three enhancements to arm64's pmap_protect(): Implement protection changes on superpage mappings. Previously, a superpage mapping was unconditionally demoted by pmap

svn commit: r349070 - head/sys/arm64/arm64

2019-06-15 Thread Alan Cox
Author: alc Date: Sat Jun 15 17:26:42 2019 New Revision: 349070 URL: https://svnweb.freebsd.org/changeset/base/349070 Log: Previously, when pmap_remove_pages() destroyed a dirty superpage mapping, it only called vm_page_dirty() on the first of the superpage's constituent 4KB pages. This rev

svn commit: r349042 - head/sys/arm64/arm64

2019-06-14 Thread Alan Cox
Author: alc Date: Fri Jun 14 22:06:43 2019 New Revision: 349042 URL: https://svnweb.freebsd.org/changeset/base/349042 Log: Batch the TLB invalidations that are performed by pmap_protect() rather than performing them one at a time. MFC after:10 days Modified: head/sys/arm64/arm64/pm

svn commit: r349031 - head/sys/arm64/arm64

2019-06-13 Thread Alan Cox
Author: alc Date: Fri Jun 14 04:01:08 2019 New Revision: 349031 URL: https://svnweb.freebsd.org/changeset/base/349031 Log: Change the arm64 pmap so that updates to the global count of wired pages are not performed directly by the pmap. Instead, they are performed by vm_page_free_pages_toq()

svn commit: r349003 - head/sys/arm64/arm64

2019-06-12 Thread Alan Cox
Author: alc Date: Wed Jun 12 20:38:49 2019 New Revision: 349003 URL: https://svnweb.freebsd.org/changeset/base/349003 Log: Change pmap_demote_l2_locked() so that it removes the superpage mapping on a demotion failure. Otherwise, some callers to pmap_demote_l2_locked(), such as pmap_protect(

svn commit: r348829 - head/sys/riscv/riscv

2019-06-08 Thread Alan Cox
Author: alc Date: Sun Jun 9 05:55:58 2019 New Revision: 348829 URL: https://svnweb.freebsd.org/changeset/base/348829 Log: Correct a new KASSERT() in r348828. X-MFC with: r348828 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ==

svn commit: r348828 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 riscv/riscv

2019-06-08 Thread Alan Cox
Author: alc Date: Sun Jun 9 03:36:10 2019 New Revision: 348828 URL: https://svnweb.freebsd.org/changeset/base/348828 Log: Implement an alternative solution to the amd64 and i386 pmap problem that we previously addressed in r348246. This pmap problem also exists on arm64 and riscv. Howev

svn commit: r348630 - head/sys/amd64/amd64

2019-06-04 Thread Alan Cox
Author: alc Date: Tue Jun 4 16:21:14 2019 New Revision: 348630 URL: https://svnweb.freebsd.org/changeset/base/348630 Log: The changes to pmap_demote_pde_locked()'s control flow in r348476 resulted in the loss of a KASSERT that guarded against the invalidation a wired mapping. Restore this

svn commit: r348525 - head/sys/vm

2019-06-02 Thread Alan Cox
Author: alc Date: Mon Jun 3 05:15:36 2019 New Revision: 348525 URL: https://svnweb.freebsd.org/changeset/base/348525 Log: Retire vm_reserv_extend_{contig,page}(). These functions were introduced as part of a false start toward fine-grained reservation locking. In the end, they were not ne

svn commit: r341766 - head/sys/kern

2018-12-09 Thread Alan Cox
Author: alc Date: Sun Dec 9 17:55:10 2018 New Revision: 341766 URL: https://svnweb.freebsd.org/changeset/base/341766 Log: blst_leaf_alloc updates bighint for a leaf when an allocation is successful and includes the last block represented by the leaf. The reasoning is that, if the last bloc

svn commit: r341602 - head/sys/kern

2018-12-05 Thread Alan Cox
Author: alc Date: Wed Dec 5 18:26:40 2018 New Revision: 341602 URL: https://svnweb.freebsd.org/changeset/base/341602 Log: Terminate a blist_alloc search when a blst_meta_alloc call fails with cursor == 0. Every call to blst_meta_alloc but the one at the root is made only when the meta-

svn commit: r340914 - head/sys/kern

2018-11-24 Thread Alan Cox
Author: alc Date: Sat Nov 24 21:52:10 2018 New Revision: 340914 URL: https://svnweb.freebsd.org/changeset/base/340914 Log: blist_meta_alloc assumes that mask=scan->bm_bitmap is nonzero. But if the cursor lies in the middle of the space that the meta node represents, then blanking the low bi

svn commit: r340637 - head/sys/vm

2018-11-19 Thread Alan Cox
Author: alc Date: Mon Nov 19 17:17:23 2018 New Revision: 340637 URL: https://svnweb.freebsd.org/changeset/base/340637 Log: Use swp_pager_isondev() throughout. Submitted by: o...@j.email.ne.jp Change swp_pager_isondev()'s return type to bool. Reviewed by: kib MFC after:1 week

svn commit: r340546 - head/sys/vm

2018-11-17 Thread Alan Cox
Author: alc Date: Sun Nov 18 01:27:17 2018 New Revision: 340546 URL: https://svnweb.freebsd.org/changeset/base/340546 Log: Tidy up vm_map_simplify_entry() and its recently introduced helper functions. Notably, reflow the text of some comments so that they occupy fewer lines, and introduce a

svn commit: r339819 - head/sys/vm

2018-10-27 Thread Alan Cox
Author: alc Date: Sat Oct 27 17:49:46 2018 New Revision: 339819 URL: https://svnweb.freebsd.org/changeset/base/339819 Log: Eliminate typically pointless calls to vm_fault_prefault() on soft, copy- on-write faults. On a page fault, when we call vm_fault_prefault(), it probes the pmap and the

svn commit: r338912 - head/sys/vm

2018-09-24 Thread Alan Cox
Author: alc Date: Mon Sep 24 16:49:02 2018 New Revision: 338912 URL: https://svnweb.freebsd.org/changeset/base/338912 Log: Passing UMA_ZONE_NOFREE to uma_zcreate() for swpctrie_zone and swblk_zone is redundant, because uma_zone_reserve_kva() is performed on both zones and it sets this same f

svn commit: r338431 - head/sys/vm

2018-09-02 Thread Alan Cox
Author: alc Date: Sun Sep 2 18:29:38 2018 New Revision: 338431 URL: https://svnweb.freebsd.org/changeset/base/338431 Log: Recent changes have created, for the first time, physical memory segments that can be coalesced. To be clear, fragmentation of phys_avail[] is not the cause. This frag

svn commit: r338318 - in head/sys: amd64/amd64 arm/allwinner arm/arm arm/freescale/imx arm/nvidia arm64/arm64 compat/linuxkpi/common/include/linux compat/linuxkpi/common/src dev/agp dev/amd_ecc_inj...

2018-08-25 Thread Alan Cox
Author: alc Date: Sat Aug 25 19:38:08 2018 New Revision: 338318 URL: https://svnweb.freebsd.org/changeset/base/338318 Log: Eliminate the arena parameter to kmem_free(). Implicitly this corrects an error in the function hypercall_memfree(), where the wrong arena was being passed to kmem_free

svn commit: r338143 - in head/sys: amd64/amd64 arm/arm arm64/arm64 compat/linuxkpi/common/src dev/hyperv/vmbus i386/i386 mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 vm x86/xen

2018-08-21 Thread Alan Cox
Author: alc Date: Tue Aug 21 16:43:46 2018 New Revision: 338143 URL: https://svnweb.freebsd.org/changeset/base/338143 Log: Eliminate kmem_malloc()'s unused arena parameter. (The arena parameter became unused in FreeBSD 12.x as a side-effect of the NUMA-related changes.) Reviewed by: k

Re: svn commit: r338018 - head/sys/vm

2018-08-20 Thread Alan Cox
On 08/20/2018 13:36, O. Hartmann wrote: > Am Sat, 18 Aug 2018 18:33:50 + (UTC) > Alan Cox schrieb: > > > Author: alc > > Date: Sat Aug 18 18:33:50 2018 > > New Revision: 338018 > > URL: https://svnweb.freebsd.org/changeset/base/338018 > > > L

svn commit: r338107 - in head/sys: arm/allwinner arm/arm arm/freescale/imx arm/nvidia arm/nvidia/drm2 arm/samsung/exynos arm64/arm64 compat/linuxkpi/common/include/linux compat/linuxkpi/common/src ...

2018-08-20 Thread Alan Cox
Author: alc Date: Mon Aug 20 15:57:27 2018 New Revision: 338107 URL: https://svnweb.freebsd.org/changeset/base/338107 Log: Eliminate kmem_alloc_contig()'s unused arena parameter. Reviewed by: hselasky, kib, markj Discussed with: jeff Differential Revision:https://reviews.

svn commit: r338032 - in head/sys: arm/arm arm64/arm64 dev/agp mips/mips

2018-08-18 Thread Alan Cox
Author: alc Date: Sat Aug 18 22:35:19 2018 New Revision: 338032 URL: https://svnweb.freebsd.org/changeset/base/338032 Log: Oops. r338030 didn't eliminate the unused arena argument from all of kmem_alloc_attr()'s callers. Correct that mistake. Modified: head/sys/arm/arm/busdma_machdep-v4.c

svn commit: r338030 - in head/sys: dev/amd_ecc_inject dev/drm dev/drm2 vm

2018-08-18 Thread Alan Cox
Author: alc Date: Sat Aug 18 22:07:48 2018 New Revision: 338030 URL: https://svnweb.freebsd.org/changeset/base/338030 Log: Eliminate the unused arena parameter from kmem_alloc_attr(). Reviewed by: kib, markj Differential Revision:https://reviews.freebsd.org/D16793 Modified: he

svn commit: r338018 - head/sys/vm

2018-08-18 Thread Alan Cox
Author: alc Date: Sat Aug 18 18:33:50 2018 New Revision: 338018 URL: https://svnweb.freebsd.org/changeset/base/338018 Log: Eliminate the arena parameter to kmem_malloc_domain(). It is redundant. The domain and flags parameters suffice. In fact, the related functions kmem_alloc_{attr,contig

svn commit: r337652 - head/sys/kern

2018-08-11 Thread Alan Cox
Author: alc Date: Sat Aug 11 19:21:53 2018 New Revision: 337652 URL: https://svnweb.freebsd.org/changeset/base/337652 Log: Eliminate a redundant assignment. MFC after:1 week Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c =

svn commit: r337463 - in head/sys: arm/arm arm/include vm

2018-08-08 Thread Alan Cox
Author: alc Date: Wed Aug 8 16:55:01 2018 New Revision: 337463 URL: https://svnweb.freebsd.org/changeset/base/337463 Log: Add support for pmap_enter(..., psind=1) to the armv6 pmap. In other words, add support for explicitly requesting that pmap_enter() create a 1 MB page mapping. (Essent

svn commit: r337443 - head/sys/vm

2018-08-07 Thread Alan Cox
Author: alc Date: Wed Aug 8 02:30:34 2018 New Revision: 337443 URL: https://svnweb.freebsd.org/changeset/base/337443 Log: Defer and aggregate swap_pager_meta_build frees. Before swp_pager_meta_build replaces an old swapblk with an new one, it frees the old one. To allow such freeing of

svn commit: r337282 - head/contrib/llvm/tools/lld/ELF/Arch

2018-08-03 Thread Alan Cox
Author: alc Date: Sat Aug 4 02:30:51 2018 New Revision: 337282 URL: https://svnweb.freebsd.org/changeset/base/337282 Log: Set the default image base on arm64 and i386 to a superpage-aligned address. Reviewed by: emaste, markj Discussed with: dim Differential Revision:h

svn commit: r336984 - head/sys/vm

2018-07-31 Thread Alan Cox
Author: alc Date: Tue Jul 31 17:41:48 2018 New Revision: 336984 URL: https://svnweb.freebsd.org/changeset/base/336984 Log: Allow vm object coalescing to occur in the midst of a vm object when the OBJ_ONEMAPPING flag is set. In other words, allow recycling of existing but unused subranges of

svn commit: r336881 - head/sys/arm/arm

2018-07-29 Thread Alan Cox
Author: alc Date: Mon Jul 30 01:54:25 2018 New Revision: 336881 URL: https://svnweb.freebsd.org/changeset/base/336881 Log: Prepare for adding psind == 1 support to armv6's pmap_enter(). Precompute the new PTE before entering the critical section. Eliminate duplication of the pmap and p

svn commit: r336803 - head/sys/vm

2018-07-27 Thread Alan Cox
Author: alc Date: Sat Jul 28 04:06:33 2018 New Revision: 336803 URL: https://svnweb.freebsd.org/changeset/base/336803 Log: To date, mlockall(MCL_FUTURE) has had the unfortunate side effect of blocking vm map entry and object coalescing for the calling process. However, there is no reason tha

svn commit: r336589 - head/sys/arm64/arm64

2018-07-21 Thread Alan Cox
Author: alc Date: Sat Jul 21 21:26:38 2018 New Revision: 336589 URL: https://svnweb.freebsd.org/changeset/base/336589 Log: Eliminate a comment that doesn't apply to this pmap implementation. Coalesce the variable definitions for PV entry management. MFC after:3 weeks Modified: h

svn commit: r336557 - head/sys/i386/i386

2018-07-20 Thread Alan Cox
Author: alc Date: Fri Jul 20 16:31:25 2018 New Revision: 336557 URL: https://svnweb.freebsd.org/changeset/base/336557 Log: Annotate a parameter as unused. X-MFC with: r336288 Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ==

svn commit: r336491 - head/sys/vm

2018-07-19 Thread Alan Cox
Author: alc Date: Thu Jul 19 17:01:10 2018 New Revision: 336491 URL: https://svnweb.freebsd.org/changeset/base/336491 Log: Revert r329254. The underlying cause for the copy-on-write problem in multithreaded programs that was addressed by r329254 was in the implementation of pmap_enter() on

svn commit: r336314 - head/sys/vm

2018-07-15 Thread Alan Cox
Author: alc Date: Sun Jul 15 19:25:15 2018 New Revision: 336314 URL: https://svnweb.freebsd.org/changeset/base/336314 Log: Test PGA_REFERENCED after calling pmap_ts_referenced(), rather than before, so that a reference from a concurrently destroyed mapping is observed during the current scan

svn commit: r336294 - head/sys/riscv/riscv

2018-07-14 Thread Alan Cox
Author: alc Date: Sat Jul 14 20:14:00 2018 New Revision: 336294 URL: https://svnweb.freebsd.org/changeset/base/336294 Log: Invalidate the mapping before updating its physical address. Doing so ensures that all threads sharing the pmap have a consistent view of the mapping. This fixes the

svn commit: r336290 - head/sys/i386/include

2018-07-14 Thread Alan Cox
Author: alc Date: Sat Jul 14 19:35:41 2018 New Revision: 336290 URL: https://svnweb.freebsd.org/changeset/base/336290 Log: Correct some typos. Reviewed by: kib Modified: head/sys/i386/include/vmparam.h Modified: head/sys/i386/include/vmparam.h ==

svn commit: r336288 - in head/sys: i386/i386 i386/include vm

2018-07-14 Thread Alan Cox
Author: alc Date: Sat Jul 14 17:20:27 2018 New Revision: 336288 URL: https://svnweb.freebsd.org/changeset/base/336288 Log: Add support for pmap_enter(..., psind=1) to the i386 pmap. In other words, add support for explicitly requesting that pmap_enter() create a 2 or 4 MB page mapping. (Es

svn commit: r336248 - head/sys/mips/mips

2018-07-13 Thread Alan Cox
Author: alc Date: Fri Jul 13 17:12:50 2018 New Revision: 336248 URL: https://svnweb.freebsd.org/changeset/base/336248 Log: Invalidate the mapping before updating its physical address. Doing so ensures that all threads sharing the pmap have a consistent view of the mapping. This fixes the

svn commit: r336175 - head/sys/i386/i386

2018-07-10 Thread Alan Cox
Author: alc Date: Tue Jul 10 18:00:55 2018 New Revision: 336175 URL: https://svnweb.freebsd.org/changeset/base/336175 Log: Eliminate unnecessary differences between i386's pmap_enter() and amd64's. For example, fully construct the new PTE before entering the critical section. This change is

svn commit: r336092 - head/sys/i386/i386

2018-07-08 Thread Alan Cox
Author: alc Date: Sun Jul 8 16:51:54 2018 New Revision: 336092 URL: https://svnweb.freebsd.org/changeset/base/336092 Log: Invalidate the mapping before updating its physical address. Doing so ensures that all threads sharing the pmap have a consistent view of the mapping. This fixes the

svn commit: r335972 - head/sys/vm

2018-07-04 Thread Alan Cox
Author: alc Date: Thu Jul 5 02:08:57 2018 New Revision: 335972 URL: https://svnweb.freebsd.org/changeset/base/335972 Log: Allow callers to vm_phys_split_pages() to specify whether insertion should occur at the head or the tail of the page queues. Modified: head/sys/vm/vm_phys.c Modified:

svn commit: r335971 - head/sys/amd64/amd64

2018-07-04 Thread Alan Cox
Author: alc Date: Thu Jul 5 02:04:18 2018 New Revision: 335971 URL: https://svnweb.freebsd.org/changeset/base/335971 Log: As of r335784, if pmap_enter() replaces a managed mapping by an unmanaged mapping, then it leaks the unlinked PV entry. This change eliminates that leak, freeing the PV

svn commit: r335865 - head/sys/vm

2018-07-02 Thread Alan Cox
Author: alc Date: Mon Jul 2 17:18:46 2018 New Revision: 335865 URL: https://svnweb.freebsd.org/changeset/base/335865 Log: Introduce vm_phys_enq_range(), and call it in vm_phys_alloc_npages() and vm_phys_alloc_seg_contig() instead of vm_phys_free_contig(). In short, vm_phys_enq_range() is s

svn commit: r335790 - head/sys/vm

2018-06-28 Thread Alan Cox
Author: alc Date: Fri Jun 29 04:08:14 2018 New Revision: 335790 URL: https://svnweb.freebsd.org/changeset/base/335790 Log: Three changes to vm_phys_alloc_seg_contig(): 1. Optimize the order computation. 2. Update the pool for all of the chunks that are removed from the free page l

svn commit: r335767 - head/sys/vm

2018-06-28 Thread Alan Cox
Author: alc Date: Thu Jun 28 17:52:06 2018 New Revision: 335767 URL: https://svnweb.freebsd.org/changeset/base/335767 Log: Reflow one of the comments describing vm_phys_alloc_npages(). Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ===

svn commit: r335674 - head/sys/vm

2018-06-26 Thread Alan Cox
Author: alc Date: Tue Jun 26 18:29:56 2018 New Revision: 335674 URL: https://svnweb.freebsd.org/changeset/base/335674 Log: Update the physical page selection strategy used by vm_page_import() so that it does not cause rapid fragmentation of the free physical memory. Reviewed by: jeff, ma

  1   2   3   4   5   6   7   8   9   10   >