lkml.org 
[lkml]   [2008]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] adjust/fix LDT handling for Xen
>> --- linux-2.6.24-rc7/arch/x86/kernel/ldt_32.c	2008-01-10 16:53:54.000000000 +0100
>> +++ 2.6.24-rc7-x86-xen-ldt/arch/x86/kernel/ldt_32.c 2008-01-09 13:59:50.000000000 +0100
>[...]
>> @@ -73,7 +72,7 @@ static int alloc_ldt(mm_context_t *pc, u
>> if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
>> vfree(oldldt);
>> else
>> - kfree(oldldt);
>> + put_page(virt_to_page(oldldt));
>> }
>> return 0;
>> }
>> @@ -117,7 +116,7 @@ void destroy_context(struct mm_struct *m
>> if ((unsigned)mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
>> vfree(mm->context.ldt);
>> else
>> - kfree(mm->context.ldt);
>> + put_page(virt_to_page(mm->context.ldt));
>
>why not free_page() with all those checks if it is correct virt address which it
>brings?

I followed the combination I found elsewhere - __get_free_page/put_page
or alloc_page/free_page. I admit that I'm unclear about when/why to use
one vs. the other pair.

Jan



\
 
 \ /
  Last update: 2008-01-11 11:13    [W:0.094 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site