At 2011-03-07 22:44:58£¬"Rabin Vincent" <rabin@rab.in> wrote:

>2011/3/5 rocky <bill_carson@126.com>:
>pgd_free() on the other hand is safe because it's called when we've
>switched away from this mm, and the page table is no longer in use
>(mm->mm_count == 0).
>
>Have a look at exit_mm(), which increases the mm_count before calling
&gt;mm_put(),&nbsp;and&nbsp;finish_task_switch(),&nbsp;which&nbsp;does&nbsp;the&nbsp;mmdrop().<br><br>
crystal clear:)<br>
your explanation DOES make sense<br><br>I can say when mm-&gt;mm_count ==0 , current_thread_info is not the thread info corresponding with mm used in mmdrop()<br><br>currently I am working on hugetlb for ARM <br>I put huge page table in thread_info when calling pgd_alloc<br>and wants to free it in pgd_free which is doomed to fail.<br>now I move those cookies into mm_struct , definitely not right place.<br>but I cannot find a desired place!<br><br>Thanks Rabin<br><br>rocky<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>