From mboxrd@z Thu Jan 1 00:00:00 1970 From: bill_carson@126.com (rocky) Date: Wed, 9 Mar 2011 10:49:01 +0800 (CST) Subject: Question about free_pgd_slow ? In-Reply-To: References: <79b2dce2.4b84.12e5ae30c01.Coremail.bill_carson@126.com> <14bf5cc1.490f.12e858767f5.Coremail.bill_carson@126.com> Message-ID: <13b7a6f5.3213.12e98847729.Coremail.bill_carson@126.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org At 2011-03-07 22:44:58?"Rabin Vincent" wrote: >2011/3/5 rocky : >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 >mm_put(), and finish_task_switch(), which does the mmdrop(). crystal clear:) your explanation DOES make sense I can say when mm->mm_count ==0 , current_thread_info is not the thread info corresponding with mm used in mmdrop() currently I am working on hugetlb for ARM I put huge page table in thread_info when calling pgd_alloc and wants to free it in pgd_free which is doomed to fail. now I move those cookies into mm_struct , definitely not right place. but I cannot find a desired place! Thanks Rabin rocky -------------- next part -------------- An HTML attachment was scrubbed... URL: