mm: page_alloc: dump migrate-failed pages only at -EBUSY
Subsystems (2)
PATCH 1/1 mm: page_alloc: dump migrate-failed pages only at -EBUSY
alloc_contig_dump_pages aims for helping debugging page migration failure by page refcount mismatch or something else of page itself from migration handler function. However, in -ENOMEM case, there is nothing to get clue from page descriptor information so just dump pages only when -EBUSY happens.
--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/page_alloc.c +2 -1
@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; }
Signature · 1 line
2.31.1.751.gd2f1c929bd-goog
Quoted 28 lines · Minchan Kim
alloc_contig_dump_pagesaims for helping debugging page migration failure by page refcount mismatch or something else of page itself from migration handler function. However, in-ENOMEMcase, there is nothing to get clue from page descriptor information so just dump pages only when-EBUSYhappens.Signed-off-by Minchan Kim <[email protected]>--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/page_alloc.c +2
-1@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; }Signature · 1 line
2.31.1.751.gd2f1c929bd-goog
Resend with a little modifying description.
From c5a2fea291cf46079b87cc9ac9a25fc7f819d0fd Mon Sep 17 00:00:00 2001
From: Minchan Kim <[email protected]>
Date: Wed, 19 May 2021 14:22:18 -0700
Subject: [PATCH] mm: page_alloc: dump migrate-failed pages only at -EBUSY
alloc_contig_dump_pages aims for helping debugging page migration failure by elevated page refcount compared to expected_count. (for the detail, please look at migrate_page_move_mapping)
However, -ENOMEM is just the case that system is under memory pressure state, not relevant with page refcount at all. Thus, the dumping page list is not helpful for the debugging point of view.
--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/page_alloc.c +2 -1
@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; }
Signature · 1 line
2.31.1.818.g46aad6cb9e-goog
Minchan Kim <[email protected]> schrieb am Do. 20. Mai 2021 um 21:20:
Quoted 38 lines · Minchan Kim
mm/page_alloc.c static int __alloc_contig_migrate_range(struct
Quoted 16 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by page refcount mismatch or something else of page itself from migration handler function. However, in-ENOMEMcase, there is nothing to get clue from page descriptor information so just dump pages only when-EBUSYhappens.Signed-off-by Minchan Kim <[email protected]>--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/page_alloc.c +0
-0@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct
compact_control*cc,Quoted 10 lines
mm/page_alloc.c +2
-2lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; } --Quoted 2 lines
2.31.1.751.gd2f1c929bd-goog
Resend with a little modifying description.
From
c5a2fea291cf46079b87cc9ac9a25fc7f819d0fdMon Sep 17 00:00:00 2001
From: Minchan Kim <[email protected]>
Date: Wed, 19 May 2021 14:22:18 -0700
Subject: [PATCH] mm:page_alloc: dump migrate-failed pages only at-EBUSY
Quoted 8 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by elevated page refcount compared toexpected_count. (for the detail, please look atmigrate_page_move_mapping)However,
-ENOMEMis just the case that system is under memory pressure state, not relevant with page refcount at all. Thus, the dumping page list is not helpful for the debugging point of view.
what about -ENOMEM when migrating empty/free huge pages? I think there is value in having the pages dumped to identify something like that. And it doesn‘t require heavy memory pressure to fail allocating a huge page.
Quoted 20 lines
Signed-off-by Minchan Kim <[email protected]>--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/page_alloc.c +2
-1@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(structcompact_control *cc,lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret;}
Quoted 4 lines
--
2.31.1.818.g46aad6cb9e-goog--
Thanks,
David / dhildenb
Quoted 44 lines · David Hildenbrand
Minchan Kim <[email protected]> schrieb am Do. 20. Mai 2021 um 21:20:
Quoted 42 lines · Minchan Kim
mm/page_alloc.c static int __alloc_contig_migrate_range(struct
Quoted 16 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by page refcount mismatch or something else of page itself from migration handler function. However, in-ENOMEMcase, there is nothing to get clue from page descriptor information so just dump pages only when-EBUSYhappens.Signed-off-by Minchan Kim <[email protected]>--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/page_alloc.c +0
-0@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct
compact_control*cc,Quoted 10 lines
mm/page_alloc.c +2
-2lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; } --Quoted 2 lines
2.31.1.751.gd2f1c929bd-goog
Resend with a little modifying description.
From
c5a2fea291cf46079b87cc9ac9a25fc7f819d0fdMon Sep 17 00:00:00 2001
From: Minchan Kim <[email protected]>
Date: Wed, 19 May 2021 14:22:18 -0700
Subject: [PATCH] mm:page_alloc: dump migrate-failed pages only at-EBUSY
alloc_contig_dump_pagesaims for helping debugging page migration failure by elevated page refcount compared toexpected_count. (for the detail, please look atmigrate_page_move_mapping)
Quoted 9 lines
Quoted 4 lines
However,
-ENOMEMis just the case that system is under memory pressure state, not relevant with page refcount at all. Thus, the dumping page list is not helpful for the debugging point of view.what about
-ENOMEMwhen migrating empty/free huge pages? I think there is value in having the pages dumped to identify something like that. And it doesn‘t require heavy memory pressure to fail allocating a huge page.
-ENOMEM means there is no memory to alloate destination page. How could it help dumping source pages in those case from dump_page content point of view?
Quoted 50 lines · Minchan Kim
Quoted 49 lines · David Hildenbrand
Minchan Kim <[email protected]> schrieb am Do. 20. Mai 2021 um 21:20:
Quoted 46 lines · Minchan Kim
mm/page_alloc.c static int __alloc_contig_migrate_range(struct
Quoted 16 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by page refcount mismatch or something else of page itself from migration handler function. However, in-ENOMEMcase, there is nothing to get clue from page descriptor information so just dump pages only when-EBUSYhappens.Signed-off-by Minchan Kim <[email protected]>--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/page_alloc.c +0
-0@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct
compact_control*cc,Quoted 10 lines
mm/page_alloc.c +2
-2lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; } --Quoted 2 lines
2.31.1.751.gd2f1c929bd-goog
Resend with a little modifying description.
From
c5a2fea291cf46079b87cc9ac9a25fc7f819d0fdMon Sep 17 00:00:00 2001
From: Minchan Kim <[email protected]>
Date: Wed, 19 May 2021 14:22:18 -0700
Subject: [PATCH] mm:page_alloc: dump migrate-failed pages only at-EBUSY
alloc_contig_dump_pagesaims for helping debugging page migration failure by elevated page refcount compared toexpected_count. (for the detail, please look atmigrate_page_move_mapping)However,
-ENOMEMis just the case that system is under memory pressure state, not relevant with page refcount at all. Thus, the dumping page list is not helpful for the debugging point of view.
Quoted 8 lines
Quoted 4 lines
what about
-ENOMEMwhen migrating empty/free huge pages? I think there is value in having the pages dumped to identify something like that. And it doesn‘t require heavy memory pressure to fail allocating a huge page.
-ENOMEMmeans there is no memory to alloate destination page. How could it help dumping source pages in those case fromdump_pagecontent point of view?
You would spot a huge page in the source list (usually at first position) without any obvious migration blockers I assume?
I'm wondering, did you actually run into this being suboptimal? If it's a real problem dumping too many stuff when running into -ENOMEM, fine with me. If it's a theoretical issue, I'd prefer to just keep it simple as is.
Signature · 3 lines
Thanks, David / dhildenb
Quoted 56 lines · David Hildenbrand
Quoted 55 lines · Minchan Kim
Quoted 53 lines · David Hildenbrand
Minchan Kim <[email protected]> schrieb am Do. 20. Mai 2021 um 21:20:
Quoted 38 lines · Minchan Kim
mm/page_alloc.c static int __alloc_contig_migrate_range(struct
Quoted 16 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by page refcount mismatch or something else of page itself from migration handler function. However, in-ENOMEMcase, there is nothing to get clue from page descriptor information so just dump pages only when-EBUSYhappens.Signed-off-by Minchan Kim <[email protected]>--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/page_alloc.c +0
-0@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct
compact_control*cc,Quoted 10 lines
mm/page_alloc.c +2
-2lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; } --Quoted 2 lines
2.31.1.751.gd2f1c929bd-goog
Resend with a little modifying description.
From
c5a2fea291cf46079b87cc9ac9a25fc7f819d0fdMon Sep 17 00:00:00 2001
From: Minchan Kim <[email protected]>
Date: Wed, 19 May 2021 14:22:18 -0700
Subject: [PATCH] mm:page_alloc: dump migrate-failed pages only at-EBUSYQuoted 8 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by elevated page refcount compared toexpected_count. (for the detail, please look atmigrate_page_move_mapping)However,
-ENOMEMis just the case that system is under memory pressure state, not relevant with page refcount at all. Thus, the dumping page list is not helpful for the debugging point of view.what about
-ENOMEMwhen migrating empty/free huge pages? I think there is value in having the pages dumped to identify something like that. And it doesn‘t require heavy memory pressure to fail allocating a huge page.
Quoted 6 lines
Quoted 3 lines
-ENOMEMmeans there is no memory to alloate destination page. How could it help dumping source pages in those case fromdump_pagecontent point of view?You would spot a huge page in the source list (usually at first position) without any obvious migration blockers I assume?
It was not a huge page case.
Quoted 4 lines
I'm wondering, did you actually run into this being suboptimal? If it's a real problem dumping too many stuff when running into
-ENOMEM, fine with me. If it's a theoretical issue, I'd prefer to just keep it simple as is.
That's exactly what I encountered. With -ENOMEM, it dumped bunch of pages on migratepages list. It was just useless with just consuming logbuffer since there are nothing much to investigate with dumping source pages.
David Hildenbrand
Reviewed-byQuoted 67 lines · Minchan Kim
Quoted 56 lines · David Hildenbrand
Quoted 55 lines · Minchan Kim
Quoted 53 lines · David Hildenbrand
Minchan Kim <[email protected]> schrieb am Do. 20. Mai 2021 um 21:20:
Quoted 38 lines · Minchan Kim
mm/page_alloc.c static int __alloc_contig_migrate_range(struct
Quoted 16 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by page refcount mismatch or something else of page itself from migration handler function. However, in-ENOMEMcase, there is nothing to get clue from page descriptor information so just dump pages only when-EBUSYhappens.Signed-off-by Minchan Kim <[email protected]>--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)mm/page_alloc.c +0
-0@@ -8760,7 +8760,8 @@ static int __alloc_contig_migrate_range(struct
compact_control*cc,Quoted 10 lines
mm/page_alloc.c +2
-2lru_cache_enable ();if (ret <0 ) { -alloc_contig_dump_pages (&cc->migratepages); +if (ret == -EBUSY ) +alloc_contig_dump_pages (&cc->migratepages);putback_movable_pages (&cc->migratepages);return ret; } --Quoted 2 lines
2.31.1.751.gd2f1c929bd-goog
Resend with a little modifying description.
From
c5a2fea291cf46079b87cc9ac9a25fc7f819d0fdMon Sep 17 00:00:00 2001
From: Minchan Kim <[email protected]>
Date: Wed, 19 May 2021 14:22:18 -0700
Subject: [PATCH] mm:page_alloc: dump migrate-failed pages only at-EBUSYQuoted 8 lines
alloc_contig_dump_pagesaims for helping debugging page migration failure by elevated page refcount compared toexpected_count. (for the detail, please look atmigrate_page_move_mapping)However,
-ENOMEMis just the case that system is under memory pressure state, not relevant with page refcount at all. Thus, the dumping page list is not helpful for the debugging point of view.what about
-ENOMEMwhen migrating empty/free huge pages? I think there is value in having the pages dumped to identify something like that. And it doesn‘t require heavy memory pressure to fail allocating a huge page.Quoted 6 lines
Quoted 3 lines
-ENOMEMmeans there is no memory to alloate destination page. How could it help dumping source pages in those case fromdump_pagecontent point of view?You would spot a huge page in the source list (usually at first position) without any obvious migration blockers I assume?
It was not a huge page case.
Quoted 1 line
Quoted 9 lines
Quoted 3 lines
I'm wondering, did you actually run into this being suboptimal? If it's a real problem dumping too many stuff when running into
-ENOMEM, fine with me. If it's a theoretical issue, I'd prefer to just keep it simple as is.That's exactly what I encountered. With
-ENOMEM, it dumped bunch of pages on migratepages list. It was just useless with just consuming logbuffer since there are nothing much to investigate with dumping source pages.
Fine with me, then
Thanks!
Signature · 3 lines
Thanks, David / dhildenb