Skip to contentSkip to conversation

mm/page_alloc: drop pr_info_ratelimited() in alloc_contig_range()

PATCH Applied David Hildenbrand 5 participants 5 messages Mar 1, 2021 – Mar 2, 2021

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

PATCH 1/1 mm/page_alloc: drop pr_info_ratelimited() in alloc_contig_range()

The information that some PFNs are busy is:
a) not helpful for ordinary users: we don't even know *who* called alloc_contig_range(). This is certainly not worth a pr_info.*().
b) not really helpful for debugging: we don't have any details *why* these PFNs are busy, and that is what we usually care about.
c) not complete: there are other cases where we fail alloc_contig_range() using different paths that are not getting recorded.

For example, we reach this path once we succeeded in isolating pageblocks, but failed to migrate some pages - which can happen easily on ZONE_NORMAL (i.e., has_unmovable_pages() is racy) but also on ZONE_MOVABLE i.e., we would have to retry longer to migrate).

For example via virtio-mem when unplugging memory, we can create quite some noise (especially with ZONE_NORMAL) that is not of interest to users - it's expected that some allocations may fail as memory is busy.

Let's just drop that pr_info_ratelimit() and rather implement a dynamic debugging mechanism in the future that can give us a better reason why alloc_contig_range() failed on specific pages.

Cc Andrew Morton <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Vlastimil Babka <[email protected]>
---
 mm/page_alloc.c | 2 --
 1 file changed, 2 deletions(-)
mm/page_alloc.c +0 -2
index 519a60d5b6f7..efb924fb13e8 100644
@@ -8647,8 +8647,6 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 
 	/* Make sure the range is really isolated. */
 	if (test_pages_isolated(outer_start, end, 0)) {
-		pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n",
-			__func__, outer_start, end);
 		ret = -EBUSY;
 		goto done;
 	}
Signature · 1 line
2.29.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · David Hildenbrand

The information that some PFNs are busy is:
a) not helpful for ordinary users: we don't even know *who* called alloc_contig_range(). This is certainly not worth a pr_info.*().
b) not really helpful for debugging: we don't have any details *why* these PFNs are busy, and that is what we usually care about.
c) not complete: there are other cases where we fail alloc_contig_range() using different paths that are not getting recorded.

For example, we reach this path once we succeeded in isolating pageblocks, but failed to migrate some pages - which can happen easily on ZONE_NORMAL (i.e., has_unmovable_pages() is racy) but also on ZONE_MOVABLE i.e., we would have to retry longer to migrate).

For example via virtio-mem when unplugging memory, we can create quite some noise (especially with ZONE_NORMAL) that is not of interest to users - it's expected that some allocations may fail as memory is busy.

Let's just drop that pr_info_ratelimit() and rather implement a dynamic debugging mechanism in the future that can give us a better reason why alloc_contig_range() failed on specific pages.

Quoted 7 lines
Cc Andrew Morton <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

LGTM. I agree that the printout is not quite useful.

—
Best Regards,
Yan Zi

reviewer Acked-by on v1 1/1
#2 lore raw
In reply to David Hildenbrand
Quoted 21 lines · David Hildenbrand

The information that some PFNs are busy is:
a) not helpful for ordinary users: we don't even know *who* called alloc_contig_range(). This is certainly not worth a pr_info.*().
b) not really helpful for debugging: we don't have any details *why* these PFNs are busy, and that is what we usually care about.
c) not complete: there are other cases where we fail alloc_contig_range() using different paths that are not getting recorded.

For example, we reach this path once we succeeded in isolating pageblocks, but failed to migrate some pages - which can happen easily on ZONE_NORMAL (i.e., has_unmovable_pages() is racy) but also on ZONE_MOVABLE i.e., we would have to retry longer to migrate).

For example via virtio-mem when unplugging memory, we can create quite some noise (especially with ZONE_NORMAL) that is not of interest to users - it's expected that some allocations may fail as memory is busy.

Let's just drop that pr_info_ratelimit() and rather implement a dynamic debugging mechanism in the future that can give us a better reason why alloc_contig_range() failed on specific pages.

Quoted 6 lines
Cc Andrew Morton <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Vlastimil Babka <[email protected]>
Quoted 19 lines
---
 mm/page_alloc.c | 2 --
 1 file changed, 2 deletions(-)
mm/page_alloc.c +0 -2
index 519a60d5b6f7..efb924fb13e8 100644
@@ -8647,8 +8647,6 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 
 	/* Make sure the range is really isolated. */
 	if (test_pages_isolated(outer_start, end, 0)) {
-		pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n",
-			__func__, outer_start, end);
 		ret = -EBUSY;
 		goto done;
 	}
Signature · 1 line
2.29.2
Signature · 2 lines
Michal Hocko
SUSE Labs
Reviewed-by on v1 1/1
#3 lore raw
In reply to David Hildenbrand
Quoted 21 lines · David Hildenbrand

The information that some PFNs are busy is:
a) not helpful for ordinary users: we don't even know *who* called alloc_contig_range(). This is certainly not worth a pr_info.*().
b) not really helpful for debugging: we don't have any details *why* these PFNs are busy, and that is what we usually care about.
c) not complete: there are other cases where we fail alloc_contig_range() using different paths that are not getting recorded.

For example, we reach this path once we succeeded in isolating pageblocks, but failed to migrate some pages - which can happen easily on ZONE_NORMAL (i.e., has_unmovable_pages() is racy) but also on ZONE_MOVABLE i.e., we would have to retry longer to migrate).

For example via virtio-mem when unplugging memory, we can create quite some noise (especially with ZONE_NORMAL) that is not of interest to users - it's expected that some allocations may fail as memory is busy.

Let's just drop that pr_info_ratelimit() and rather implement a dynamic debugging mechanism in the future that can give us a better reason why alloc_contig_range() failed on specific pages.

Quoted 6 lines
Cc Andrew Morton <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Vlastimil Babka <[email protected]>
Signature · 2 lines
Oscar Salvador
SUSE L3
Acked-by on v1 1/1
#4 lore raw
In reply to David Hildenbrand
Quoted 21 lines · David Hildenbrand

The information that some PFNs are busy is:
a) not helpful for ordinary users: we don't even know *who* called alloc_contig_range(). This is certainly not worth a pr_info.*().
b) not really helpful for debugging: we don't have any details *why* these PFNs are busy, and that is what we usually care about.
c) not complete: there are other cases where we fail alloc_contig_range() using different paths that are not getting recorded.

For example, we reach this path once we succeeded in isolating pageblocks, but failed to migrate some pages - which can happen easily on ZONE_NORMAL (i.e., has_unmovable_pages() is racy) but also on ZONE_MOVABLE i.e., we would have to retry longer to migrate).

For example via virtio-mem when unplugging memory, we can create quite some noise (especially with ZONE_NORMAL) that is not of interest to users - it's expected that some allocations may fail as memory is busy.

Let's just drop that pr_info_ratelimit() and rather implement a dynamic debugging mechanism in the future that can give us a better reason why alloc_contig_range() failed on specific pages.

Quoted 6 lines
Cc Andrew Morton <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Vlastimil Babka <[email protected]>

I agree it's not useful to dump just range. Rather than, dump_page would be much helpful.