Merge tag 'nfs-for-5.14-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[linux-2.6-microblaze.git] / drivers / virtio / virtio_balloon.c
index 510e931..47dce91 100644 (file)
@@ -993,6 +993,23 @@ static int virtballoon_probe(struct virtio_device *vdev)
                        goto out_unregister_oom;
                }
 
+               /*
+                * The default page reporting order is @pageblock_order, which
+                * corresponds to 512MB in size on ARM64 when 64KB base page
+                * size is used. The page reporting won't be triggered if the
+                * freeing page can't come up with a free area like that huge.
+                * So we specify the page reporting order to 5, corresponding
+                * to 2MB. It helps to avoid THP splitting if 4KB base page
+                * size is used by host.
+                *
+                * Ideally, the page reporting order is selected based on the
+                * host's base page size. However, it needs more work to report
+                * that value. The hard-coded order would be fine currently.
+                */
+#if defined(CONFIG_ARM64) && defined(CONFIG_ARM64_64K_PAGES)
+               vb->pr_dev_info.order = 5;
+#endif
+
                err = page_reporting_register(&vb->pr_dev_info);
                if (err)
                        goto out_unregister_oom;