Skip to content

Commit f3a6c97

Browse files
gormanmingomolnar
authored andcommitted
sched/numa: Rename vma_numab_state::access_pids[] => ::pids_active[], ::next_pid_reset => ::pids_active_reset
The access_pids[] field name is somewhat ambiguous as no PIDs are accessed. Similarly, it's not clear that next_pid_reset is related to access_pids[]. Rename the fields to more accurately reflect their purpose. [ mingo: Rename in the comments too. ] Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20231010083143.19593-3-mgorman@techsingularity.net
1 parent 9ae5c00 commit f3a6c97

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

include/linux/mm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,8 +1726,8 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma)
17261726
unsigned int pid_bit;
17271727

17281728
pid_bit = hash_32(current->pid, ilog2(BITS_PER_LONG));
1729-
if (vma->numab_state && !test_bit(pid_bit, &vma->numab_state->access_pids[1])) {
1730-
__set_bit(pid_bit, &vma->numab_state->access_pids[1]);
1729+
if (vma->numab_state && !test_bit(pid_bit, &vma->numab_state->pids_active[1])) {
1730+
__set_bit(pid_bit, &vma->numab_state->pids_active[1]);
17311731
}
17321732
}
17331733
#else /* !CONFIG_NUMA_BALANCING */

include/linux/mm_types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,10 @@ struct vma_numab_state {
559559
unsigned long next_scan;
560560

561561
/*
562-
* Time in jiffies when access_pids[] is reset to
562+
* Time in jiffies when pids_active[] is reset to
563563
* detect phase change behaviour:
564564
*/
565-
unsigned long next_pid_reset;
565+
unsigned long pids_active_reset;
566566

567567
/*
568568
* Approximate tracking of PIDs that trapped a NUMA hinting
@@ -574,7 +574,7 @@ struct vma_numab_state {
574574
* Window moves after next_pid_reset has expired approximately
575575
* every VMA_PID_RESET_PERIOD jiffies:
576576
*/
577-
unsigned long access_pids[2];
577+
unsigned long pids_active[2];
578578
};
579579

580580
/*

kernel/sched/fair.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3125,7 +3125,7 @@ static bool vma_is_accessed(struct vm_area_struct *vma)
31253125
if (READ_ONCE(current->mm->numa_scan_seq) < 2)
31263126
return true;
31273127

3128-
pids = vma->numab_state->access_pids[0] | vma->numab_state->access_pids[1];
3128+
pids = vma->numab_state->pids_active[0] | vma->numab_state->pids_active[1];
31293129
return test_bit(hash_32(current->pid, ilog2(BITS_PER_LONG)), &pids);
31303130
}
31313131

@@ -3241,7 +3241,7 @@ static void task_numa_work(struct callback_head *work)
32413241
msecs_to_jiffies(sysctl_numa_balancing_scan_delay);
32423242

32433243
/* Reset happens after 4 times scan delay of scan start */
3244-
vma->numab_state->next_pid_reset = vma->numab_state->next_scan +
3244+
vma->numab_state->pids_active_reset = vma->numab_state->next_scan +
32453245
msecs_to_jiffies(VMA_PID_RESET_PERIOD);
32463246
}
32473247

@@ -3262,11 +3262,11 @@ static void task_numa_work(struct callback_head *work)
32623262
* vma for recent access to avoid clearing PID info before access..
32633263
*/
32643264
if (mm->numa_scan_seq &&
3265-
time_after(jiffies, vma->numab_state->next_pid_reset)) {
3266-
vma->numab_state->next_pid_reset = vma->numab_state->next_pid_reset +
3265+
time_after(jiffies, vma->numab_state->pids_active_reset)) {
3266+
vma->numab_state->pids_active_reset = vma->numab_state->pids_active_reset +
32673267
msecs_to_jiffies(VMA_PID_RESET_PERIOD);
3268-
vma->numab_state->access_pids[0] = READ_ONCE(vma->numab_state->access_pids[1]);
3269-
vma->numab_state->access_pids[1] = 0;
3268+
vma->numab_state->pids_active[0] = READ_ONCE(vma->numab_state->pids_active[1]);
3269+
vma->numab_state->pids_active[1] = 0;
32703270
}
32713271

32723272
do {

0 commit comments

Comments
 (0)