@ -75,6 +75,17 @@ static bool vtsk_is_duplicate(int vlen, struct task_struct *vtsk)
return false ;
}
static unsigned long get_total_mm_pages ( struct mm_struct * mm )
{
unsigned long pages = 0 ;
int i ;
for ( i = 0 ; i < NR_MM_COUNTERS ; i + + )
pages + = get_mm_counter ( mm , i ) ;
return pages ;
}
static unsigned long find_victims ( int * vindex , short target_adj )
{
unsigned long pages_found = 0 ;
@ -108,7 +119,7 @@ static unsigned long find_victims(int *vindex, short target_adj)
/* Store this potential victim away for later */
victims [ * vindex ] . tsk = vtsk ;
victims [ * vindex ] . mm = vtsk - > mm ;
victims [ * vindex ] . size = get_mm_rs s ( vtsk - > mm ) ;
victims [ * vindex ] . size = get_total_mm_page s ( vtsk - > mm ) ;
/* Keep track of the number of pages that have been found */
pages_found + = victims [ * vindex ] . size ;