Release 4.12 include/linux/mm_inline.h
#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
Person | Tokens | Prop | Commits | CommitProp |
Rik Van Riel | 17 | 89.47% | 1 | 50.00% |
Johannes Weiner | 2 | 10.53% | 1 | 50.00% |
Total | 19 | 100.00% | 2 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Hugh Dickins | 30 | 49.18% | 1 | 33.33% |
MinChan Kim | 17 | 27.87% | 1 | 33.33% |
Mel Gorman | 14 | 22.95% | 1 | 33.33% |
Total | 61 | 100.00% | 3 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Hugh Dickins | 37 | 74.00% | 1 | 25.00% |
Mel Gorman | 11 | 22.00% | 2 | 50.00% |
Michal Hocko | 2 | 4.00% | 1 | 25.00% |
Total | 50 | 100.00% | 4 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Andrew Morton | 20 | 37.04% | 1 | 12.50% |
Hugh Dickins | 15 | 27.78% | 3 | 37.50% |
Johannes Weiner | 10 | 18.52% | 1 | 12.50% |
Mel Gorman | 5 | 9.26% | 1 | 12.50% |
Christoph Lameter | 3 | 5.56% | 1 | 12.50% |
Konstantin Khlebnikov | 1 | 1.85% | 1 | 12.50% |
Total | 54 | 100.00% | 8 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Johannes Weiner | 54 | 100.00% | 1 | 100.00% |
Total | 54 | 100.00% | 1 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Hugh Dickins | 23 | 48.94% | 4 | 40.00% |
Andrea Arcangeli | 12 | 25.53% | 1 | 10.00% |
Mel Gorman | 5 | 10.64% | 1 | 10.00% |
Andrew Morton | 4 | 8.51% | 1 | 10.00% |
Christoph Lameter | 1 | 2.13% | 1 | 10.00% |
Konstantin Khlebnikov | 1 | 2.13% | 1 | 10.00% |
Johannes Weiner | 1 | 2.13% | 1 | 10.00% |
Total | 47 | 100.00% | 10 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Johannes Weiner | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Andrew Morton | 21 | 31.82% | 1 | 11.11% |
Lee Schermerhorn | 20 | 30.30% | 1 | 11.11% |
Hugh Dickins | 10 | 15.15% | 2 | 22.22% |
Christoph Lameter | 6 | 9.09% | 1 | 11.11% |
Johannes Weiner | 6 | 9.09% | 1 | 11.11% |
Nicholas Piggin | 1 | 1.52% | 1 | 11.11% |
Konstantin Khlebnikov | 1 | 1.52% | 1 | 11.11% |
Rik Van Riel | 1 | 1.52% | 1 | 11.11% |
Total | 66 | 100.00% | 9 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Christoph Lameter | 27 | 51.92% | 2 | 33.33% |
Lee Schermerhorn | 14 | 26.92% | 1 | 16.67% |
Johannes Weiner | 7 | 13.46% | 1 | 16.67% |
Andrew Morton | 3 | 5.77% | 1 | 16.67% |
Konstantin Khlebnikov | 1 | 1.92% | 1 | 16.67% |
Total | 52 | 100.00% | 6 | 100.00% |
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
#endif
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Hugh Dickins | 116 | 25.55% | 5 | 20.00% |
Johannes Weiner | 108 | 23.79% | 4 | 16.00% |
Andrew Morton | 48 | 10.57% | 1 | 4.00% |
Christoph Lameter | 38 | 8.37% | 2 | 8.00% |
Mel Gorman | 35 | 7.71% | 2 | 8.00% |
Lee Schermerhorn | 34 | 7.49% | 1 | 4.00% |
Rik Van Riel | 29 | 6.39% | 3 | 12.00% |
MinChan Kim | 17 | 3.74% | 1 | 4.00% |
Andrea Arcangeli | 12 | 2.64% | 1 | 4.00% |
Geliang Tang | 7 | 1.54% | 1 | 4.00% |
Konstantin Khlebnikov | 4 | 0.88% | 1 | 4.00% |
Lisa Du | 3 | 0.66% | 1 | 4.00% |
Michal Hocko | 2 | 0.44% | 1 | 4.00% |
Nicholas Piggin | 1 | 0.22% | 1 | 4.00% |
Total | 454 | 100.00% | 25 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.