mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: I Hsin Cheng <richard120310@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: pgtable: Ensure pml spinlock gets unlock
Date: Mon, 10 Feb 2025 16:42:13 +0800	[thread overview]
Message-ID: <4524511c-d685-4af6-9de9-4f15f7dcfe05@bytedance.com> (raw)
In-Reply-To: <e5d5bafc-7809-42c2-ba8d-554b9667d00c@bytedance.com>



On 2025/2/10 16:31, Qi Zheng wrote:
> 

[...]

>>>>
>>>> diff --git a/mm/pt_reclaim.c b/mm/pt_reclaim.c
>>>> index 7e9455a18aae..163e38f1728d 100644
>>>> --- a/mm/pt_reclaim.c
>>>> +++ b/mm/pt_reclaim.c
>>>> @@ -43,7 +43,7 @@ void try_to_free_pte(struct mm_struct *mm, pmd_t 
>>>> *pmd, unsigned long addr,
>>>>        pml = pmd_lock(mm, pmd);
>>>>        start_pte = pte_offset_map_rw_nolock(mm, pmd, addr, &pmdval, 
>>>> &ptl);
>>>>        if (!start_pte)

Maybe we can return directly here:

             if (!start_pte) {
		spin_unlock(pml);
                 return;
             }

>>>> -        goto out_ptl;
>>>> +        goto out_pte;
>>>>        if (ptl != pml)
>>>>            spin_lock_nested(ptl, SINGLE_DEPTH_NESTING);
>>>> @@ -68,4 +68,8 @@ void try_to_free_pte(struct mm_struct *mm, pmd_t 
>>>> *pmd, unsigned long addr,
>>>>            pte_unmap_unlock(start_pte, ptl);
>>>>        if (ptl != pml)
>>>>            spin_unlock(pml);
>>>> +    return;
>>>> +
>>>> +out_pte:
>>>> +    spin_unlock(pml);
>>>>    }
>>

  reply	other threads:[~2025-02-10  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-08 18:49 I Hsin Cheng
2025-02-10  4:05 ` Qi Zheng
2025-02-10  8:20   ` I Hsin Cheng
2025-02-10  8:31     ` Qi Zheng
2025-02-10  8:42       ` Qi Zheng [this message]
2025-02-10  8:59         ` I Hsin Cheng
2025-02-10 10:12         ` I Hsin Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4524511c-d685-4af6-9de9-4f15f7dcfe05@bytedance.com \
    --to=zhengqi.arch@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=richard120310@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®