|   登录   |   注册   |   设为首页   |   加入收藏   

用户登录

close

用户名:

密码:

新用户注册

close

用户名:

密码:

密码确认:

电子邮箱:

关注内容:

个人主页:

帮助

close

龙宇网成立于2008年3月,网站进入整体运作于2010年10月1日。

在这里,我们把它做成了一个真正意义上的网站,完全以个人的信息为内容,以网友的需要为主导,全力搜罗各种信息,建立完善的网站功能,使网友在这里可以第一时间找到所需要的信息。

现在,经过三年的努力,网站的资料已经相当丰富,而网站得到了大家的喜爱和认可。

但,我们还是会继续努力下去,让网间的这份快乐继续持续下去,让这份闲暇时的日子,与快乐一并同行。

寻觅快乐,网住快乐,关注网络,是龙宇网的宣言与承诺。

linux pageflags

标签: pageflages linux
分类: 系统架构 发布时间: 2019-08-23 13:17:13 浏览次数: 86
内容提要: linux pageflages 定义

/*

* Various page->flags bits:

*

* PG_reserved is set for special pages, which can never be swapped out. Some

* of them might not even exist (eg empty_bad_page)...

*

* The PG_private bitflag is set on pagecache pages if they contain filesystem

* specific data (which is normally at page->private). It can be used by

* private allocations for its own usage.

*

* During initiation of disk I/O, PG_locked is set. This bit is set before I/O

* and cleared when writeback _starts_ or when read _completes_. PG_writeback

* is set before writeback starts and cleared when it finishes.

*

* PG_locked also pins a page in pagecache, and blocks truncation of the file

* while it is held.

*

* page_waitqueue(page) is a wait queue of all tasks waiting for the page

* to become unlocked.

*

* PG_uptodate tells whether the page's contents is valid. When a read

* completes, the page becomes uptodate, unless a disk I/O error happened.

*

* PG_referenced, PG_reclaim are used for page reclaim for anonymous and

* file-backed pagecache (see mm/vmscan.c).

*

* PG_error is set to indicate that an I/O error occurred on this page.

*

* PG_arch_1 is an architecture specific page state bit. The generic code

* guarantees that this bit is cleared for a page when it first is entered into

* the page cache.

*

* PG_highmem pages are not permanently mapped into the kernel virtual address

* space, they need to be kmapped separately for doing IO on the pages. The

* struct page (these bits with information) are always mapped into kernel

* address space...

*

* PG_hwpoison indicates that a page got corrupted in hardware and contains

* data with incorrect ECC bits that triggered a machine check. Accessing is

* not safe since it may cause another machine check. Don't touch!

*/

 

/*

* Don't use the *_dontuse flags. Use the macros. Otherwise you'll break

* locked- and dirty-page accounting.

*

* The page flags field is split into two parts, the main flags area

* which extends from the low bits upwards, and the fields area which

* extends from the high bits downwards.

*

* | FIELD | ... | FLAGS |

* N-1 ^ 0

* (NR_PAGEFLAGS)

*

* The fields area is reserved for fields mapping zone, node (for NUMA) and

* SPARSEMEM section (for variants of SPARSEMEM that require section ids like

* SPARSEMEM_EXTREME with !SPARSEMEM_VMEMMAP).

*/

enum pageflags {

    PG_locked,      /* Page is locked. Don't touch. */

    PG_error,

    PG_referenced,

    PG_uptodate,

    PG_dirty,

    PG_lru,

    PG_active,

    PG_slab,

    PG_owner_priv_1,    /* Owner use. If pagecache, fs may use*/

    PG_arch_1,

    PG_reserved,

    PG_private,     /* If pagecache, has fs-private data */

    PG_private_2,       /* If pagecache, has fs aux data */

    PG_writeback,       /* Page is under writeback */

#ifdef CONFIG_PAGEFLAGS_EXTENDED

    PG_head,        /* A head page */

    PG_tail,        /* A tail page */

#else

    PG_compound,        /* A compound page */

#endif

    PG_swapcache,       /* Swap page: swp_entry_t in private */

    PG_mappedtodisk,    /* Has blocks allocated on-disk */

    PG_reclaim,     /* To be reclaimed asap */

    PG_swapbacked,      /* Page is backed by RAM/swap */

    PG_unevictable,     /* Page is "unevictable" */

#ifdef CONFIG_MMU

    PG_mlocked,     /* Page is vma mlocked */

#endif

#ifdef CONFIG_ARCH_USES_PG_UNCACHED

    PG_uncached,        /* Page has been mapped as uncached */

#endif

#ifdef CONFIG_MEMORY_FAILURE

    PG_hwpoison,        /* hardware poisoned page. Don't touch */

#endif

#ifdef CONFIG_TRANSPARENT_HUGEPAGE

    PG_compound_lock,

#endif

    __NR_PAGEFLAGS,

 

    /* Filesystems */

    PG_checked = PG_owner_priv_1,

 

    /* Two page bits are conscripted by FS-Cache to maintain local caching

     * state. These bits are set on pages belonging to the netfs's inodes

     * when those inodes are being locally cached.

     */

    PG_fscache = PG_private_2,  /* page backed by cache */

 

    /* XEN */

    PG_pinned = PG_owner_priv_1,

    PG_savepinned = PG_dirty,

 

    /* SLOB */

    PG_slob_free = PG_private,

};

15
20

分类: 系统架构   |   评论: 0   |   引用: 0   |   浏览次数: 86