1. 18 Aug, 2019 1 commit
  2. 16 Aug, 2019 1 commit
    • Aleksandr Rybalko's avatar
      Check paddr for overflow. · 6b821a74
      Aleksandr Rybalko authored
      Fix panic on initialize of "vm reserv" per-superpage lock in case when RAM ends at upper boundary of address space.
      Observed on ARM32 board BPI-R2 (2GB RAM 0x80000000-0xffffffff).
      
      PR:		235362
      Reviewed by:	kib, markj, alc
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D21272
      6b821a74
  3. 06 Jun, 2019 1 commit
    • Doug Moore's avatar
      The means of finding ranges of free pages was changed for · f96e8a0b
      Doug Moore authored
      vm_reserv_break in r348484, and there was found to improve performance
      minutely and reduce code size. This change applies a similar change to
      vm_reserv_reclaim_config, expecting similar benefits. This change also
      allows quick rejection of page ranges that are unsuitable on account
      of alignment or boundary issues, where those issues are processed a
      page at a time in the current implementation.  For contrived test
      cases, this can make finding a reservation satisfying a major
      alignment requirement around 30 times faster.
      
      Tested by: pho
      Approved by: markj (mentor)
      Differential Revision: https://reviews.freebsd.org/D20274
      f96e8a0b
  4. 03 Jun, 2019 1 commit
    • Alan Cox's avatar
      Retire vm_reserv_extend_{contig,page}(). These functions were introduced · 2d5039db
      Alan Cox authored
      as part of a false start toward fine-grained reservation locking.  In the
      end, they were not needed, so eliminate them.
      
      Order the parameters to vm_reserv_alloc_{contig,page}() consistently with
      the vm_page functions that call them.
      
      Update the comments about the locking requirements for
      vm_reserv_alloc_{contig,page}().  They no longer require a free page
      queues lock.
      
      Wrap several lines that became too long after the "req" and "domain"
      parameters were added to vm_reserv_alloc_{contig,page}().
      
      Reviewed by:	kib, markj
      MFC after:	1 week
      Differential Revision:	https://reviews.freebsd.org/D20492
      2d5039db
  5. 31 May, 2019 1 commit
    • Doug Moore's avatar
      The function vm_phys_free_contig invokes vm_phys_free_pages for every · b8590dae
      Doug Moore authored
      power-of-two page block it frees, launching an unsuccessful search for
      a buddy to pair up with each time.  The only possible buddy-up mergers
      are across the boundaries of the freed region, so change
      vm_phys_free_contig simply to enqueue the freed interior blocks, via a
      new function vm_phys_enqueue_contig, and then call vm_phys_free_pages
      on the bounding blocks to create as big a cross-boundary block as
      possible after buddy-merging.
      
      The only callers of vm_phys_free_contig at the moment call it in
      situations where merging blocks across the boundary is clearly
      impossible, so just call vm_phys_enqueue_contig in those places and
      avoid trying to buddy-up at all.
      
      One beneficiary of this change is in breaking reservations.  For the
      case where memory is freed in breaking a reservation with only the
      first and last pages allocated, the number of cycles consumed by the
      operation drops about 11% with this change.
      
      Suggested by: alc
      Reviewed by: alc
      Approved by: kib, markj (mentors)
      Differential Revision: https://reviews.freebsd.org/D16901
      b8590dae
  6. 28 May, 2019 1 commit
  7. 18 Jan, 2019 1 commit
    • Konstantin Belousov's avatar
      MI VM: Make it possible to set size of superpage at boot instead of compile time. · f2a496d6
      Konstantin Belousov authored
      In order to allow single kernel to use PAE pagetables on i386 if
      hardware supports it, and fall back to classic two-level paging
      structures if not, superpage code should be able to adopt to either 2M
      or 4M superpages size.  There I make MI VM structures large enough to
      track the biggest possible superpage, by allowing architecture to
      define VM_NFREEORDER_MAX and VM_LEVEL_0_ORDER_MAX constants.
      Corresponding VM_NFREEORDER and VM_LEVEL_0_ORDER symbols can be
      defined as runtime values and must be less than the _MAX constants.
      If architecture does not define _MAXs, it is assumed that _MAX ==
      normal constant.
      
      Reviewed by:	markj
      Tested by:	pho (as part of the larger patch)
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D18853
      f2a496d6
  8. 07 Jul, 2018 1 commit
  9. 23 Mar, 2018 2 commits
  10. 22 Mar, 2018 1 commit
  11. 15 Mar, 2018 1 commit
    • Jeff Roberson's avatar
      Eliminate pageout wakeup races. Take another step towards lockless · 30fbfdda
      Jeff Roberson authored
      vmd_free_count manipulation.  Reduce the scope of the free lock by
      using a pageout lock to synchronize sleep and wakeup.  Only trigger
      the pageout daemon on transitions between states.  Drive all wakeup
      operations directly as side-effects from freeing memory rather than
      requiring an additional function call.
      
      Reviewed by:	markj, kib
      Tested by:	pho
      Sponsored by:	Netflix, Dell/EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D14612
      30fbfdda
  12. 07 Mar, 2018 1 commit
  13. 23 Feb, 2018 1 commit
  14. 14 Feb, 2018 1 commit
  15. 13 Feb, 2018 1 commit
    • Konstantin Belousov's avatar
      Do not leak rv->psind in some specific situations. · c4be9169
      Konstantin Belousov authored
      Suppose that we have an object with a mapped superpage, and that all
      pages in the superpages are held (by some driver).  Additionally,
      suppose that the object is terminated, e.g. because the only process
      mapping it is exiting.  Then the reservation is broken, but the pages
      cannot be freed until later, when they are unheld.  In this situation,
      the reservation code cannot clean psind, since no pages are freed, and
      the page is freed and then reused with invalid psind.
      
      Clean psind on vm_reserv_break() to avoid the situation.
      
      Reported and tested by:	Slava Shwartsman
      Reviewed by:	markj
      Sponsored by:	Mellanox Technologies
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D14335
      c4be9169
  16. 06 Feb, 2018 1 commit
  17. 12 Jan, 2018 1 commit
  18. 28 Nov, 2017 1 commit
  19. 27 Nov, 2017 1 commit
    • Pedro F. Giffuni's avatar
      sys: general adoption of SPDX licensing ID tags. · fe267a55
      Pedro F. Giffuni authored
      Mainly focus on files that use BSD 2-Clause license, however the tool I
      was using misidentified many licenses so this was mostly a manual - error
      prone - task.
      
      The Software Package Data Exchange (SPDX) group provides a specification
      to make it easier for automated tools to detect and summarize well known
      opensource licenses. We are gradually adopting the specification, noting
      that the tags are considered only advisory and do not, in any way,
      superceed or replace the license texts.
      
      No functional change intended.
      fe267a55
  20. 23 Jul, 2017 1 commit
  21. 17 Apr, 2017 1 commit
  22. 28 Dec, 2016 1 commit
    • Alan Cox's avatar
      Relax the object type restrictions on vm_page_alloc_contig(). Specifically, · 920da7e4
      Alan Cox authored
      add support for object types that were previously prohibited because they
      could contain PG_CACHED pages.
      
      Roughly halve the number of radix trie operations performed by
      vm_page_alloc_contig() using the same approach that is employed by
      vm_page_alloc().  Also, eliminate the radix trie lookup performed with the
      free page queues lock held.
      
      Tidy up the handling of radix trie insert failures in vm_page_alloc() and
      vm_page_alloc_contig().
      
      Reviewed by:	kib, markj
      Tested by:	pho
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D8878
      920da7e4
  23. 12 Dec, 2016 1 commit
    • Alan Cox's avatar
      Eliminate every mention of PG_CACHED pages from the comments in the machine- · 3453bca8
      Alan Cox authored
      independent layer of the virtual memory system.  Update some of the nearby
      comments to eliminate redundancy and improve clarity.
      
      In vm/vm_reserv.c, do not use hyphens after adverbs ending in -ly per
      The Chicago Manual of Style.
      
      Update the comment in vm/vm_page.h defining the four types of page queues to
      reflect the elimination of PG_CACHED pages and the introduction of the
      laundry queue.
      
      Reviewed by:	kib, markj
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D8752
      3453bca8
  24. 15 Nov, 2016 1 commit
  25. 19 Dec, 2015 1 commit
    • Alan Cox's avatar
      Introduce a new mechanism for relocating virtual pages to a new physical · c869e672
      Alan Cox authored
      address and use this mechanism when:
      
      1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical
         memory allocator's free page lists.  This replaces the long-standing
         approach of scanning the inactive and inactive queues, converting clean
         pages into PG_CACHED pages and laundering dirty pages.  In contrast, the
         new mechanism does not use PG_CACHED pages nor does it trigger a large
         number of I/O operations.
      
      2. on 32-bit MIPS processors, uma_small_alloc() and the pmap can't find
         free pages in the physical memory allocator's free page lists that are
         covered by the direct map.  Tested by: adrian
      
      3. ttm_bo_global_init() and ttm_vm_page_alloc_dma32() can't find suitable
         free pages in the physical memory allocator's free page lists.
      
      In the coming months, I expect that this new mechanism will be applied in
      other places.  For example, balloon drivers should use relocation to
      minimize fragmentation of the guest physical address space.
      
      Make vm_phys_alloc_contig() a little smarter (and more efficient in some
      cases).  Specifically, use vm_phys_segs[] earlier to avoid scanning free
      page lists that can't possibly contain suitable pages.
      
      Reviewed by:	kib, markj
      Glanced at:	jhb
      Discussed with:	jeff
      Sponsored by:	EMC / Isilon Storage Division
      Differential Revision:	https://reviews.freebsd.org/D4444
      c869e672
  26. 26 Nov, 2015 1 commit
  27. 06 Aug, 2015 1 commit
  28. 08 Jun, 2015 1 commit
  29. 11 Apr, 2015 1 commit
  30. 14 Mar, 2015 1 commit
  31. 12 Mar, 2015 1 commit
  32. 08 Mar, 2015 1 commit
  33. 22 Nov, 2014 1 commit
  34. 10 Sep, 2014 1 commit
    • Alan Cox's avatar
      Fix a boundary case error in vm_reserv_alloc_contig(): If a reservation · 64f096ee
      Alan Cox authored
      isn't being allocated for the last of the requested pages, because a
      reservation won't fit in the gap between allocated pages, then the
      reservation structure shouldn't be initialized.
      
      While I'm here, improve the nearby comments.
      
      Reported by:	jeff, pho
      MFC after:	1 week
      Sponsored by:	EMC / Isilon Storage Division
      64f096ee
  35. 11 Jun, 2014 1 commit
    • Alan Cox's avatar
      Correct a bug in the management of the population map on big-endian · 3180f757
      Alan Cox authored
      machines.  Specifically, there was a mismatch between how the routine
      allocation and deallocation operations accessed the population map
      and how the aggressively optimized reservation-breaking operation
      accessed it.  So, problems only occurred when reservations were broken.
      This change makes the routine operations access the population map in
      the same way as the reservation breaking operation.
      
      This bug was introduced in r259999.
      
      PR:		187080
      Tested by:	jmg (on an "armeb" machine)
      Sponsored by:	EMC / Isilon Storage Division
      3180f757
  36. 07 Jun, 2014 1 commit
    • Alan Cox's avatar
      Add a page size field to struct vm_page. Increase the page size field when · dd05fa19
      Alan Cox authored
      a partially populated reservation becomes fully populated, and decrease this
      field when a fully populated reservation becomes partially populated.
      
      Use this field to simplify the implementation of pmap_enter_object() on
      amd64, arm, and i386.
      
      On all architectures where we support superpages, the cost of creating a
      superpage mapping is roughly the same as creating a base page mapping.  For
      example, both kinds of mappings entail the creation of a single PTE and PV
      entry.  With this in mind, use the page size field to make the
      implementation of vm_map_pmap_enter(..., MAP_PREFAULT_PARTIAL) a little
      smarter.  Previously, if MAP_PREFAULT_PARTIAL was specified to
      vm_map_pmap_enter(), that function would only map base pages.  Now, it will
      create up to 96 base page or superpage mappings.
      
      Reviewed by:	kib
      Sponsored by:	EMC / Isilon Storage Division
      dd05fa19
  37. 29 Dec, 2013 1 commit
  38. 28 Dec, 2013 1 commit
    • Alan Cox's avatar
      MFp4 alc_popmap · ec179322
      Alan Cox authored
        Change the way that reservations keep track of which pages are in use.
        Instead of using the page's PG_CACHED and PG_FREE flags, maintain a bit
        vector within the reservation.  This approach has a couple benefits.
        First, it makes breaking reservations much cheaper because there are
        fewer cache misses to identify the unused pages.  Second, it is a pre-
        requisite for supporting two or more reservation sizes.
      ec179322
  39. 17 Sep, 2013 1 commit