cregit-Linux how code gets into the kernel

Release 4.7 include/linux/mm_inline.h

Directory: include/linux
#ifndef LINUX_MM_INLINE_H

#define LINUX_MM_INLINE_H

#include <linux/huge_mm.h>
#include <linux/swap.h>

/**
 * page_is_file_cache - should the page be on a file LRU or anon LRU?
 * @page: the page to test
 *
 * Returns 1 if @page is page cache page backed by a regular filesystem,
 * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed.
 * Used by functions that manipulate the LRU lists, to sort a page
 * onto the right LRU list.
 *
 * We would like to get this info without a page flag, but the state
 * needs to survive until the page is last deleted from the LRU, which
 * could be as far down as __page_cache_release.
 */

static inline int page_is_file_cache(struct page *page) { return !PageSwapBacked(page); }

Contributors

PersonTokensPropCommitsCommitProp
rik van rielrik van riel1789.47%150.00%
johannes weinerjohannes weiner210.53%150.00%
Total19100.00%2100.00%


static __always_inline void __update_lru_size(struct lruvec *lruvec, enum lru_list lru, int nr_pages) { __mod_zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru, nr_pages); }

Contributors

PersonTokensPropCommitsCommitProp
hugh dickinshugh dickins33100.00%1100.00%
Total33100.00%1100.00%


static __always_inline void update_lru_size(struct lruvec *lruvec, enum lru_list lru, int nr_pages) { #ifdef CONFIG_MEMCG mem_cgroup_update_lru_size(lruvec, lru, nr_pages); #else __update_lru_size(lruvec, lru, nr_pages); #endif }

Contributors

PersonTokensPropCommitsCommitProp
hugh dickinshugh dickins44100.00%1100.00%
Total44100.00%1100.00%


static __always_inline void add_page_to_lru_list(struct page *page, struct lruvec *lruvec, enum lru_list lru) { update_lru_size(lruvec, lru, hpage_nr_pages(page)); list_add(&page->lru, &lruvec->lists[lru]); }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton2040.82%114.29%
hugh dickinshugh dickins1530.61%342.86%
johannes weinerjohannes weiner1020.41%114.29%
christoph lameterchristoph lameter36.12%114.29%
konstantin khlebnikovkonstantin khlebnikov12.04%114.29%
Total49100.00%7100.00%


static __always_inline void del_page_from_lru_list(struct page *page, struct lruvec *lruvec, enum lru_list lru) { list_del(&page->lru); update_lru_size(lruvec, lru, -hpage_nr_pages(page)); }

Contributors

PersonTokensPropCommitsCommitProp
hugh dickinshugh dickins2354.76%444.44%
andrea arcangeliandrea arcangeli1228.57%111.11%
andrew mortonandrew morton49.52%111.11%
johannes weinerjohannes weiner12.38%111.11%
christoph lameterchristoph lameter12.38%111.11%
konstantin khlebnikovkonstantin khlebnikov12.38%111.11%
Total42100.00%9100.00%

/** * page_lru_base_type - which LRU list type should a page be on? * @page: the page to test * * Used for LRU list index arithmetic. * * Returns the base LRU type - file or anon - @page should be on. */
static inline enum lru_list page_lru_base_type(struct page *page) { if (page_is_file_cache(page)) return LRU_INACTIVE_FILE; return LRU_INACTIVE_ANON; }

Contributors

PersonTokensPropCommitsCommitProp
johannes weinerjohannes weiner26100.00%1100.00%
Total26100.00%1100.00%

/** * page_off_lru - which LRU list was page on? clearing its lru flags. * @page: the page to test * * Returns the LRU list a page was on, as an index into the array of LRU * lists; and clears its Unevictable or Active flags, ready for freeing. */
static __always_inline enum lru_list page_off_lru(struct page *page) { enum lru_list lru; if (PageUnevictable(page)) { __ClearPageUnevictable(page); lru = LRU_UNEVICTABLE; } else { lru = page_lru_base_type(page); if (PageActive(page)) { __ClearPageActive(page); lru += LRU_ACTIVE; } } return lru; }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton2131.82%111.11%
lee schermerhornlee schermerhorn2030.30%111.11%
hugh dickinshugh dickins1015.15%222.22%
christoph lameterchristoph lameter69.09%111.11%
johannes weinerjohannes weiner69.09%111.11%
konstantin khlebnikovkonstantin khlebnikov11.52%111.11%
nick pigginnick piggin11.52%111.11%
rik van rielrik van riel11.52%111.11%
Total66100.00%9100.00%

/** * page_lru - which LRU list should a page be on? * @page: the page to test * * Returns the LRU list a page should be on, as an index * into the array of LRU lists. */
static __always_inline enum lru_list page_lru(struct page *page) { enum lru_list lru; if (PageUnevictable(page)) lru = LRU_UNEVICTABLE; else { lru = page_lru_base_type(page); if (PageActive(page)) lru += LRU_ACTIVE; } return lru; }

Contributors

PersonTokensPropCommitsCommitProp
christoph lameterchristoph lameter2751.92%233.33%
lee schermerhornlee schermerhorn1426.92%116.67%
johannes weinerjohannes weiner713.46%116.67%
andrew mortonandrew morton35.77%116.67%
konstantin khlebnikovkonstantin khlebnikov11.92%116.67%
Total52100.00%6100.00%

#define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) #endif

Overall Contributors

PersonTokensPropCommitsCommitProp
hugh dickinshugh dickins12635.39%525.00%
johannes weinerjohannes weiner5415.17%315.00%
andrew mortonandrew morton4813.48%15.00%
christoph lameterchristoph lameter3810.67%210.00%
lee schermerhornlee schermerhorn349.55%15.00%
rik van rielrik van riel298.15%315.00%
andrea arcangeliandrea arcangeli123.37%15.00%
geliang tanggeliang tang71.97%15.00%
konstantin khlebnikovkonstantin khlebnikov41.12%15.00%
lisa dulisa du30.84%15.00%
nick pigginnick piggin10.28%15.00%
Total356100.00%20100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}