Hi all, Please let me explain what I am trying to do first. First, I compile a 64 bit binary so that it'll be loaded above 4G virtual space, so the virtual space below 4G is empty. I want to make a virtual address below 4G share the same phys page with another virtual address above 4G, so that read/write vadd1 just like vaddr2. PGD/PUD/PMD Page Table ---------- Phys Page 2 | | -------- |----------| | | vaddr2 | pte 2 | ---------> | | |----------| | | | | -------- | | ^ 4G above | | | --------------------------------------------- | | | | | | | |----------| | vaddr1 | pte 1 | --------------- |----------| | | |__________| Currently, I choose to manually create PUD/PMD/PT associated with vaddr1 , and set pte1 to point to phys page 2 (you can see the attach example syscall, vadd1 is fixed to 0x10000000 for simplicity). However, the page I create for PMD in the example will cause memory leak (see below). What is the proper way to do so that kernel can free the page I allocated automatically when the application calling the syscall is terminated? pmd = pmd_offset(pud, vaddr); if(pmd_none(*pmd)) { page = pte_alloc_one(current->mm, vaddr); pmd_n = mk_pmd(page, pgprot); set_pmd(pmd, pmd_n); } Thanks! Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj