Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22b751c3 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds
Browse files

mm: rename page struct field helpers



The function names page_xchg_last_nid(), page_last_nid() and
reset_page_last_nid() were judged to be inconsistent so rename them to a
struct_field_op style pattern.  As it looked jarring to have
reset_page_mapcount() and page_nid_reset_last() beside each other in
memmap_init_zone(), this patch also renames reset_page_mapcount() to
page_mapcount_reset().  There are others like init_page_count() but as
it is used throughout the arch code a rename would likely cause more
conflicts than it is worth.

[akpm@linux-foundation.org: fix zcache]
Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e4715f01
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ static inline struct page *zbud_unuse_zbudpage(struct zbudpage *zbudpage,
	else
		zbud_pers_pageframes--;
	zbudpage_spin_unlock(zbudpage);
	reset_page_mapcount(page);
	page_mapcount_reset(page);
	init_page_count(page);
	page->index = 0;
	return page;
+1 −1
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ static void reset_page(struct page *page)
	set_page_private(page, 0);
	page->mapping = NULL;
	page->freelist = NULL;
	reset_page_mapcount(page);
	page_mapcount_reset(page);
}

static void free_zspage(struct page *first_page)
+10 −10
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ static inline struct page *compound_head(struct page *page)
 * both from it and to it can be tracked, using atomic_inc_and_test
 * and atomic_add_negative(-1).
 */
static inline void reset_page_mapcount(struct page *page)
static inline void page_mapcount_reset(struct page *page)
{
	atomic_set(&(page)->_mapcount, -1);
}
@@ -658,28 +658,28 @@ static inline int page_to_nid(const struct page *page)

#ifdef CONFIG_NUMA_BALANCING
#ifdef LAST_NID_NOT_IN_PAGE_FLAGS
static inline int page_xchg_last_nid(struct page *page, int nid)
static inline int page_nid_xchg_last(struct page *page, int nid)
{
	return xchg(&page->_last_nid, nid);
}

static inline int page_last_nid(struct page *page)
static inline int page_nid_last(struct page *page)
{
	return page->_last_nid;
}
static inline void reset_page_last_nid(struct page *page)
static inline void page_nid_reset_last(struct page *page)
{
	page->_last_nid = -1;
}
#else
static inline int page_last_nid(struct page *page)
static inline int page_nid_last(struct page *page)
{
	return (page->flags >> LAST_NID_PGSHIFT) & LAST_NID_MASK;
}

extern int page_xchg_last_nid(struct page *page, int nid);
extern int page_nid_xchg_last(struct page *page, int nid);

static inline void reset_page_last_nid(struct page *page)
static inline void page_nid_reset_last(struct page *page)
{
	int nid = (1 << LAST_NID_SHIFT) - 1;

@@ -688,17 +688,17 @@ static inline void reset_page_last_nid(struct page *page)
}
#endif /* LAST_NID_NOT_IN_PAGE_FLAGS */
#else
static inline int page_xchg_last_nid(struct page *page, int nid)
static inline int page_nid_xchg_last(struct page *page, int nid)
{
	return page_to_nid(page);
}

static inline int page_last_nid(struct page *page)
static inline int page_nid_last(struct page *page)
{
	return page_to_nid(page);
}

static inline void reset_page_last_nid(struct page *page)
static inline void page_nid_reset_last(struct page *page)
{
}
#endif
+1 −1
Original line number Diff line number Diff line
@@ -1639,7 +1639,7 @@ static void __split_huge_page_refcount(struct page *page)
		page_tail->mapping = page->mapping;

		page_tail->index = page->index + i;
		page_xchg_last_nid(page_tail, page_last_nid(page));
		page_nid_xchg_last(page_tail, page_nid_last(page));

		BUG_ON(!PageAnon(page_tail));
		BUG_ON(!PageUptodate(page_tail));
+1 −1
Original line number Diff line number Diff line
@@ -2316,7 +2316,7 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
		 * it less likely we act on an unlikely task<->page
		 * relation.
		 */
		last_nid = page_xchg_last_nid(page, polnid);
		last_nid = page_nid_xchg_last(page, polnid);
		if (last_nid != polnid)
			goto out;
	}
Loading