/share/man/man9/vm_map_wire.9

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 114 lines · 114 code · 0 blank · 0 comment · 0 complexity · 5f998d4d0bba9cb23ba81b233f4a7d72 MD5 · raw file

  1. .\"
  2. .\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
  3. .\" All rights reserved.
  4. .\"
  5. .\" Redistribution and use in source and binary forms, with or without
  6. .\" modification, are permitted provided that the following conditions
  7. .\" are met:
  8. .\" 1. Redistributions of source code must retain the above copyright
  9. .\" notice, this list of conditions and the following disclaimer.
  10. .\" 2. Redistributions in binary form must reproduce the above copyright
  11. .\" notice, this list of conditions and the following disclaimer in the
  12. .\" documentation and/or other materials provided with the distribution.
  13. .\"
  14. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  15. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  18. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  20. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  22. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24. .\" SUCH DAMAGE.
  25. .\"
  26. .\" $FreeBSD$
  27. .\"
  28. .Dd July 19, 2003
  29. .Dt VM_MAP_WIRE 9
  30. .Os
  31. .Sh NAME
  32. .Nm vm_map_wire ,
  33. .Nm vm_map_unwire
  34. .Nd manage page wiring within a virtual memory map
  35. .Sh SYNOPSIS
  36. .In sys/param.h
  37. .In vm/vm.h
  38. .In vm/vm_map.h
  39. .Ft int
  40. .Fn vm_map_wire "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int flags"
  41. .Ft int
  42. .Fo vm_map_unwire
  43. .Fa "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int flags"
  44. .Fc
  45. .Sh DESCRIPTION
  46. The
  47. .Fn vm_map_wire
  48. function is responsible for wiring pages in the range between
  49. .Fa start
  50. and
  51. .Fa end
  52. within the map
  53. .Fa map .
  54. Wired pages are locked into physical memory, and may not be paged out
  55. as long as their wire count remains above zero.
  56. .Pp
  57. The
  58. .Fn vm_map_unwire
  59. function performs the corresponding unwire operation.
  60. .Pp
  61. The
  62. .Fa flags
  63. argument is a bit mask, consisting of the following flags:
  64. .Pp
  65. If the
  66. .Dv VM_MAP_WIRE_USER
  67. flag is set, the function operates within user address space.
  68. .Pp
  69. If the
  70. .Dv VM_MAP_WIRE_HOLESOK
  71. flag is set, it may operate upon an arbitrary range within the
  72. address space of
  73. .Fa map .
  74. .Pp
  75. If a contiguous range is desired, callers should explicitly express
  76. their intent by specifying the
  77. .Dv VM_MAP_WIRE_NOHOLES
  78. flag.
  79. .Sh IMPLEMENTATION NOTES
  80. Both functions will attempt to acquire a lock on the map using
  81. .Xr vm_map_lock 9
  82. and hold it for the duration of the call.
  83. If they detect
  84. .Dv MAP_ENTRY_IN_TRANSITION ,
  85. they will call
  86. .Xr vm_map_unlock_and_wait 9
  87. until the map becomes available again.
  88. .Pp
  89. The map could have changed during this window as it was held by another
  90. consumer, therefore consumers of this interface should check for this
  91. condition using the return values below.
  92. .Sh RETURN VALUES
  93. The
  94. .Fn vm_map_wire
  95. and
  96. .Fn vm_map_unwire
  97. functions have identical return values.
  98. The functions return
  99. .Dv KERN_SUCCESS
  100. if all pages within the range were [un]wired successfully.
  101. .Pp
  102. Otherwise, if the specified range was not valid,
  103. or if the map changed while the
  104. .Dv MAP_ENTRY_IN_TRANSITION
  105. flag was set,
  106. .Dv KERN_INVALID_ADDRESS
  107. is returned.
  108. .Sh SEE ALSO
  109. .Xr mlockall 2 ,
  110. .Xr munlockall 2 ,
  111. .Xr vm_map 9
  112. .Sh AUTHORS
  113. This manual page was written by
  114. .An Bruce M Simpson Aq bms@spc.org .