lkml.org 
[lkml]   [2000]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectvfree() question.
Hi,

In vfree() shouldn't we be dropping vmlist_lock spinlock as soon as we
unlinked the item from the vmlist? I.e. before we free the actual pages
and the vm_struct itself. Or, perhaps it should be done _after_
vmfree_area_pages() but definitely before kfree(tmp) since tmp is no
longer visible outside the function. (My only doubt whether
vmfree_area_pages() should be inside the lock is because those pages may
otherwise be reused for the next vmalloc request).

(actually I put that spinlock in vfree and get_vm_area so at the time it
seemed "obviously correct" but now I am having thoughts that it can still
be optimized more).

Regards,
Tigran

PS. To be specific, here is the patch I had in mind:

--- linux/mm/vmalloc.c Mon Nov 20 11:56:14 2000
+++ work/mm/vmalloc.c Wed Nov 22 11:25:29 2000
@@ -214,9 +214,9 @@
for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) {
if (tmp->addr == addr) {
*p = tmp->next;
+ write_unlock(&vmlist_lock);
vmfree_area_pages(VMALLOC_VMADDR(tmp->addr), tmp->size);
kfree(tmp);
- write_unlock(&vmlist_lock);
return;
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:47    [W:0.026 / U:14.592 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site