Release 4.7 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 | rik van riel | 17 | 89.47% | 1 | 50.00% |
johannes weiner | 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, int nr_pages)
{
__mod_zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru, nr_pages);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
hugh dickins | hugh dickins | 33 | 100.00% | 1 | 100.00% |
| Total | 33 | 100.00% | 1 | 100.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
| Person | Tokens | Prop | Commits | CommitProp |
hugh dickins | hugh dickins | 44 | 100.00% | 1 | 100.00% |
| Total | 44 | 100.00% | 1 | 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, hpage_nr_pages(page));
list_add(&page->lru, &lruvec->lists[lru]);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrew morton | andrew morton | 20 | 40.82% | 1 | 14.29% |
hugh dickins | hugh dickins | 15 | 30.61% | 3 | 42.86% |
johannes weiner | johannes weiner | 10 | 20.41% | 1 | 14.29% |
christoph lameter | christoph lameter | 3 | 6.12% | 1 | 14.29% |
konstantin khlebnikov | konstantin khlebnikov | 1 | 2.04% | 1 | 14.29% |
| Total | 49 | 100.00% | 7 | 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, -hpage_nr_pages(page));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
hugh dickins | hugh dickins | 23 | 54.76% | 4 | 44.44% |
andrea arcangeli | andrea arcangeli | 12 | 28.57% | 1 | 11.11% |
andrew morton | andrew morton | 4 | 9.52% | 1 | 11.11% |
johannes weiner | johannes weiner | 1 | 2.38% | 1 | 11.11% |
christoph lameter | christoph lameter | 1 | 2.38% | 1 | 11.11% |
konstantin khlebnikov | konstantin khlebnikov | 1 | 2.38% | 1 | 11.11% |
| Total | 42 | 100.00% | 9 | 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 | 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 | andrew morton | 21 | 31.82% | 1 | 11.11% |
lee schermerhorn | lee schermerhorn | 20 | 30.30% | 1 | 11.11% |
hugh dickins | hugh dickins | 10 | 15.15% | 2 | 22.22% |
christoph lameter | christoph lameter | 6 | 9.09% | 1 | 11.11% |
johannes weiner | johannes weiner | 6 | 9.09% | 1 | 11.11% |
konstantin khlebnikov | konstantin khlebnikov | 1 | 1.52% | 1 | 11.11% |
nick piggin | nick piggin | 1 | 1.52% | 1 | 11.11% |
rik van riel | 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 | christoph lameter | 27 | 51.92% | 2 | 33.33% |
lee schermerhorn | lee schermerhorn | 14 | 26.92% | 1 | 16.67% |
johannes weiner | johannes weiner | 7 | 13.46% | 1 | 16.67% |
andrew morton | andrew morton | 3 | 5.77% | 1 | 16.67% |
konstantin khlebnikov | 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 | hugh dickins | 126 | 35.39% | 5 | 25.00% |
johannes weiner | johannes weiner | 54 | 15.17% | 3 | 15.00% |
andrew morton | andrew morton | 48 | 13.48% | 1 | 5.00% |
christoph lameter | christoph lameter | 38 | 10.67% | 2 | 10.00% |
lee schermerhorn | lee schermerhorn | 34 | 9.55% | 1 | 5.00% |
rik van riel | rik van riel | 29 | 8.15% | 3 | 15.00% |
andrea arcangeli | andrea arcangeli | 12 | 3.37% | 1 | 5.00% |
geliang tang | geliang tang | 7 | 1.97% | 1 | 5.00% |
konstantin khlebnikov | konstantin khlebnikov | 4 | 1.12% | 1 | 5.00% |
lisa du | lisa du | 3 | 0.84% | 1 | 5.00% |
nick piggin | nick piggin | 1 | 0.28% | 1 | 5.00% |
| Total | 356 | 100.00% | 20 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.