+               if (PageHuge(page) && cc->alloc_contig) {
+                       ret = isolate_or_dissolve_huge_page(page);
+
+                       /*
+                        * Fail isolation in case 
isolate_or_dissolve_huge_page()
+                        * reports an error. In case of -ENOMEM, abort right 
away.
+                        */
+                       if (ret < 0) {
+                               /*
+                                * Do not report -EBUSY down the chain.
+                                */

Nit: can fit this into a single line.

+                               if (ret != -ENOMEM)
+                                       ret = 0;

Nit: I wonder if ret == -EBUSY would be clearer.

+                               low_pfn += (1UL << compound_order(page)) - 1;
+                               goto isolate_fail;
+                       }
+
+                       /*
+                        * Ok, the hugepage was dissolved. Now these pages are
+                        * Buddy and cannot be re-allocated because they are
+                        * isolated. Fall-through as the check below handles
+                        * Buddy pages.
+                        */
+               }
+

[...]

+/*
+ * alloc_and_dissolve_huge_page - Allocate a new page and dissolve the old one
+ * @h: struct hstate old page belongs to
+ * @old_page: Old page to dissolve
+ * Returns 0 on success, otherwise negated error.
+ */
+

nit: remove that line

Acked-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb

Reply via email to