From: Gavin Shan <gshan@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
alexander.h.duyck@linux.intel.com, david@redhat.com,
shan.gavin@gmail.com
Subject: Re: [RFC PATCH] mm/page_reporting: Adjust threshold according to MAX_ORDER
Date: Fri, 11 Jun 2021 12:54:51 +1000 [thread overview]
Message-ID: <c1aba468-d309-2fe7-74c3-1f93860482d8@redhat.com> (raw)
In-Reply-To: <20210601170347.d78ec4af51b1522305deef4a@linux-foundation.org>
On 6/2/21 10:03 AM, Andrew Morton wrote:
> On Tue, 1 Jun 2021 11:33:19 +0800 Gavin Shan <gshan@redhat.com> wrote:
>
>> The PAGE_REPORTING_MIN_ORDER is equal to @pageblock_order, taken as
>> minimal order (threshold) to trigger page reporting. The page reporting
>> is never triggered with the following configurations and settings on
>> aarch64. In the particular scenario, the page reporting won't be triggered
>> until the largest (2 ^ (MAX_ORDER-1)) free area is achieved from the
>> page freeing. The condition is very hard, or even impossible to be met.
>>
>> CONFIG_ARM64_PAGE_SHIFT: 16
>> CONFIG_HUGETLB_PAGE: Y
>> CONFIG_HUGETLB_PAGE_SIZE_VARIABLE: N
>> pageblock_order: 13
>> CONFIG_FORCE_MAX_ZONEORDER: 14
>> MAX_ORDER: 14
>>
>> The issue can be reproduced in VM, running kernel with above configurations
>> and settings. The 'memhog' is used inside the VM to access 512MB anonymous
>> area. The QEMU's RSS doesn't drop accordingly after 'memhog' exits.
>>
>> /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64 \
>> -accel kvm -machine virt,gic-version=host \
>> -cpu host -smp 8,sockets=2,cores=4,threads=1 -m 4096M,maxmem=64G \
>> -object memory-backend-ram,id=mem0,size=2048M \
>> -object memory-backend-ram,id=mem1,size=2048M \
>> -numa node,nodeid=0,cpus=0-3,memdev=mem0 \
>> -numa node,nodeid=1,cpus=4-7,memdev=mem1 \
>> : \
>> -device virtio-balloon-pci,id=balloon0,free-page-reporting=yes
>>
>> This tries to fix the issue by adjusting the threshold to the smaller value
>> of @pageblock_order and (MAX_ORDER/2). With this applied, the QEMU's RSS
>> drops after 'memhog' exits.
>>
>
> Sounds promising, but...
>
>> --- a/mm/page_reporting.h
>> +++ b/mm/page_reporting.h
>> @@ -10,9 +10,10 @@
>> #include <linux/pgtable.h>
>> #include <linux/scatterlist.h>
>>
>> -#define PAGE_REPORTING_MIN_ORDER pageblock_order
>> -
>> #ifdef CONFIG_PAGE_REPORTING
>> +#define PAGE_REPORTING_MIN_ORDER \
>> + min_t(unsigned int, pageblock_order, (MAX_ORDER / 2))
>> +
>> DECLARE_STATIC_KEY_FALSE(page_reporting_enabled);
>> void __page_reporting_notify(void);
>
> Could you please redo this as a regular old static function in
> page_reporting.c? Bonus points for commenting its design ;)
>
Thanks for your time to review, Andrew. Sorry for the delay and late
reply. Yes, I will do if needed after the discussion with David is
finalized.
Thanks,
Gavin
prev parent reply other threads:[~2021-06-11 0:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 3:33 Gavin Shan
2021-06-01 8:01 ` David Hildenbrand
2021-06-11 7:44 ` Gavin Shan
2021-06-14 11:03 ` David Hildenbrand
2021-06-15 2:26 ` Alexander Duyck
2021-06-16 9:10 ` Gavin Shan
2021-06-16 8:03 ` David Hildenbrand
2021-06-16 13:16 ` Gavin Shan
2021-06-16 11:20 ` David Hildenbrand
2021-06-16 13:58 ` Gavin Shan
2021-06-16 12:07 ` David Hildenbrand
2021-06-21 5:16 ` Gavin Shan
2021-06-16 14:15 ` Alexander Duyck
2021-06-21 7:03 ` Gavin Shan
2021-06-21 7:52 ` Gavin Shan
2021-06-21 13:43 ` Alexander Duyck
2021-06-16 1:53 ` Gavin Shan
2021-06-16 7:59 ` David Hildenbrand
2021-06-16 12:59 ` Gavin Shan
2021-06-16 11:15 ` David Hildenbrand
2021-06-02 0:03 ` Andrew Morton
2021-06-11 2:54 ` Gavin Shan [this message]
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=c1aba468-d309-2fe7-74c3-1f93860482d8@redhat.com \
--to=gshan@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shan.gavin@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®