[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C497B0EF-1B3A-4E4E-8888-D74B2CEFE2B3@nvidia.com>
Date: Tue, 31 Mar 2020 22:42:06 -0400
From: Zi Yan <ziy@...dia.com>
To: "Huang, Ying" <ying.huang@...el.com>
CC: Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>,
Andrea Arcangeli <aarcange@...hat.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Vlastimil Babka <vbabka@...e.cz>,
Alexey Dobriyan <adobriyan@...il.com>,
Michal Hocko <mhocko@...e.com>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
Jérôme Glisse <jglisse@...hat.com>,
Yang Shi <yang.shi@...ux.alibaba.com>
Subject: Re: [PATCH] /proc/PID/smaps: Add PMD migration entry parsing
On 31 Mar 2020, at 22:24, Huang, Ying wrote:
> External email: Use caution opening links or attachments
>
>
> Zi Yan <ziy@...dia.com> writes:
>
>> On 31 Mar 2020, at 4:56, Huang, Ying wrote:
>>>
>>> From: Huang Ying <ying.huang@...el.com>
>>>
>>> Now, when read /proc/PID/smaps, the PMD migration entry in page table is simply
>>> ignored. To improve the accuracy of /proc/PID/smaps, its parsing and processing
>>> is added.
>>>
>>> Signed-off-by: "Huang, Ying" <ying.huang@...el.com>
>>> Cc: Andrea Arcangeli <aarcange@...hat.com>
>>> Cc: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
>>> Cc: Zi Yan <ziy@...dia.com>
>>> Cc: Vlastimil Babka <vbabka@...e.cz>
>>> Cc: Alexey Dobriyan <adobriyan@...il.com>
>>> Cc: Michal Hocko <mhocko@...e.com>
>>> Cc: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
>>> Cc: "Jérôme Glisse" <jglisse@...hat.com>
>>> Cc: Yang Shi <yang.shi@...ux.alibaba.com>
>>> ---
>>> fs/proc/task_mmu.c | 16 ++++++++++++----
>>> 1 file changed, 12 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
>>> index 8d382d4ec067..b5b3aef8cb3b 100644
>>> --- a/fs/proc/task_mmu.c
>>> +++ b/fs/proc/task_mmu.c
>>> @@ -548,8 +548,17 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
>>> bool locked = !!(vma->vm_flags & VM_LOCKED);
>>> struct page *page;
>>
>> Like Konstantin pointed out in another email, you could initialize page to NULL here.
>> Plus you do not need the “else-return” below, if you do that.
>
> Yes. That looks better. Will change this in the next version.
Thanks.
>
>>>
>>> - /* FOLL_DUMP will return -EFAULT on huge zero page */
>>> - page = follow_trans_huge_pmd(vma, addr, pmd, FOLL_DUMP);
>>> + if (pmd_present(*pmd)) {
>>> + /* FOLL_DUMP will return -EFAULT on huge zero page */
>>> + page = follow_trans_huge_pmd(vma, addr, pmd, FOLL_DUMP);
>>> + } else if (unlikely(is_swap_pmd(*pmd))) {
>>
>> Should be:
>> } else if (unlikely(thp_migration_support() && is_swap_pmd(*pmd))) {
>>
>> Otherwise, when THP migration is disabled and the PMD is under splitting, VM_BUG_ON
>> will be triggered.
>
> We hold the PMD page table lock when call smaps_pmd_entry(). How does
> PMD splitting trigger VM_BUG_ON()?
Oh, I missed that. Your original code is right. Thank you for the explanation.
—
Best Regards,
Yan Zi
Download attachment "signature.asc" of type "application/pgp-signature" (855 bytes)
Powered by blists - more mailing lists