MM: zero memory at free and deferred zero

Change-Id: Ib0055d6f2bdd10d05d749dcd1f3d5c3d318f22f3
This commit is contained in:
Masamichi Takagi
2020-12-08 11:59:08 +09:00
parent fbd121d28c
commit 100bbe6231
7 changed files with 263 additions and 18 deletions

View File

@@ -208,6 +208,10 @@ int ihk_mc_pt_virt_to_phys(struct page_table *pt,
uint64_t ihk_mc_pt_virt_to_pagemap(struct page_table *pt, unsigned long virt);
int ihk_mc_get_nr_numa_nodes(void);
struct ihk_mc_numa_node *ihk_mc_get_numa_node_by_distance(int i);
void ihk_numa_zero_free_pages(struct ihk_mc_numa_node *__node);
extern int zero_at_free;
struct smp_coreset;
int ihk_mc_get_numa_node(int id, int *linux_numa_id, int *type);
int ihk_mc_get_numa_distance(int i, int j);

View File

@@ -41,10 +41,17 @@ struct ihk_mc_numa_node {
struct list_head allocators;
struct node_distance *nodes_by_distance;
#ifdef IHK_RBTREE_ALLOCATOR
struct rb_root zeroed_chunks;
struct rb_root free_chunks;
mcs_lock_node_t lock;
unsigned long nr_pages;
/*
* nr_free_pages: all freed pages
* nr_zeroed_pages: zeroed free pages
* Invariant: nr_zeroed_pages <= nr_free_pages
*/
unsigned long nr_zeroed_pages;
unsigned long nr_free_pages;
unsigned long min_addr;
unsigned long max_addr;