Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86822
b: refs/heads/master
c: d5b69e3
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Mar 5, 2008
1 parent a9b7a68 commit 5a961a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8869b8f6e09a1b49bf915eb03f663f2e4e8fbcd4
refs/heads/master: d5b69e38f8cdb1e41cc022305c86c9739bf1ffdb
28 changes: 11 additions & 17 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ struct page_cgroup {
#define PAGE_CGROUP_FLAG_CACHE (0x1) /* charged as cache */
#define PAGE_CGROUP_FLAG_ACTIVE (0x2) /* page is active in this cgroup */

static inline int page_cgroup_nid(struct page_cgroup *pc)
static int page_cgroup_nid(struct page_cgroup *pc)
{
return page_to_nid(pc->page);
}

static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc)
static enum zone_type page_cgroup_zid(struct page_cgroup *pc)
{
return page_zonenum(pc->page);
}
Expand All @@ -199,14 +199,13 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *mem, int flags,
__mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_RSS, val);
}

static inline struct mem_cgroup_per_zone *
static struct mem_cgroup_per_zone *
mem_cgroup_zoneinfo(struct mem_cgroup *mem, int nid, int zid)
{
BUG_ON(!mem->info.nodeinfo[nid]);
return &mem->info.nodeinfo[nid]->zoneinfo[zid];
}

static inline struct mem_cgroup_per_zone *
static struct mem_cgroup_per_zone *
page_cgroup_zoneinfo(struct page_cgroup *pc)
{
struct mem_cgroup *mem = pc->mem_cgroup;
Expand All @@ -231,16 +230,14 @@ static unsigned long mem_cgroup_get_all_zonestat(struct mem_cgroup *mem,
return total;
}

static inline
struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont)
static struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont)
{
return container_of(cgroup_subsys_state(cont,
mem_cgroup_subsys_id), struct mem_cgroup,
css);
}

static inline
struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
static struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
{
return container_of(task_subsys_state(p, mem_cgroup_subsys_id),
struct mem_cgroup, css);
Expand Down Expand Up @@ -276,13 +273,12 @@ struct page_cgroup *page_get_page_cgroup(struct page *page)
return (struct page_cgroup *) (page->page_cgroup & ~PAGE_CGROUP_LOCK);
}

static void __always_inline lock_page_cgroup(struct page *page)
static void lock_page_cgroup(struct page *page)
{
bit_spin_lock(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup);
VM_BUG_ON(!page_cgroup_locked(page));
}

static void __always_inline unlock_page_cgroup(struct page *page)
static void unlock_page_cgroup(struct page *page)
{
bit_spin_unlock(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup);
}
Expand Down Expand Up @@ -741,16 +737,14 @@ void mem_cgroup_end_migration(struct page *page)
void mem_cgroup_page_migration(struct page *page, struct page *newpage)
{
struct page_cgroup *pc;
struct mem_cgroup *mem;
unsigned long flags;
struct mem_cgroup_per_zone *mz;
unsigned long flags;

retry:
pc = page_get_page_cgroup(page);
if (!pc)
return;

mem = pc->mem_cgroup;
mz = page_cgroup_zoneinfo(pc);
if (clear_page_cgroup(page, pc) != pc)
goto retry;
Expand Down Expand Up @@ -822,7 +816,7 @@ static void mem_cgroup_force_empty_list(struct mem_cgroup *mem,
* make mem_cgroup's charge to be 0 if there is no task.
* This enables deleting this mem_cgroup.
*/
int mem_cgroup_force_empty(struct mem_cgroup *mem)
static int mem_cgroup_force_empty(struct mem_cgroup *mem)
{
int ret = -EBUSY;
int node, zid;
Expand Down Expand Up @@ -852,7 +846,7 @@ int mem_cgroup_force_empty(struct mem_cgroup *mem)
return ret;
}

int mem_cgroup_write_strategy(char *buf, unsigned long long *tmp)
static int mem_cgroup_write_strategy(char *buf, unsigned long long *tmp)
{
*tmp = memparse(buf, &buf);
if (*buf != '\0')
Expand Down

0 comments on commit 5a961a7

Please sign in to comment.