* [RFC PATCH 3/3] mm: support free hugepage pre zero out
@ 2020-12-22 7:49 Liang Li
2020-12-22 8:31 ` David Hildenbrand
0 siblings, 1 reply; 4+ messages in thread
From: Liang Li @ 2020-12-22 7:49 UTC (permalink / raw)
To: Alexander Duyck, Mel Gorman, Andrew Morton, Andrea Arcangeli,
Dan Williams, Michael S. Tsirkin, David Hildenbrand, Jason Wang,
Dave Hansen, Michal Hocko, Liang Li, Mike Kravetz, Liang Li
Cc: linux-mm, linux-kernel, virtualization, qemu-devel
This patch add support of pre zero out free hugepage, we can use
this feature to speed up page population and page fault handing.
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Liang Li <liliang324@gmail.com>
Signed-off-by: Liang Li <liliangleo@didiglobal.com>
---
mm/page_prezero.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/mm/page_prezero.c b/mm/page_prezero.c
index c8ce720bfc54..dff4e0adf402 100644
--- a/mm/page_prezero.c
+++ b/mm/page_prezero.c
@@ -26,6 +26,7 @@ static unsigned long delay_millisecs = 1000;
static unsigned long zeropage_enable __read_mostly;
static DEFINE_MUTEX(kzeropaged_mutex);
static struct page_reporting_dev_info zero_page_dev_info;
+static struct page_reporting_dev_info zero_hugepage_dev_info;
inline void clear_zero_page_flag(struct page *page, int order)
{
@@ -69,9 +70,17 @@ static int start_kzeropaged(void)
zero_page_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
err = page_reporting_register(&zero_page_dev_info);
+
+ zero_hugepage_dev_info.report = zero_free_pages;
+ zero_hugepage_dev_info.mini_order = mini_page_order;
+ zero_hugepage_dev_info.batch_size = batch_size;
+ zero_hugepage_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
+
+ err |= hugepage_reporting_register(&zero_hugepage_dev_info);
pr_info("Zero page enabled\n");
} else {
page_reporting_unregister(&zero_page_dev_info);
+ hugepage_reporting_unregister(&zero_hugepage_dev_info);
pr_info("Zero page disabled\n");
}
@@ -90,7 +99,15 @@ static int restart_kzeropaged(void)
zero_page_dev_info.batch_size = batch_size;
zero_page_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
+ hugepage_reporting_unregister(&zero_hugepage_dev_info);
+
+ zero_hugepage_dev_info.report = zero_free_pages;
+ zero_hugepage_dev_info.mini_order = mini_page_order;
+ zero_hugepage_dev_info.batch_size = batch_size;
+ zero_hugepage_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
+
err = page_reporting_register(&zero_page_dev_info);
+ err |= hugepage_reporting_register(&zero_hugepage_dev_info);
pr_info("Zero page enabled\n");
}
--
2.18.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC PATCH 3/3] mm: support free hugepage pre zero out
2020-12-22 7:49 [RFC PATCH 3/3] mm: support free hugepage pre zero out Liang Li
@ 2020-12-22 8:31 ` David Hildenbrand
2020-12-22 8:49 ` David Hildenbrand
0 siblings, 1 reply; 4+ messages in thread
From: David Hildenbrand @ 2020-12-22 8:31 UTC (permalink / raw)
To: Alexander Duyck, Mel Gorman, Andrew Morton, Andrea Arcangeli,
Dan Williams, Michael S. Tsirkin, Jason Wang, Dave Hansen,
Michal Hocko, Liang Li, Mike Kravetz, Liang Li, linux-mm,
linux-kernel, virtualization, qemu-devel
On 22.12.20 08:49, Liang Li wrote:
> This patch add support of pre zero out free hugepage, we can use
> this feature to speed up page population and page fault handing.
>
> Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Dave Hansen <dave.hansen@intel.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Liang Li <liliang324@gmail.com>
> Signed-off-by: Liang Li <liliangleo@didiglobal.com>
> ---
> mm/page_prezero.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/mm/page_prezero.c b/mm/page_prezero.c
> index c8ce720bfc54..dff4e0adf402 100644
> --- a/mm/page_prezero.c
> +++ b/mm/page_prezero.c
> @@ -26,6 +26,7 @@ static unsigned long delay_millisecs = 1000;
> static unsigned long zeropage_enable __read_mostly;
> static DEFINE_MUTEX(kzeropaged_mutex);
> static struct page_reporting_dev_info zero_page_dev_info;
> +static struct page_reporting_dev_info zero_hugepage_dev_info;
>
> inline void clear_zero_page_flag(struct page *page, int order)
> {
> @@ -69,9 +70,17 @@ static int start_kzeropaged(void)
> zero_page_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
>
> err = page_reporting_register(&zero_page_dev_info);
> +
> + zero_hugepage_dev_info.report = zero_free_pages;
> + zero_hugepage_dev_info.mini_order = mini_page_order;
> + zero_hugepage_dev_info.batch_size = batch_size;
> + zero_hugepage_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
> +
> + err |= hugepage_reporting_register(&zero_hugepage_dev_info);
> pr_info("Zero page enabled\n");
> } else {
> page_reporting_unregister(&zero_page_dev_info);
> + hugepage_reporting_unregister(&zero_hugepage_dev_info);
> pr_info("Zero page disabled\n");
> }
>
> @@ -90,7 +99,15 @@ static int restart_kzeropaged(void)
> zero_page_dev_info.batch_size = batch_size;
> zero_page_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
>
> + hugepage_reporting_unregister(&zero_hugepage_dev_info);
> +
> + zero_hugepage_dev_info.report = zero_free_pages;
> + zero_hugepage_dev_info.mini_order = mini_page_order;
> + zero_hugepage_dev_info.batch_size = batch_size;
> + zero_hugepage_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
> +
> err = page_reporting_register(&zero_page_dev_info);
> + err |= hugepage_reporting_register(&zero_hugepage_dev_info);
> pr_info("Zero page enabled\n");
> }
>
>
Free page reporting in virtio-balloon doesn't give you any guarantees
regarding zeroing of pages. Take a look at the QEMU implementation -
e.g., with vfio all reports are simply ignored.
Also, I am not sure if mangling such details ("zeroing of pages") into
the page reporting infrastructure is a good idea.
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH 3/3] mm: support free hugepage pre zero out
2020-12-22 8:31 ` David Hildenbrand
@ 2020-12-22 8:49 ` David Hildenbrand
2020-12-22 12:13 ` Liang Li
0 siblings, 1 reply; 4+ messages in thread
From: David Hildenbrand @ 2020-12-22 8:49 UTC (permalink / raw)
To: Alexander Duyck, Mel Gorman, Andrew Morton, Andrea Arcangeli,
Dan Williams, Michael S. Tsirkin, Jason Wang, Dave Hansen,
Michal Hocko, Liang Li, Mike Kravetz, Liang Li, linux-mm,
linux-kernel, virtualization, qemu-devel
On 22.12.20 09:31, David Hildenbrand wrote:
> On 22.12.20 08:49, Liang Li wrote:
>> This patch add support of pre zero out free hugepage, we can use
>> this feature to speed up page population and page fault handing.
>>
>> Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
>> Cc: Mel Gorman <mgorman@techsingularity.net>
>> Cc: Andrea Arcangeli <aarcange@redhat.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: Dave Hansen <dave.hansen@intel.com>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: Michal Hocko <mhocko@suse.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Alex Williamson <alex.williamson@redhat.com>
>> Cc: Michael S. Tsirkin <mst@redhat.com>
>> Cc: Jason Wang <jasowang@redhat.com>
>> Cc: Mike Kravetz <mike.kravetz@oracle.com>
>> Cc: Liang Li <liliang324@gmail.com>
>> Signed-off-by: Liang Li <liliangleo@didiglobal.com>
>> ---
>> mm/page_prezero.c | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/mm/page_prezero.c b/mm/page_prezero.c
>> index c8ce720bfc54..dff4e0adf402 100644
>> --- a/mm/page_prezero.c
>> +++ b/mm/page_prezero.c
>> @@ -26,6 +26,7 @@ static unsigned long delay_millisecs = 1000;
>> static unsigned long zeropage_enable __read_mostly;
>> static DEFINE_MUTEX(kzeropaged_mutex);
>> static struct page_reporting_dev_info zero_page_dev_info;
>> +static struct page_reporting_dev_info zero_hugepage_dev_info;
>>
>> inline void clear_zero_page_flag(struct page *page, int order)
>> {
>> @@ -69,9 +70,17 @@ static int start_kzeropaged(void)
>> zero_page_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
>>
>> err = page_reporting_register(&zero_page_dev_info);
>> +
>> + zero_hugepage_dev_info.report = zero_free_pages;
>> + zero_hugepage_dev_info.mini_order = mini_page_order;
>> + zero_hugepage_dev_info.batch_size = batch_size;
>> + zero_hugepage_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
>> +
>> + err |= hugepage_reporting_register(&zero_hugepage_dev_info);
>> pr_info("Zero page enabled\n");
>> } else {
>> page_reporting_unregister(&zero_page_dev_info);
>> + hugepage_reporting_unregister(&zero_hugepage_dev_info);
>> pr_info("Zero page disabled\n");
>> }
>>
>> @@ -90,7 +99,15 @@ static int restart_kzeropaged(void)
>> zero_page_dev_info.batch_size = batch_size;
>> zero_page_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
>>
>> + hugepage_reporting_unregister(&zero_hugepage_dev_info);
>> +
>> + zero_hugepage_dev_info.report = zero_free_pages;
>> + zero_hugepage_dev_info.mini_order = mini_page_order;
>> + zero_hugepage_dev_info.batch_size = batch_size;
>> + zero_hugepage_dev_info.delay_jiffies = msecs_to_jiffies(delay_millisecs);
>> +
>> err = page_reporting_register(&zero_page_dev_info);
>> + err |= hugepage_reporting_register(&zero_hugepage_dev_info);
>> pr_info("Zero page enabled\n");
>> }
>>
>>
>
> Free page reporting in virtio-balloon doesn't give you any guarantees
> regarding zeroing of pages. Take a look at the QEMU implementation -
> e.g., with vfio all reports are simply ignored.
>
> Also, I am not sure if mangling such details ("zeroing of pages") into
> the page reporting infrastructure is a good idea.
>
Oh, now I get what you are doing here, you rely on zero_free_pages of
your other patch series and are not relying on virtio-balloon free page
reporting to do the zeroing.
You really should have mentioned that this patch series relies on the
other one and in which way.
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH 3/3] mm: support free hugepage pre zero out
2020-12-22 8:49 ` David Hildenbrand
@ 2020-12-22 12:13 ` Liang Li
0 siblings, 0 replies; 4+ messages in thread
From: Liang Li @ 2020-12-22 12:13 UTC (permalink / raw)
To: David Hildenbrand
Cc: Alexander Duyck, Mel Gorman, Andrew Morton, Andrea Arcangeli,
Dan Williams, Michael S. Tsirkin, Jason Wang, Dave Hansen,
Michal Hocko, Liang Li, Mike Kravetz, linux-mm, linux-kernel,
virtualization, qemu-devel
> > Free page reporting in virtio-balloon doesn't give you any guarantees
> > regarding zeroing of pages. Take a look at the QEMU implementation -
> > e.g., with vfio all reports are simply ignored.
> >
> > Also, I am not sure if mangling such details ("zeroing of pages") into
> > the page reporting infrastructure is a good idea.
> >
>
> Oh, now I get what you are doing here, you rely on zero_free_pages of
> your other patch series and are not relying on virtio-balloon free page
> reporting to do the zeroing.
>
> You really should have mentioned that this patch series relies on the
> other one and in which way.
I am sorry for that. After I sent out the patch, I realized I should
mention that, so I sent out an updated version which added the
information you mentioned :)
Thanks !
Liang
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-22 12:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 7:49 [RFC PATCH 3/3] mm: support free hugepage pre zero out Liang Li
2020-12-22 8:31 ` David Hildenbrand
2020-12-22 8:49 ` David Hildenbrand
2020-12-22 12:13 ` Liang Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).