FreeBSD virtual memory subsystem code
swap_pager.h File Reference
#include <sys/_types.h>
Include dependency graph for swap_pager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  swdevt
 

Macros

#define SW_UNMAPPED   0x01
 
#define SW_CLOSING   0x04
 

Typedefs

typedef void sw_strategy_t(struct buf *, struct swdevt *)
 
typedef void sw_close_t(struct thread *, struct swdevt *)
 

Functions

int swap_dev_info (int name, struct xswdev *xs, char *devname, size_t len)
 
void swap_pager_copy (vm_object_t, vm_object_t, vm_pindex_t, int)
 
vm_pindex_t swap_pager_find_least (vm_object_t object, vm_pindex_t pindex)
 
void swap_pager_swap_init (void)
 
int swap_pager_nswapdev (void)
 
int swap_pager_reserve (vm_object_t, vm_pindex_t, vm_pindex_t)
 
void swap_pager_status (int *total, int *used)
 
u_long swap_pager_swapped_pages (vm_object_t object)
 
void swapoff_all (void)
 
bool swap_pager_init_object (vm_object_t object, void *handle, struct ucred *cred, vm_ooffset_t size, vm_ooffset_t offset)
 

Variables

int swap_pager_avail
 
int nsw_cluster_max
 

Macro Definition Documentation

◆ SW_CLOSING

#define SW_CLOSING   0x04

Definition at line 70 of file swap_pager.h.

◆ SW_UNMAPPED

#define SW_UNMAPPED   0x01

Definition at line 69 of file swap_pager.h.

Typedef Documentation

◆ sw_close_t

typedef void sw_close_t(struct thread *, struct swdevt *)

Definition at line 49 of file swap_pager.h.

◆ sw_strategy_t

typedef void sw_strategy_t(struct buf *, struct swdevt *)

Definition at line 48 of file swap_pager.h.

Function Documentation

◆ swap_dev_info()

int swap_dev_info ( int  name,
struct xswdev xs,
char *  devname,
size_t  len 
)

◆ swap_pager_copy()

void swap_pager_copy ( vm_object_t  srcobject,
vm_object_t  dstobject,
vm_pindex_t  offset,
int  destroysource 
)

◆ swap_pager_find_least()

vm_pindex_t swap_pager_find_least ( vm_object_t  object,
vm_pindex_t  pindex 
)

◆ swap_pager_init_object()

bool swap_pager_init_object ( vm_object_t  object,
void *  handle,
struct ucred *  cred,
vm_ooffset_t  size,
vm_ooffset_t  offset 
)

Definition at line 668 of file swap_pager.c.

References swap_reserve_by_cred().

Referenced by swap_pager_alloc_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap_pager_nswapdev()

int swap_pager_nswapdev ( void  )

Definition at line 1774 of file swap_pager.c.

Referenced by vm_pageout_swapoff().

Here is the caller graph for this function:

◆ swap_pager_reserve()

int swap_pager_reserve ( vm_object_t  object,
vm_pindex_t  start,
vm_pindex_t  size 
)

◆ swap_pager_status()

void swap_pager_status ( int *  total,
int *  used 
)

Definition at line 2631 of file swap_pager.c.

References swap_pager_avail.

◆ swap_pager_swap_init()

void swap_pager_swap_init ( void  )

Definition at line 596 of file swap_pager.c.

References nsw_wcount_async, nsw_wcount_async_max, pbuf_zsecond_create(), SWAP_META_PAGES, swblk_zone, swbuf_mtx, swpctrie_zone, swrbuf_zone, swwbuf_zone, uma_zcreate(), uma_zone_get_max(), uma_zone_reserve_kva(), and vm_cnt.

Referenced by vm_pageout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap_pager_swapped_pages()

u_long swap_pager_swapped_pages ( vm_object_t  object)

Definition at line 1790 of file swap_pager.c.

References swblk::d, vm_object::flags, OBJ_SWAP, swblk::p, SWAP_META_PAGES, vm_object::swp, vm_object::swp_blks, vm_object::un_pager, and VM_OBJECT_ASSERT_LOCKED.

Referenced by vm_object_list_handler().

Here is the caller graph for this function:

◆ swapoff_all()

void swapoff_all ( void  )

Definition at line 2601 of file swap_pager.c.

References sw_dev_mtx, swdevt::sw_vp, and swapoff_one().

Here is the call graph for this function:

Variable Documentation

◆ nsw_cluster_max

int nsw_cluster_max
extern

Definition at line 387 of file swap_pager.c.

Referenced by swap_pager_init(), and swap_pager_putpages().

◆ swap_pager_avail