---
name: "vm_page_aflag"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/vm_page_aflag"
---

# vm\_page\_aflag(9)

change page atomic flags

## NAME

**vm\_page\_aflag\_clear**, **vm\_page\_aflag\_set**, **vm\_page\_reference** – change page atomic flags

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<vm/vm.h\>**

**#include \<vm/vm\_page.h\>**

*void*\

**vm\_page\_aflag\_clear**(*vm\_page\_t m*, *uint8\_t bits*);

*void*\

**vm\_page\_aflag\_set**(*vm\_page\_t m*, *uint8\_t bits*);

*void*\

**vm\_page\_reference**(*vm\_page\_t m*);

## DESCRIPTION

The **vm\_page\_aflag\_clear**() atomically clears the specified bits on the page's *aflags*.

The **vm\_page\_aflag\_set**() atomically sets the specified bits on the page's *aflags*.

The **vm\_page\_reference**(*m*) call is the same as

```
vm_page_aflag_set(m, PGA_REFERENCED);
```

and is the recommended way to mark the page as referenced from third-party kernel modules.

These functions neither block nor require any locks to be held around the calls for correctness.

The functions arguments are:

- *m*

  The page whose *aflags* are updated.

- *bits*

  The bits that are set or cleared on the page's flags.

The following *aflags* can be set or cleared:

- *PGA\_REFERENCED*

  The bit may be set to indicate that the page has been recently accessed. For instance, [pmap(9)](/pmap/9.md) sets this bit to reflect the accessed attribute of the page mapping typically updated by processor's memory management unit on the page access.

- *PGA\_WRITEABLE*

  A writeable mapping for the page may exist.

Both PGA\_REFERENCED and PGA\_WRITEABLE bits are only valid for the managed pages.

## AUTHORS

This manual page was written by Chad David ⟨*davidc@acns.ab.ca*⟩.
