How to deal the circumstance of ASIDs are used up in Linux kernel? -
asid(the address space identifier) in arm architecture occupy 8 bits in register. means 256 asids can allocated. in linux kernel there maor 1024 tasks can run @ same time. how deal circumstance of asids used in linux kernel? had checked kernel source code, when asids used up, kernel allocate asid new task start again. considering 1 circumstance, newest task own first asid(0b1000 0000 0000 0001), there 1 task must own same asid. if 2 tasks need cantext switch? had not found related kernel source code. related codes in linux kernel in ~/kernel/core.c context_switch() .any reply appreciated much, in advance
best regards. heron
i had found instructions that, follow(cortex -a9 programmer guide p8-20): asids dynamically allocated , not guaranteed constant during lifetime of process. asid register provides ei ght bits of asid space , can have more 256 processes, linux has scheme allo cating asids. new process, increment last asid value used. when last value reached, have take action. tlb flushed (across processors in smp system). value in top 24 bits in context id register, can considered “gener ation” number, incremented. stepping new generation means asid values previous generation invalid , asid numbering restarted. on context switch, processes use older generation version of context id value assigned new asid
so cpu increment automatically when asid used up, , when context switch kernel check whether high-bits set(old asid), if create new asid task. can avoid problem i'd mentioned above.
thanks.
Comments
Post a Comment