Skip to content

Commit

Permalink
[refactor]rename run_migrating to migration_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Nov 22, 2024
1 parent fe73632 commit 252800a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/axtask/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,16 @@ pub fn set_current_affinity(cpumask: AxCpuMask) -> bool {
const MIGRATION_TASK_STACK_SIZE: usize = 4096;
// Spawn a new migration task for migrating.
let migration_task = TaskInner::new(
move || run_migrating(curr.clone()),
move || migrate_entry(curr.clone()),
"migration-task".into(),
MIGRATION_TASK_STACK_SIZE,
)
.into_arc();

// Migrate the current task to the correct CPU using the migration task.
current_run_queue::<NoPreemptIrqSave>().migrate_current(migration_task);

assert!(cpumask.get(axhal::cpu::this_cpu_id()), "Migration failed");
}
true
}
Expand Down Expand Up @@ -218,6 +220,6 @@ pub fn run_idle() -> ! {
///
/// It calls `select_run_queue` to get the correct run queue for the task, and
/// then puts the task to the run queue.
fn run_migrating(migrated_task: AxTaskRef) {
fn migrate_entry(migrated_task: AxTaskRef) {
select_run_queue::<NoPreemptIrqSave>(&migrated_task).put_prev_task(migrated_task);
}

0 comments on commit 252800a

Please sign in to comment.