Skip to contentSkip to conversation

fix incorrect compound page flags store

PATCH In review yaoaili [么爱利] 3 participants 4 messages Sep 2, 2020 – Sep 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix incorrect compound page flags store

PageHuge(p) branch will never be true,but for compound page we need to set page_flags to correct value.

mm/memory-failure.c +1 -1
index f1aa6433f404..e6995976b11d 100644
@@ -1382,7 +1382,7 @@ int memory_failure(unsigned long pfn, int flags)
         * page_remove_rmap() in try_to_unmap_one(). So to determine page status
         * correctly, we save a copy of the page flags at this time.
         */
-       if (PageHuge(p))
+       if (PageCompound(p))
                page_flags = hpage->flags;
        else
                page_flags = p->flags;

--
2.25.1

Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · yaoaili [么爱利]

PageHuge(p) branch will never be true,but for compound page we need to set page_flags to correct value.

You're missing a Signed-off-by line.

Your analysis is correct; PageHuge was tested for a few dozen lines higher, and we ran off to a different function.

Ad far as I understand this function, this looks right to me.

Quoted 15 lines
mm/memory-failure.c +1 -2
index f1aa6433f404..e6995976b11d 100644
@@ -1382,7 +1382,7 @@ int memory_failure(unsigned long pfn, int flags)
         * page_remove_rmap() in try_to_unmap_one(). So to determine page status
         * correctly, we save a copy of the page flags at this time.
         */
-       if (PageHuge(p))
+       if (PageCompound(p))
                page_flags = hpage->flags;
        else
                page_flags = p->flags;
--

2.25.1

author Reviewed-by Matthew Wilcox (Oracle)
#2 lore raw

-----邮件原件-----
发件人: Matthew Wilcox [mailto:[email protected]]
发送时间: 2020年9月2日 19:35
收件人: yaoaili [么爱利] <[email protected]>
抄送: [email protected]; [email protected]; YANGFENG1 [杨峰] <[email protected]> 主题: Re: [PATCH] fix incorrect compound page flags store

Quoted 1 line · yaoaili [么爱利]

PageHuge(p) branch will never be true,but for compound page we need to set page_flags to correct value.

You're missing a Signed-off-by line.

Your analysis is correct; PageHuge was tested for a few dozen lines higher, and we ran off to a different function.

Ad far as I understand this function, this looks right to me.

Quoted 15 lines
mm/memory-failure.c index renamed from mm/memory-failure.c +0 -0

f1aa6433f404..e6995976b11d 100644

mm/memory-failure.c +1 -2
@@ -1382,7 +1382,7 @@ int memory_failure(unsigned long pfn, int flags)
         * page_remove_rmap() in try_to_unmap_one(). So to determine page status
         * correctly, we save a copy of the page flags at this time.
         */
-       if (PageHuge(p))
+       if (PageCompound(p))
                page_flags = hpage->flags;
        else
                page_flags = p->flags;
--

2.25.1

#3 lore raw

Hi,

Thank you for sending a patch. The change itself is fine to me, but you might need adjust and resubmit it in accordance with the guideline.

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

# Signed-off-by line should be included in the patch description,

# and you need send a patch in plain text mode.

Thanks,
Naoya Horiguchi

Quoted 38 lines · yaoaili [么爱利]

-----邮件原件-----
发件人: Matthew Wilcox [mailto:[email protected]]
发送时间: 2020年9月2日 19:35
收件人: yaoaili [么爱利] <[email protected]>
抄送: [email protected]; [email protected]; YANGFENG1 [杨峰] <[email protected]> 主题: Re: [PATCH] fix incorrect compound page flags store

Quoted 1 line · yaoaili [么爱利]

PageHuge(p) branch will never be true,but for compound page we need to set page_flags to correct value.

You're missing a Signed-off-by line.

Your analysis is correct; PageHuge was tested for a few dozen lines higher, and we ran off to a different function.

Ad far as I understand this function, this looks right to me.

Quoted 15 lines
mm/memory-failure.c index renamed from mm/memory-failure.c +0 -0

f1aa6433f404..e6995976b11d 100644

mm/memory-failure.c +1 -2
@@ -1382,7 +1382,7 @@ int memory_failure(unsigned long pfn, int flags)
         * page_remove_rmap() in try_to_unmap_one(). So to determine page status
         * correctly, we save a copy of the page flags at this time.
         */
-       if (PageHuge(p))
+       if (PageCompound(p))
                page_flags = hpage->flags;
        else
                page_flags = p->flags;
--

2.25.1