aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtienne Brateau <etienne.brateau@gmail.com>2024-12-02 19:27:17 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-02 19:44:00 +0100
commitab807f32085e5861bf3d3336c9de2c0d1e977b4c (patch)
tree6b31e5453226bef302744893a73f4e5695f3e31c
parent8ef7e26975544e0acce75610be8a372e5f5c4931 (diff)
downloadgnumach-ab807f32085e5861bf3d3336c9de2c0d1e977b4c.tar.gz
gnumach-ab807f32085e5861bf3d3336c9de2c0d1e977b4c.tar.bz2
gnumach-ab807f32085e5861bf3d3336c9de2c0d1e977b4c.zip
vm_page.c: fix a deadlock when running with smp enabled
the call vm_page_seg_pull_cache_page() return an vm_page (src) with his object being locked, as we don’t unlock before doing the vm_page_insert, it is still lock there, and so trying to relock it cause a deadlock. Replace this lock by an assert. This case was not seen as for non-smp locking is a no-op. Message-ID: <20241202182721.27920-2-etienne.brateau@gmail.com>
-rw-r--r--vm/vm_page.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm/vm_page.c b/vm/vm_page.c
index 286fe62f..b0d3b7c2 100644
--- a/vm/vm_page.c
+++ b/vm/vm_page.c
@@ -1036,7 +1036,8 @@ vm_page_seg_balance_page(struct vm_page_seg *seg,
simple_unlock(&seg->lock);
simple_unlock(&vm_page_queue_free_lock);
- vm_object_lock(object);
+ // object is already locked as vm_page_seg_alloc_from_buddy return it locked
+ assert(vm_object_lock_taken(object) != 0);
vm_page_insert(dest, object, offset);
vm_object_unlock(object);