* [PATCH v2 0/2] mm/debug: sync up latest migrate_reason to migrate_reason_names @ 2021-09-21 6:45 Weizhao Ouyang 2021-09-21 6:45 ` [PATCH v2 1/2] mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN Weizhao Ouyang 2021-09-21 6:45 ` [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang 0 siblings, 2 replies; 14+ messages in thread From: Weizhao Ouyang @ 2021-09-21 6:45 UTC (permalink / raw) To: Andrew Morton Cc: linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Weizhao Ouyang, Mina Almasry, Matthew Wilcox (Oracle), Huang, Ying, Oscar Salvador, Wei Xu After related migrate page updates, sync up latest migrate_reason to migrate_reason_names, page_owner use it to parse the page migrate reason. Changes in V2: -- sync up MR_CONTIG_RANGE -- split patchset for stable kernel Weizhao Ouyang (2): mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN mm/debug: sync up latest migrate_reason to migrate_reason_names include/linux/migrate.h | 6 +++++- mm/debug.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) -- 2.30.2 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 1/2] mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN 2021-09-21 6:45 [PATCH v2 0/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang @ 2021-09-21 6:45 ` Weizhao Ouyang 2021-09-22 4:48 ` John Hubbard 2021-09-21 6:45 ` [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang 1 sibling, 1 reply; 14+ messages in thread From: Weizhao Ouyang @ 2021-09-21 6:45 UTC (permalink / raw) To: Andrew Morton Cc: linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Weizhao Ouyang, Mina Almasry, Matthew Wilcox (Oracle), Huang, Ying, Oscar Salvador, Wei Xu, stable Sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN to migrate_reason_names. Fixes: 310253514bbf ("mm/migrate: rename migration reason MR_CMA to MR_CONTIG_RANGE") Fixes: d1e153fea2a8 ("mm/gup: migrate pinned pages out of movable zone") Cc: stable@vger.kernel.org Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> Reviewed-by: "Huang, Ying" <ying.huang@intel.com> --- mm/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/debug.c b/mm/debug.c index e73fe0a8ec3d..e61037cded98 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -24,7 +24,8 @@ const char *migrate_reason_names[MR_TYPES] = { "syscall_or_cpuset", "mempolicy_mbind", "numa_misplaced", - "cma", + "contig_range", + "longterm_pin", }; const struct trace_print_flags pageflag_names[] = { -- 2.30.2 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN 2021-09-21 6:45 ` [PATCH v2 1/2] mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN Weizhao Ouyang @ 2021-09-22 4:48 ` John Hubbard 0 siblings, 0 replies; 14+ messages in thread From: John Hubbard @ 2021-09-22 4:48 UTC (permalink / raw) To: Weizhao Ouyang, Andrew Morton Cc: linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Huang, Ying, Oscar Salvador, Wei Xu, stable On 9/20/21 23:45, Weizhao Ouyang wrote: > Sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN to migrate_reason_names. > > Fixes: 310253514bbf ("mm/migrate: rename migration reason MR_CMA to MR_CONTIG_RANGE") > Fixes: d1e153fea2a8 ("mm/gup: migrate pinned pages out of movable zone") > Cc: stable@vger.kernel.org > Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> > Reviewed-by: "Huang, Ying" <ying.huang@intel.com> > --- > mm/debug.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/debug.c b/mm/debug.c > index e73fe0a8ec3d..e61037cded98 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -24,7 +24,8 @@ const char *migrate_reason_names[MR_TYPES] = { > "syscall_or_cpuset", > "mempolicy_mbind", > "numa_misplaced", > - "cma", > + "contig_range", > + "longterm_pin", > }; > > const struct trace_print_flags pageflag_names[] = { > Looks good. Reviewed-by: John Hubbard <jhubbard@nvidia.com> thanks, -- John Hubbard NVIDIA ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 6:45 [PATCH v2 0/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang 2021-09-21 6:45 ` [PATCH v2 1/2] mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN Weizhao Ouyang @ 2021-09-21 6:45 ` Weizhao Ouyang 2021-09-21 7:07 ` Huang, Ying 2021-09-22 4:49 ` John Hubbard 1 sibling, 2 replies; 14+ messages in thread From: Weizhao Ouyang @ 2021-09-21 6:45 UTC (permalink / raw) To: Andrew Morton Cc: linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Weizhao Ouyang, Mina Almasry, Matthew Wilcox (Oracle), Huang, Ying, Oscar Salvador, Wei Xu Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> Reviewed-by: "Huang, Ying" <ying.huang@intel.com> --- include/linux/migrate.h | 6 +++++- mm/debug.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 326250996b4e..c8077e936691 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -19,6 +19,11 @@ struct migration_target_control; */ #define MIGRATEPAGE_SUCCESS 0 +/* + * Keep sync with: + * - macro MIGRATE_REASON in include/trace/events/migrate.h + * - migrate_reason_names[MR_TYPES] in mm/debug.c + */ enum migrate_reason { MR_COMPACTION, MR_MEMORY_FAILURE, @@ -32,7 +37,6 @@ enum migrate_reason { MR_TYPES }; -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ extern const char *migrate_reason_names[MR_TYPES]; #ifdef CONFIG_MIGRATION diff --git a/mm/debug.c b/mm/debug.c index e61037cded98..fae0f81ad831 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { "numa_misplaced", "contig_range", "longterm_pin", + "demotion", }; const struct trace_print_flags pageflag_names[] = { -- 2.30.2 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 6:45 ` [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang @ 2021-09-21 7:07 ` Huang, Ying 2021-09-22 4:49 ` John Hubbard 1 sibling, 0 replies; 14+ messages in thread From: Huang, Ying @ 2021-09-21 7:07 UTC (permalink / raw) To: Weizhao Ouyang Cc: Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu Weizhao Ouyang <o451686892@gmail.com> writes: > Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. > > Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") > Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> > Reviewed-by: "Huang, Ying" <ying.huang@intel.com> > --- > include/linux/migrate.h | 6 +++++- > mm/debug.c | 1 + > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > index 326250996b4e..c8077e936691 100644 > --- a/include/linux/migrate.h > +++ b/include/linux/migrate.h > @@ -19,6 +19,11 @@ struct migration_target_control; > */ > #define MIGRATEPAGE_SUCCESS 0 > > +/* > + * Keep sync with: > + * - macro MIGRATE_REASON in include/trace/events/migrate.h > + * - migrate_reason_names[MR_TYPES] in mm/debug.c > + */ > enum migrate_reason { > MR_COMPACTION, > MR_MEMORY_FAILURE, > @@ -32,7 +37,6 @@ enum migrate_reason { > MR_TYPES > }; > > -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ > extern const char *migrate_reason_names[MR_TYPES]; > > #ifdef CONFIG_MIGRATION > diff --git a/mm/debug.c b/mm/debug.c > index e61037cded98..fae0f81ad831 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { > "numa_misplaced", > "contig_range", > "longterm_pin", > + "demotion", > }; > > const struct trace_print_flags pageflag_names[] = { Can we add BUILD_BUG_ON() somewhere to capture at least some synchronization issue? Best Regards, Huang, Ying ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names @ 2021-09-21 7:07 ` Huang, Ying 0 siblings, 0 replies; 14+ messages in thread From: Huang, Ying @ 2021-09-21 7:07 UTC (permalink / raw) To: Weizhao Ouyang Cc: Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu Weizhao Ouyang <o451686892@gmail.com> writes: > Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. > > Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") > Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> > Reviewed-by: "Huang, Ying" <ying.huang@intel.com> > --- > include/linux/migrate.h | 6 +++++- > mm/debug.c | 1 + > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > index 326250996b4e..c8077e936691 100644 > --- a/include/linux/migrate.h > +++ b/include/linux/migrate.h > @@ -19,6 +19,11 @@ struct migration_target_control; > */ > #define MIGRATEPAGE_SUCCESS 0 > > +/* > + * Keep sync with: > + * - macro MIGRATE_REASON in include/trace/events/migrate.h > + * - migrate_reason_names[MR_TYPES] in mm/debug.c > + */ > enum migrate_reason { > MR_COMPACTION, > MR_MEMORY_FAILURE, > @@ -32,7 +37,6 @@ enum migrate_reason { > MR_TYPES > }; > > -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ > extern const char *migrate_reason_names[MR_TYPES]; > > #ifdef CONFIG_MIGRATION > diff --git a/mm/debug.c b/mm/debug.c > index e61037cded98..fae0f81ad831 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { > "numa_misplaced", > "contig_range", > "longterm_pin", > + "demotion", > }; > > const struct trace_print_flags pageflag_names[] = { Can we add BUILD_BUG_ON() somewhere to capture at least some synchronization issue? Best Regards, Huang, Ying ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 7:07 ` Huang, Ying (?) @ 2021-09-21 7:31 ` Weizhao Ouyang 2021-09-21 14:06 ` Huang, Ying -1 siblings, 1 reply; 14+ messages in thread From: Weizhao Ouyang @ 2021-09-21 7:31 UTC (permalink / raw) To: Huang, Ying Cc: Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu On 2021/9/21 15:07, Huang, Ying wrote: > Weizhao Ouyang <o451686892@gmail.com> writes: > >> Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. >> >> Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") >> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> >> Reviewed-by: "Huang, Ying" <ying.huang@intel.com> >> --- >> include/linux/migrate.h | 6 +++++- >> mm/debug.c | 1 + >> 2 files changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/include/linux/migrate.h b/include/linux/migrate.h >> index 326250996b4e..c8077e936691 100644 >> --- a/include/linux/migrate.h >> +++ b/include/linux/migrate.h >> @@ -19,6 +19,11 @@ struct migration_target_control; >> */ >> #define MIGRATEPAGE_SUCCESS 0 >> >> +/* >> + * Keep sync with: >> + * - macro MIGRATE_REASON in include/trace/events/migrate.h >> + * - migrate_reason_names[MR_TYPES] in mm/debug.c >> + */ >> enum migrate_reason { >> MR_COMPACTION, >> MR_MEMORY_FAILURE, >> @@ -32,7 +37,6 @@ enum migrate_reason { >> MR_TYPES >> }; >> >> -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ >> extern const char *migrate_reason_names[MR_TYPES]; >> >> #ifdef CONFIG_MIGRATION >> diff --git a/mm/debug.c b/mm/debug.c >> index e61037cded98..fae0f81ad831 100644 >> --- a/mm/debug.c >> +++ b/mm/debug.c >> @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { >> "numa_misplaced", >> "contig_range", >> "longterm_pin", >> + "demotion", >> }; >> >> const struct trace_print_flags pageflag_names[] = { > Can we add BUILD_BUG_ON() somewhere to capture at least some > synchronization issue? Hi Huang, we discussed this in the v1 thread with you and John, seems you missed it. Now we just add a comment to do the synchronization, and we can figure out a more general way to use strings which in trace_events straight. Thanks, Weizhao ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 7:31 ` Weizhao Ouyang @ 2021-09-21 14:06 ` Huang, Ying 0 siblings, 0 replies; 14+ messages in thread From: Huang, Ying @ 2021-09-21 14:06 UTC (permalink / raw) To: Weizhao Ouyang Cc: Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu Weizhao Ouyang <o451686892@gmail.com> writes: > On 2021/9/21 15:07, Huang, Ying wrote: >> Weizhao Ouyang <o451686892@gmail.com> writes: >> >>> Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. >>> >>> Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") >>> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> >>> Reviewed-by: "Huang, Ying" <ying.huang@intel.com> >>> --- >>> include/linux/migrate.h | 6 +++++- >>> mm/debug.c | 1 + >>> 2 files changed, 6 insertions(+), 1 deletion(-) >>> >>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h >>> index 326250996b4e..c8077e936691 100644 >>> --- a/include/linux/migrate.h >>> +++ b/include/linux/migrate.h >>> @@ -19,6 +19,11 @@ struct migration_target_control; >>> */ >>> #define MIGRATEPAGE_SUCCESS 0 >>> >>> +/* >>> + * Keep sync with: >>> + * - macro MIGRATE_REASON in include/trace/events/migrate.h >>> + * - migrate_reason_names[MR_TYPES] in mm/debug.c >>> + */ >>> enum migrate_reason { >>> MR_COMPACTION, >>> MR_MEMORY_FAILURE, >>> @@ -32,7 +37,6 @@ enum migrate_reason { >>> MR_TYPES >>> }; >>> >>> -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ >>> extern const char *migrate_reason_names[MR_TYPES]; >>> >>> #ifdef CONFIG_MIGRATION >>> diff --git a/mm/debug.c b/mm/debug.c >>> index e61037cded98..fae0f81ad831 100644 >>> --- a/mm/debug.c >>> +++ b/mm/debug.c >>> @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { >>> "numa_misplaced", >>> "contig_range", >>> "longterm_pin", >>> + "demotion", >>> }; >>> >>> const struct trace_print_flags pageflag_names[] = { >> Can we add BUILD_BUG_ON() somewhere to capture at least some >> synchronization issue? > > Hi Huang, we discussed this in the v1 thread with you and John, seems you > missed it. Now we just add a comment to do the synchronization, and we can > figure out a more general way to use strings which in trace_events straight. Got it! And I think we can add the BUILD_BUG_ON() now and delete it when we have a better solution to deal with that. But if you can work out a better solution quickly, that's fine to ignore this. Best Regards, Huang, Ying ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names @ 2021-09-21 14:06 ` Huang, Ying 0 siblings, 0 replies; 14+ messages in thread From: Huang, Ying @ 2021-09-21 14:06 UTC (permalink / raw) To: Weizhao Ouyang Cc: Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, John Hubbard, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu Weizhao Ouyang <o451686892@gmail.com> writes: > On 2021/9/21 15:07, Huang, Ying wrote: >> Weizhao Ouyang <o451686892@gmail.com> writes: >> >>> Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. >>> >>> Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") >>> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> >>> Reviewed-by: "Huang, Ying" <ying.huang@intel.com> >>> --- >>> include/linux/migrate.h | 6 +++++- >>> mm/debug.c | 1 + >>> 2 files changed, 6 insertions(+), 1 deletion(-) >>> >>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h >>> index 326250996b4e..c8077e936691 100644 >>> --- a/include/linux/migrate.h >>> +++ b/include/linux/migrate.h >>> @@ -19,6 +19,11 @@ struct migration_target_control; >>> */ >>> #define MIGRATEPAGE_SUCCESS 0 >>> >>> +/* >>> + * Keep sync with: >>> + * - macro MIGRATE_REASON in include/trace/events/migrate.h >>> + * - migrate_reason_names[MR_TYPES] in mm/debug.c >>> + */ >>> enum migrate_reason { >>> MR_COMPACTION, >>> MR_MEMORY_FAILURE, >>> @@ -32,7 +37,6 @@ enum migrate_reason { >>> MR_TYPES >>> }; >>> >>> -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ >>> extern const char *migrate_reason_names[MR_TYPES]; >>> >>> #ifdef CONFIG_MIGRATION >>> diff --git a/mm/debug.c b/mm/debug.c >>> index e61037cded98..fae0f81ad831 100644 >>> --- a/mm/debug.c >>> +++ b/mm/debug.c >>> @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { >>> "numa_misplaced", >>> "contig_range", >>> "longterm_pin", >>> + "demotion", >>> }; >>> >>> const struct trace_print_flags pageflag_names[] = { >> Can we add BUILD_BUG_ON() somewhere to capture at least some >> synchronization issue? > > Hi Huang, we discussed this in the v1 thread with you and John, seems you > missed it. Now we just add a comment to do the synchronization, and we can > figure out a more general way to use strings which in trace_events straight. Got it! And I think we can add the BUILD_BUG_ON() now and delete it when we have a better solution to deal with that. But if you can work out a better solution quickly, that's fine to ignore this. Best Regards, Huang, Ying ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 14:06 ` Huang, Ying (?) @ 2021-09-21 18:00 ` John Hubbard 2021-09-21 21:53 ` John Hubbard 2021-09-22 2:07 ` Huang, Ying -1 siblings, 2 replies; 14+ messages in thread From: John Hubbard @ 2021-09-21 18:00 UTC (permalink / raw) To: Huang, Ying, Weizhao Ouyang Cc: Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu On 9/21/21 07:06, Huang, Ying wrote: ... >>> Can we add BUILD_BUG_ON() somewhere to capture at least some >>> synchronization issue? >> >> Hi Huang, we discussed this in the v1 thread with you and John, seems you >> missed it. Now we just add a comment to do the synchronization, and we can >> figure out a more general way to use strings which in trace_events straight. > > Got it! And I think we can add the BUILD_BUG_ON() now and delete it > when we have a better solution to deal with that. But if you can work > out a better solution quickly, that's fine to ignore this. > I have a solution now, it's basically what I sent earlier. There appears to be some confusion about it. I'll send it out as a patch that builds on top of these two, hopefully in a few hours, if no problems pop up during testing. thanks, -- John Hubbard NVIDIA ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 18:00 ` John Hubbard @ 2021-09-21 21:53 ` John Hubbard 2021-09-22 2:07 ` Huang, Ying 1 sibling, 0 replies; 14+ messages in thread From: John Hubbard @ 2021-09-21 21:53 UTC (permalink / raw) To: Huang, Ying, Weizhao Ouyang Cc: Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu On 9/21/21 11:00, John Hubbard wrote: > On 9/21/21 07:06, Huang, Ying wrote: > ... >>>> Can we add BUILD_BUG_ON() somewhere to capture at least some >>>> synchronization issue? >>> >>> Hi Huang, we discussed this in the v1 thread with you and John, seems you >>> missed it. Now we just add a comment to do the synchronization, and we can >>> figure out a more general way to use strings which in trace_events straight. >> >> Got it! And I think we can add the BUILD_BUG_ON() now and delete it >> when we have a better solution to deal with that. But if you can work >> out a better solution quickly, that's fine to ignore this. >> > > I have a solution now, it's basically what I sent earlier. There appears to be > some confusion about it. I'll send it out as a patch that builds on top of > these two, hopefully in a few hours, if no problems pop up during testing. > Oh OK, I think the confusion was on my end: you are hoping to integrate the TRACE_DEFINE_ENUM in with this. Let me take a peek there, because otherwise, we can only reduce, but not fully remove the duplication. thanks, -- John Hubbard NVIDIA ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 18:00 ` John Hubbard @ 2021-09-22 2:07 ` Huang, Ying 2021-09-22 2:07 ` Huang, Ying 1 sibling, 0 replies; 14+ messages in thread From: Huang, Ying @ 2021-09-22 2:07 UTC (permalink / raw) To: John Hubbard Cc: Weizhao Ouyang, Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu John Hubbard <jhubbard@nvidia.com> writes: > On 9/21/21 07:06, Huang, Ying wrote: > ... >>>> Can we add BUILD_BUG_ON() somewhere to capture at least some >>>> synchronization issue? >>> >>> Hi Huang, we discussed this in the v1 thread with you and John, seems you >>> missed it. Now we just add a comment to do the synchronization, and we can >>> figure out a more general way to use strings which in trace_events straight. >> Got it! And I think we can add the BUILD_BUG_ON() now and delete it >> when we have a better solution to deal with that. But if you can work >> out a better solution quickly, that's fine to ignore this. >> > > I have a solution now, it's basically what I sent earlier. There appears to be > some confusion about it. I'll send it out as a patch that builds on top of > these two, hopefully in a few hours, if no problems pop up during testing. Sorry, I didn't read your latest email. The solution looks good! Thanks! Best Regards, Huang, Ying ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names @ 2021-09-22 2:07 ` Huang, Ying 0 siblings, 0 replies; 14+ messages in thread From: Huang, Ying @ 2021-09-22 2:07 UTC (permalink / raw) To: John Hubbard Cc: Weizhao Ouyang, Andrew Morton, linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Oscar Salvador, Wei Xu John Hubbard <jhubbard@nvidia.com> writes: > On 9/21/21 07:06, Huang, Ying wrote: > ... >>>> Can we add BUILD_BUG_ON() somewhere to capture at least some >>>> synchronization issue? >>> >>> Hi Huang, we discussed this in the v1 thread with you and John, seems you >>> missed it. Now we just add a comment to do the synchronization, and we can >>> figure out a more general way to use strings which in trace_events straight. >> Got it! And I think we can add the BUILD_BUG_ON() now and delete it >> when we have a better solution to deal with that. But if you can work >> out a better solution quickly, that's fine to ignore this. >> > > I have a solution now, it's basically what I sent earlier. There appears to be > some confusion about it. I'll send it out as a patch that builds on top of > these two, hopefully in a few hours, if no problems pop up during testing. Sorry, I didn't read your latest email. The solution looks good! Thanks! Best Regards, Huang, Ying ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-09-21 6:45 ` [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang 2021-09-21 7:07 ` Huang, Ying @ 2021-09-22 4:49 ` John Hubbard 1 sibling, 0 replies; 14+ messages in thread From: John Hubbard @ 2021-09-22 4:49 UTC (permalink / raw) To: Weizhao Ouyang, Andrew Morton Cc: linux-kernel, linux-mm, Anshuman Khandual, Michal Hocko, Pavel Tatashin, Yang Shi, Zi Yan, Dave Hansen, Minchan Kim, Mina Almasry, Matthew Wilcox (Oracle), Huang, Ying, Oscar Salvador, Wei Xu On 9/20/21 23:45, Weizhao Ouyang wrote: > Sync up MR_DEMOTION to migrate_reason_names and add a synch prompt. > > Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim") > Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> > Reviewed-by: "Huang, Ying" <ying.huang@intel.com> > --- > include/linux/migrate.h | 6 +++++- > mm/debug.c | 1 + > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > index 326250996b4e..c8077e936691 100644 > --- a/include/linux/migrate.h > +++ b/include/linux/migrate.h > @@ -19,6 +19,11 @@ struct migration_target_control; > */ > #define MIGRATEPAGE_SUCCESS 0 > > +/* > + * Keep sync with: > + * - macro MIGRATE_REASON in include/trace/events/migrate.h > + * - migrate_reason_names[MR_TYPES] in mm/debug.c > + */ > enum migrate_reason { > MR_COMPACTION, > MR_MEMORY_FAILURE, > @@ -32,7 +37,6 @@ enum migrate_reason { > MR_TYPES > }; > > -/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */ > extern const char *migrate_reason_names[MR_TYPES]; > > #ifdef CONFIG_MIGRATION > diff --git a/mm/debug.c b/mm/debug.c > index e61037cded98..fae0f81ad831 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -26,6 +26,7 @@ const char *migrate_reason_names[MR_TYPES] = { > "numa_misplaced", > "contig_range", > "longterm_pin", > + "demotion", > }; > > const struct trace_print_flags pageflag_names[] = { > Looks good. Reviewed-by: John Hubbard <jhubbard@nvidia.com> thanks, -- John Hubbard NVIDIA ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2021-09-22 4:49 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-09-21 6:45 [PATCH v2 0/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang 2021-09-21 6:45 ` [PATCH v2 1/2] mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN Weizhao Ouyang 2021-09-22 4:48 ` John Hubbard 2021-09-21 6:45 ` [PATCH v2 2/2] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang 2021-09-21 7:07 ` Huang, Ying 2021-09-21 7:07 ` Huang, Ying 2021-09-21 7:31 ` Weizhao Ouyang 2021-09-21 14:06 ` Huang, Ying 2021-09-21 14:06 ` Huang, Ying 2021-09-21 18:00 ` John Hubbard 2021-09-21 21:53 ` John Hubbard 2021-09-22 2:07 ` Huang, Ying 2021-09-22 2:07 ` Huang, Ying 2021-09-22 4:49 ` John Hubbard
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.