Release 4.11 arch/s390/mm/page-states.c
/*
* Copyright IBM Corp. 2008
*
* Guest page hinting for unused pages.
*
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/gfp.h>
#include <linux/init.h>
#define ESSA_SET_STABLE 1
#define ESSA_SET_UNUSED 2
static int cmma_flag = 1;
static int __init cmma(char *str)
{
char *parm;
parm = strstrip(str);
if (strcmp(parm, "yes") == 0 || strcmp(parm, "on") == 0) {
cmma_flag = 1;
return 1;
}
cmma_flag = 0;
if (strcmp(parm, "no") == 0 || strcmp(parm, "off") == 0)
return 1;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 81 | 100.00% | 1 | 100.00% |
Total | 81 | 100.00% | 1 | 100.00% |
__setup("cmma=", cmma);
static inline int cmma_test_essa(void)
{
register unsigned long tmp asm("0") = 0;
register int rc asm("1") = -EOPNOTSUPP;
asm volatile(
" .insn rrf,0xb9ab0000,%1,%1,0,0\n"
"0: la %0,0\n"
"1:\n"
EX_TABLE(0b,1b)
: "+&d" (rc), "+&d" (tmp));
return rc;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 26 | 70.27% | 1 | 50.00% |
Heiko Carstens | 11 | 29.73% | 1 | 50.00% |
Total | 37 | 100.00% | 2 | 100.00% |
void __init cmma_init(void)
{
if (!cmma_flag)
return;
if (cmma_test_essa())
cmma_flag = 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 14 | 60.87% | 1 | 50.00% |
Heiko Carstens | 9 | 39.13% | 1 | 50.00% |
Total | 23 | 100.00% | 2 | 100.00% |
static inline void set_page_unstable(struct page *page, int order)
{
int i, rc;
for (i = 0; i < (1 << order); i++)
asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0"
: "=&d" (rc)
: "a" (page_to_phys(page + i)),
"i" (ESSA_SET_UNUSED));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 36 | 90.00% | 1 | 50.00% |
Heiko Carstens | 4 | 10.00% | 1 | 50.00% |
Total | 40 | 100.00% | 2 | 100.00% |
void arch_free_page(struct page *page, int order)
{
if (!cmma_flag)
return;
set_page_unstable(page, order);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 17 | 65.38% | 1 | 50.00% |
Heiko Carstens | 9 | 34.62% | 1 | 50.00% |
Total | 26 | 100.00% | 2 | 100.00% |
static inline void set_page_stable(struct page *page, int order)
{
int i, rc;
for (i = 0; i < (1 << order); i++)
asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0"
: "=&d" (rc)
: "a" (page_to_phys(page + i)),
"i" (ESSA_SET_STABLE));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Heiko Carstens | 21 | 52.50% | 1 | 50.00% |
Martin Schwidefsky | 19 | 47.50% | 1 | 50.00% |
Total | 40 | 100.00% | 2 | 100.00% |
void arch_alloc_page(struct page *page, int order)
{
if (!cmma_flag)
return;
set_page_stable(page, order);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Heiko Carstens | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.00% |
void arch_set_page_states(int make_stable)
{
unsigned long flags, order, t;
struct list_head *l;
struct page *page;
struct zone *zone;
if (!cmma_flag)
return;
if (make_stable)
drain_local_pages(NULL);
for_each_populated_zone(zone) {
spin_lock_irqsave(&zone->lock, flags);
for_each_migratetype_order(order, t) {
list_for_each(l, &zone->free_area[order].free_list[t]) {
page = list_entry(l, struct page, lru);
if (make_stable)
set_page_stable(page, order);
else
set_page_unstable(page, order);
}
}
spin_unlock_irqrestore(&zone->lock, flags);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Heiko Carstens | 118 | 99.16% | 1 | 50.00% |
Martin Schwidefsky | 1 | 0.84% | 1 | 50.00% |
Total | 119 | 100.00% | 2 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 228 | 52.78% | 1 | 20.00% |
Heiko Carstens | 201 | 46.53% | 3 | 60.00% |
Tejun Heo | 3 | 0.69% | 1 | 20.00% |
Total | 432 | 100.00% | 5 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.