Skip to contentSkip to conversation

Why are the pages not migrated to current cpuset after 'memory_migrate' is set true

DISCUSSION Miao Xie 3 participants 3 messages Dec 16, 2008

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

Hi, Paul

I found the pages that task had allocated to it on nodes in its previous cpuset were not migrated to the tasks' current cpuset after 'memory_migrate' was set true. It looks strange for users. Why are the pages not migrated to current cpuset after 'memory_migrate' is set true?

Step I did
1, allocate pages on cpuset (mems is 0, memory_migrate is 0) 2, change cpuset's mems (mems: 0 -> 1)
3, change cpuset's memory_migrate(memory_migrate: 0 -> 1)

Regards
Miao Xie

#1 lore raw

Hi.

Quoted 7 lines · Miao Xie

Hi, Paul

I found the pages that task had allocated to it on nodes in its previous cpuset were not migrated to the tasks' current cpuset after 'memory_migrate' was set true. It looks strange for users. Why are the pages not migrated to current cpuset after 'memory_migrate' is set true?

I don't know the reason of current behavior, but

Quoted 5 lines

Step I did
1, allocate pages on cpuset (mems is 0, memory_migrate is 0) 2, change cpuset's mems (mems: 0 -> 1)
3, change cpuset's memory_migrate(memory_migrate: 0 -> 1)

from/to which node kernel should migrate pages in general ?

Should kernel remember previous value of "mems" ? What if we change "mems" several times before setting memory_migrate ON ?

IMHO, current behavior is not so strange. All users have to do is set memory_migrate ON *before* changing "mems" or attaching task if they want to migrate pages.

Thanks,
Daisuke Nishimura.

#2 lore raw
In reply to Miao Xie
Quoted 9 lines · Miao Xie

I found the pages that task had allocated to it on nodes in its previous cpuset were not migrated to the tasks' current cpuset after 'memory_migrate' was set true. It looks strange for users. Why are the pages not migrated to current cpuset after 'memory_migrate' is set true?

Step I did
1, allocate pages on cpuset (mems is 0, memory_migrate is 0) 2, change cpuset's mems (mems: 0 -> 1)
3, change cpuset's memory_migrate(memory_migrate: 0 -> 1)

As Daisuke says, migration only occurs when the mems file is changed *after* memory_migrate has been set to 1.

Paul