ANDROID: fix ABI breakage caused by adding union type in struct page

The patchset includes two additional fields along with lru in struct page
but they were all union so it shouldn't break change the semantic.
However, ABI is broken so this patch reverts the patchset since it
doesn't change runtime behavior difference. Just lose code readability.

Bug: 230899966
Signed-off-by: Minchan Kim <minchan@google.com>
Change-Id: I4eb1a55a9ca52794e136870bfddbd04175f1134b
This commit is contained in:
Minchan Kim
2022-05-02 13:38:55 -07:00
parent fc19a77b2a
commit 2eb3710ce5
2 changed files with 15 additions and 20 deletions

View File

@@ -83,18 +83,13 @@ struct page {
*/
union {
struct { /* Page cache and anonymous pages */
union {
/**
* @lru: Pageout list, eg. active_list protected by
* pgdat->lru_lock. Sometimes used as a generic list
* by the page owner.
*/
struct list_head lru;
/**
* @lru: Pageout list, eg. active_list protected by
* pgdat->lru_lock. Sometimes used as a generic list
* by the page owner.
*/
struct list_head lru;
/* Or, free page */
struct list_head buddy_list;
struct list_head pcp_list;
};
/* See page-flags.h for PAGE_MAPPING_FLAGS */
struct address_space *mapping;
pgoff_t index; /* Our offset within mapping. */

View File

@@ -755,7 +755,7 @@ static inline bool set_page_guard(struct zone *zone, struct page *page,
return false;
__SetPageGuard(page);
INIT_LIST_HEAD(&page->buddy_list);
INIT_LIST_HEAD(&page->lru);
set_page_private(page, order);
/* Guard pages are not available for any usage */
__mod_zone_freepage_state(zone, -(1 << order), migratetype);
@@ -929,7 +929,7 @@ static inline void add_to_free_list(struct page *page, struct zone *zone,
{
struct free_area *area = &zone->free_area[order];
list_add(&page->buddy_list, &area->free_list[migratetype]);
list_add(&page->lru, &area->free_list[migratetype]);
area->nr_free++;
}
@@ -939,7 +939,7 @@ static inline void add_to_free_list_tail(struct page *page, struct zone *zone,
{
struct free_area *area = &zone->free_area[order];
list_add_tail(&page->buddy_list, &area->free_list[migratetype]);
list_add_tail(&page->lru, &area->free_list[migratetype]);
area->nr_free++;
}
@@ -953,7 +953,7 @@ static inline void move_to_free_list(struct page *page, struct zone *zone,
{
struct free_area *area = &zone->free_area[order];
list_move_tail(&page->buddy_list, &area->free_list[migratetype]);
list_move_tail(&page->lru, &area->free_list[migratetype]);
}
static inline void del_page_from_free_list(struct page *page, struct zone *zone,
@@ -963,7 +963,7 @@ static inline void del_page_from_free_list(struct page *page, struct zone *zone,
if (page_reported(page))
__ClearPageReported(page);
list_del(&page->buddy_list);
list_del(&page->lru);
__ClearPageBuddy(page);
set_page_private(page, 0);
zone->free_area[order].nr_free--;
@@ -1469,7 +1469,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,
do {
page = list_last_entry(list, struct page, lru);
/* must delete to avoid corrupting pcp list */
list_del(&page->pcp_list);
list_del(&page->lru);
pcp->count--;
if (bulkfree_pcp_prepare(page))
@@ -3069,7 +3069,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
* for IO devices that can merge IO requests if the physical
* pages are ordered properly.
*/
list_add_tail(&page->pcp_list, list);
list_add_tail(&page->lru, list);
alloced++;
if (is_migrate_cma(get_pcppage_migratetype(page)))
__mod_zone_page_state(zone, NR_FREE_CMA_PAGES,
@@ -3337,7 +3337,7 @@ static bool free_unref_page_commit(struct page *page, int migratetype,
}
}
list_add(&page->pcp_list, &pcp->lists[migratetype]);
list_add(&page->lru, &pcp->lists[migratetype]);
pcp->count++;
if (pcp->count >= pcp->high) {
unsigned long batch = READ_ONCE(pcp->batch);
@@ -3711,7 +3711,7 @@ static struct page *__rmqueue_pcplist(struct zone *zone, int migratetype,
}
page = list_first_entry(list, struct page, lru);
list_del(&page->pcp_list);
list_del(&page->lru);
pcp->count--;
} while (check_new_pcp(page));