cregit-Linux how code gets into the kernel

Release 4.15 include/linux/mm_inline.h

Directory: include/linux
/* SPDX-License-Identifier: GPL-2.0 */
#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 Riel1789.47%150.00%
Johannes Weiner210.53%150.00%
Total19100.00%2100.00%


static __always_inline void __update_lru_size(struct lruvec *lruvec, enum lru_list lru, enum zone_type zid, int nr_pages) { struct pglist_data *pgdat = lruvec_pgdat(lruvec); __mod_node_page_state(pgdat, NR_LRU_BASE + lru, nr_pages); __mod_zone_page_state(&pgdat->node_zones[zid], NR_ZONE_LRU_BASE + lru, nr_pages); }

Contributors

PersonTokensPropCommitsCommitProp
Hugh Dickins3049.18%133.33%
MinChan Kim1727.87%133.33%
Mel Gorman1422.95%133.33%
Total61100.00%3100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Hugh Dickins3774.00%125.00%
Mel Gorman1122.00%250.00%
Michal Hocko24.00%125.00%
Total50100.00%4100.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, page_zonenum(page), hpage_nr_pages(page)); list_add(&page->lru, &lruvec->lists[lru]); }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton2037.04%112.50%
Hugh Dickins1527.78%337.50%
Johannes Weiner1018.52%112.50%
Mel Gorman59.26%112.50%
Christoph Lameter35.56%112.50%
Konstantin Khlebnikov11.85%112.50%
Total54100.00%8100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Johannes Weiner54100.00%1100.00%
Total54100.00%1100.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, page_zonenum(page), -hpage_nr_pages(page)); }

Contributors

PersonTokensPropCommitsCommitProp
Hugh Dickins2348.94%440.00%
Andrea Arcangeli1225.53%110.00%
Mel Gorman510.64%110.00%
Andrew Morton48.51%110.00%
Konstantin Khlebnikov12.13%110.00%
Johannes Weiner12.13%110.00%
Christoph Lameter12.13%110.00%
Total47100.00%10100.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 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 Morton2131.82%111.11%
Lee Schermerhorn2030.30%111.11%
Hugh Dickins1015.15%222.22%
Christoph Lameter69.09%111.11%
Johannes Weiner69.09%111.11%
Rik Van Riel11.52%111.11%
Nicholas Piggin11.52%111.11%
Konstantin Khlebnikov11.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 Lameter2751.92%233.33%
Lee Schermerhorn1426.92%116.67%
Johannes Weiner713.46%116.67%
Andrew Morton35.77%116.67%
Konstantin Khlebnikov11.92%116.67%
Total52100.00%6100.00%

#define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) #ifdef arch_unmap_kpfn extern void arch_unmap_kpfn(unsigned long pfn); #else
static __always_inline void arch_unmap_kpfn(unsigned long pfn) { }

Contributors

PersonTokensPropCommitsCommitProp
Tony Luck10100.00%1100.00%
Total10100.00%1100.00%

#endif #endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Hugh Dickins11624.12%518.52%
Johannes Weiner10822.45%414.81%
Andrew Morton489.98%13.70%
Christoph Lameter387.90%27.41%
Mel Gorman357.28%27.41%
Lee Schermerhorn347.07%13.70%
Rik Van Riel296.03%311.11%
Tony Luck265.41%13.70%
MinChan Kim173.53%13.70%
Andrea Arcangeli122.49%13.70%
Geliang Tang71.46%13.70%
Konstantin Khlebnikov40.83%13.70%
Lisa Du30.62%13.70%
Michal Hocko20.42%13.70%
Nicholas Piggin10.21%13.70%
Greg Kroah-Hartman10.21%13.70%
Total481100.00%27100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.