[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] vm_page.c: fix a deadlock when running with smp enabled
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] vm_page.c: fix a deadlock when running with smp enabled |
Date: |
Mon, 2 Dec 2024 19:44:27 +0100 |
Applied, thanks!
Etienne Brateau, le lun. 02 déc. 2024 19:27:17 +0100, a ecrit:
> 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.
> ---
> vm/vm_page.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/vm/vm_page.c b/vm/vm_page.c
> index 286fe62f..e329354f 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(src->object) != 0);
> vm_page_insert(dest, object, offset);
> vm_object_unlock(object);
>
> --
> 2.47.0
>
>