* [PATCH] [RFC] mm/compaction: initialize compaction information @ 2015-03-19 5:30 Gioh Kim 2015-03-19 8:41 ` Vlastimil Babka 0 siblings, 1 reply; 9+ messages in thread From: Gioh Kim @ 2015-03-19 5:30 UTC (permalink / raw) To: akpm, vbabka, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee, Gioh Kim I tried to start compaction via /proc/sys/vm/compact_memory as soon as I turned on my ARM-based platform. But the compaction didn't start. I found some variables in struct zone are not initalized. I think zone->compact_cached_free_pfn and some cache values for compaction are initalized when the kernel starts compaction, not via /proc/sys/vm/compact_memory. If my guess is correct, an initialization are needed for that case. Signed-off-by: Gioh Kim <gioh.kim@lge.com> --- mm/compaction.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index 8c0d945..944a9cc 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1299,6 +1299,14 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) __reset_isolation_suitable(zone); /* + * If this is activated by /proc/sys/vm/compact_memory + * and the first try, cached information for compaction is not + * initialized. + */ + if (cc->order == -1 && zone->compact_cached_free_pfn == 0) + __reset_isolation_suitable(zone); + + /* * Setup to move all movable pages to the end of the zone. Used cached * information on where the scanners should start but check that it * is initialised by ensuring the values are within zone boundaries. -- 1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] [RFC] mm/compaction: initialize compaction information 2015-03-19 5:30 [PATCH] [RFC] mm/compaction: initialize compaction information Gioh Kim @ 2015-03-19 8:41 ` Vlastimil Babka 2015-03-19 8:52 ` Gioh Kim 0 siblings, 1 reply; 9+ messages in thread From: Vlastimil Babka @ 2015-03-19 8:41 UTC (permalink / raw) To: Gioh Kim, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee On 03/19/2015 06:30 AM, Gioh Kim wrote: > I tried to start compaction via /proc/sys/vm/compact_memory > as soon as I turned on my ARM-based platform. > But the compaction didn't start. > I found some variables in struct zone are not initalized. > > I think zone->compact_cached_free_pfn and some cache values for compaction > are initalized when the kernel starts compaction, not via > /proc/sys/vm/compact_memory. > If my guess is correct, an initialization are needed for that case. > > > Signed-off-by: Gioh Kim <gioh.kim@lge.com> > --- > mm/compaction.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 8c0d945..944a9cc 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1299,6 +1299,14 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) > __reset_isolation_suitable(zone); > > /* > + * If this is activated by /proc/sys/vm/compact_memory > + * and the first try, cached information for compaction is not > + * initialized. > + */ > + if (cc->order == -1 && zone->compact_cached_free_pfn == 0) > + __reset_isolation_suitable(zone); > + > + /* > * Setup to move all movable pages to the end of the zone. Used cached > * information on where the scanners should start but check that it > * is initialised by ensuring the values are within zone boundaries. The code below this comment already does the initialization if the cached values are outside zone boundaries (e.g. due to not being initialized). So if I go through what your __reset_isolation_suitable(zone) call possibly fixes: - the code below comment should take care of zone->compact_cached_migrate_pfn and zone->compact_cached_free_pfn. - the value of zone->compact_blockskip_flush shouldn't affect whether compaction is done. - the state of pageblock_skip bits shouldn't matter for compaction via /proc/sys... as that sets ignore_skip_hint = true It might be perhaps possible that the cached scanner positions are close to meeting and compaction occurs but doesn't process much. That would be also true if both were zero, but at least on my x86 system, lowest zone's start_pfn is 1 so that would be detected and corrected. Maybe it is zero on yours though? (ARM?). So in any case, the problem should be identified in more detail so we know the fix is not accidental. It could be also worthwile to always reset scanner positions when doing a /proc triggered compaction, so it's not depending on what happened before. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] [RFC] mm/compaction: initialize compaction information 2015-03-19 8:41 ` Vlastimil Babka @ 2015-03-19 8:52 ` Gioh Kim 2015-03-19 9:01 ` Vlastimil Babka 0 siblings, 1 reply; 9+ messages in thread From: Gioh Kim @ 2015-03-19 8:52 UTC (permalink / raw) To: Vlastimil Babka, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee 2015-03-19 i??i?? 5:41i?? Vlastimil Babka i?'(e??) i?' e,?: > On 03/19/2015 06:30 AM, Gioh Kim wrote: >> I tried to start compaction via /proc/sys/vm/compact_memory >> as soon as I turned on my ARM-based platform. >> But the compaction didn't start. >> I found some variables in struct zone are not initalized. >> >> I think zone->compact_cached_free_pfn and some cache values for compaction >> are initalized when the kernel starts compaction, not via >> /proc/sys/vm/compact_memory. >> If my guess is correct, an initialization are needed for that case. >> >> >> Signed-off-by: Gioh Kim <gioh.kim@lge.com> >> --- >> mm/compaction.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/mm/compaction.c b/mm/compaction.c >> index 8c0d945..944a9cc 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -1299,6 +1299,14 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) >> __reset_isolation_suitable(zone); >> >> /* >> + * If this is activated by /proc/sys/vm/compact_memory >> + * and the first try, cached information for compaction is not >> + * initialized. >> + */ >> + if (cc->order == -1 && zone->compact_cached_free_pfn == 0) >> + __reset_isolation_suitable(zone); >> + >> + /* >> * Setup to move all movable pages to the end of the zone. Used cached >> * information on where the scanners should start but check that it >> * is initialised by ensuring the values are within zone boundaries. > > The code below this comment already does the initialization if the cached values > are outside zone boundaries (e.g. due to not being initialized). So if I go > through what your __reset_isolation_suitable(zone) call possibly fixes: > > - the code below comment should take care of zone->compact_cached_migrate_pfn > and zone->compact_cached_free_pfn. > - the value of zone->compact_blockskip_flush shouldn't affect whether compaction > is done. > - the state of pageblock_skip bits shouldn't matter for compaction via > /proc/sys... as that sets ignore_skip_hint = true > > It might be perhaps possible that the cached scanner positions are close to > meeting and compaction occurs but doesn't process much. That would be also true > if both were zero, but at least on my x86 system, lowest zone's start_pfn is 1 > so that would be detected and corrected. Maybe it is zero on yours though? (ARM?). YES, it is. As comment above, my platform is based on ARM. zone's start_pfn is 0. > > So in any case, the problem should be identified in more detail so we know the > fix is not accidental. It could be also worthwile to always reset scanner > positions when doing a /proc triggered compaction, so it's not depending on what > happened before. > Excuse my poor english. I cannot catch exactly what you want. Is this what you want? This resets the position if compaction is started via /proc. diff --git a/mm/compaction.c b/mm/compaction.c index 8c0d945..827ec06 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1587,8 +1587,10 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) INIT_LIST_HEAD(&cc->freepages); INIT_LIST_HEAD(&cc->migratepages); - if (cc->order == -1 || !compaction_deferred(zone, cc->order)) + if (cc->order == -1 || !compaction_deferred(zone, cc->order)) { + __reset_isolation_suitable(zone); compact_zone(zone, cc); + } if (cc->order > 0) { if (zone_watermark_ok(zone, cc->order, -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] [RFC] mm/compaction: initialize compaction information 2015-03-19 8:52 ` Gioh Kim @ 2015-03-19 9:01 ` Vlastimil Babka 2015-03-19 23:33 ` Gioh Kim 0 siblings, 1 reply; 9+ messages in thread From: Vlastimil Babka @ 2015-03-19 9:01 UTC (permalink / raw) To: Gioh Kim, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee On 03/19/2015 09:52 AM, Gioh Kim wrote: > > > 2015-03-19 i??i?? 5:41i?? Vlastimil Babka i?'(e??) i?' e,?: >> On 03/19/2015 06:30 AM, Gioh Kim wrote: >> >> The code below this comment already does the initialization if the cached values >> are outside zone boundaries (e.g. due to not being initialized). So if I go >> through what your __reset_isolation_suitable(zone) call possibly fixes: >> >> - the code below comment should take care of zone->compact_cached_migrate_pfn >> and zone->compact_cached_free_pfn. >> - the value of zone->compact_blockskip_flush shouldn't affect whether compaction >> is done. >> - the state of pageblock_skip bits shouldn't matter for compaction via >> /proc/sys... as that sets ignore_skip_hint = true >> >> It might be perhaps possible that the cached scanner positions are close to >> meeting and compaction occurs but doesn't process much. That would be also true >> if both were zero, but at least on my x86 system, lowest zone's start_pfn is 1 >> so that would be detected and corrected. Maybe it is zero on yours though? (ARM?). > > YES, it is. As comment above, my platform is based on ARM. Ah, I see. > zone's start_pfn is 0. OK, good to know that's possible. In that case it's clear that the proper initialization doesn't happen, and __compact_finished() decides that scanners have already met at pfn 0. >> >> So in any case, the problem should be identified in more detail so we know the >> fix is not accidental. It could be also worthwile to always reset scanner >> positions when doing a /proc triggered compaction, so it's not depending on what >> happened before. >> > > Excuse my poor english. > I cannot catch exactly what you want. > Is this what you want? This resets the position if compaction is started via /proc. Yes that's right, but.. > diff --git a/mm/compaction.c b/mm/compaction.c > index 8c0d945..827ec06 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1587,8 +1587,10 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) > INIT_LIST_HEAD(&cc->freepages); > INIT_LIST_HEAD(&cc->migratepages); > > - if (cc->order == -1 || !compaction_deferred(zone, cc->order)) > + if (cc->order == -1 || !compaction_deferred(zone, cc->order)) { > + __reset_isolation_suitable(zone); This will also trigger reset when called from kswapd through compact_pgdat() and !compaction_deferred() is true. The reset should be restricted to cc->order == -1 which only happens from /proc trigger. > compact_zone(zone, cc); > + } > > if (cc->order > 0) { > if (zone_watermark_ok(zone, cc->order, > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] [RFC] mm/compaction: initialize compaction information 2015-03-19 9:01 ` Vlastimil Babka @ 2015-03-19 23:33 ` Gioh Kim 2015-03-20 7:51 ` Vlastimil Babka 2015-03-20 13:00 ` [PATCH][RFCv2] mm/compaction: reset compaction scanner positions Gioh Kim 0 siblings, 2 replies; 9+ messages in thread From: Gioh Kim @ 2015-03-19 23:33 UTC (permalink / raw) To: Vlastimil Babka, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee 2015-03-19 i??i?? 6:01i?? Vlastimil Babka i?'(e??) i?' e,?: > On 03/19/2015 09:52 AM, Gioh Kim wrote: >> >> >> 2015-03-19 i??i?? 5:41i?? Vlastimil Babka i?'(e??) i?' e,?: >>> On 03/19/2015 06:30 AM, Gioh Kim wrote: >>> >>> The code below this comment already does the initialization if the cached values >>> are outside zone boundaries (e.g. due to not being initialized). So if I go >>> through what your __reset_isolation_suitable(zone) call possibly fixes: >>> >>> - the code below comment should take care of zone->compact_cached_migrate_pfn >>> and zone->compact_cached_free_pfn. >>> - the value of zone->compact_blockskip_flush shouldn't affect whether compaction >>> is done. >>> - the state of pageblock_skip bits shouldn't matter for compaction via >>> /proc/sys... as that sets ignore_skip_hint = true >>> >>> It might be perhaps possible that the cached scanner positions are close to >>> meeting and compaction occurs but doesn't process much. That would be also true >>> if both were zero, but at least on my x86 system, lowest zone's start_pfn is 1 >>> so that would be detected and corrected. Maybe it is zero on yours though? (ARM?). >> >> YES, it is. As comment above, my platform is based on ARM. > > Ah, I see. > >> zone's start_pfn is 0. > > OK, good to know that's possible. In that case it's clear that the proper > initialization doesn't happen, and __compact_finished() decides that scanners > have already met at pfn 0. > >>> >>> So in any case, the problem should be identified in more detail so we know the >>> fix is not accidental. It could be also worthwile to always reset scanner >>> positions when doing a /proc triggered compaction, so it's not depending on what >>> happened before. >>> >> >> Excuse my poor english. >> I cannot catch exactly what you want. >> Is this what you want? This resets the position if compaction is started via /proc. > > Yes that's right, but.. > >> diff --git a/mm/compaction.c b/mm/compaction.c >> index 8c0d945..827ec06 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -1587,8 +1587,10 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) >> INIT_LIST_HEAD(&cc->freepages); >> INIT_LIST_HEAD(&cc->migratepages); >> >> - if (cc->order == -1 || !compaction_deferred(zone, cc->order)) >> + if (cc->order == -1 || !compaction_deferred(zone, cc->order)) { >> + __reset_isolation_suitable(zone); > > This will also trigger reset when called from kswapd through compact_pgdat() and > !compaction_deferred() is true. > The reset should be restricted to cc->order == -1 which only happens from /proc > trigger. > >> compact_zone(zone, cc); >> + } >> >> if (cc->order > 0) { >> if (zone_watermark_ok(zone, cc->order, >> > > I've not been familiar with compaction code. I think cc->order is -1 only if __compact_pgdat is called via /proc. This is ugly but I don't have better solution. Do you have better idea? diff --git a/mm/compaction.c b/mm/compaction.c index 8c0d945..5b4e255 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1587,6 +1587,9 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) INIT_LIST_HEAD(&cc->freepages); INIT_LIST_HEAD(&cc->migratepages); + if (cc->order == -1) + __reset_isolation_suitable(zone); + if (cc->order == -1 || !compaction_deferred(zone, cc->order)) compact_zone(zone, cc); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] [RFC] mm/compaction: initialize compaction information 2015-03-19 23:33 ` Gioh Kim @ 2015-03-20 7:51 ` Vlastimil Babka 2015-03-20 13:00 ` [PATCH][RFCv2] mm/compaction: reset compaction scanner positions Gioh Kim 1 sibling, 0 replies; 9+ messages in thread From: Vlastimil Babka @ 2015-03-20 7:51 UTC (permalink / raw) To: Gioh Kim, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee On 03/20/2015 12:33 AM, Gioh Kim wrote: >>> diff --git a/mm/compaction.c b/mm/compaction.c >>> index 8c0d945..827ec06 100644 >>> --- a/mm/compaction.c >>> +++ b/mm/compaction.c >>> @@ -1587,8 +1587,10 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) >>> INIT_LIST_HEAD(&cc->freepages); >>> INIT_LIST_HEAD(&cc->migratepages); >>> >>> - if (cc->order == -1 || !compaction_deferred(zone, cc->order)) >>> + if (cc->order == -1 || !compaction_deferred(zone, cc->order)) { >>> + __reset_isolation_suitable(zone); >> >> This will also trigger reset when called from kswapd through compact_pgdat() and >> !compaction_deferred() is true. >> The reset should be restricted to cc->order == -1 which only happens from /proc >> trigger. >> >>> compact_zone(zone, cc); >>> + } >>> >>> if (cc->order > 0) { >>> if (zone_watermark_ok(zone, cc->order, >>> >> >> > > I've not been familiar with compaction code. > I think cc->order is -1 only if __compact_pgdat is called via /proc. Yes that's what I meant. > This is ugly but I don't have better solution. > Do you have better idea? It's not ugly IMHO. There are more tests for -1 like this, e.g. in compaction_suitable(). Maybe just add some comment such as: /* * When called via /proc/sys/vm/compact_memory make sure we compact * the whole zone regardless of cached scanner positions. */ > diff --git a/mm/compaction.c b/mm/compaction.c > index 8c0d945..5b4e255 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1587,6 +1587,9 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) > INIT_LIST_HEAD(&cc->freepages); > INIT_LIST_HEAD(&cc->migratepages); > > + if (cc->order == -1) > + __reset_isolation_suitable(zone); > + > if (cc->order == -1 || !compaction_deferred(zone, cc->order)) > compact_zone(zone, cc); > > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH][RFCv2] mm/compaction: reset compaction scanner positions 2015-03-19 23:33 ` Gioh Kim 2015-03-20 7:51 ` Vlastimil Babka @ 2015-03-20 13:00 ` Gioh Kim 2015-03-20 13:49 ` Vlastimil Babka 1 sibling, 1 reply; 9+ messages in thread From: Gioh Kim @ 2015-03-20 13:00 UTC (permalink / raw) To: Gioh Kim, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee I'm attaching the patch for discussion. According to Vlastimil's advice, I move the reseting before compact_zone(), and write more description. Vlastimil, can I have your name at Acked-by or Signed-off-by? Which one do you prefer? ------------------------- 8< ---------------------- From 575983c887e6478ca7cbba49a892dbc4cd69986b Mon Sep 17 00:00:00 2001 From: Gioh Kim <gioh.kim@lge.com> Date: Fri, 20 Mar 2015 21:09:13 +0900 Subject: [PATCH] [RFCv2] mm/compaction: reset compaction scanner positions When the compaction is activated via /proc/sys/vm/compact_memory it would better scan the whole zone. And some platform, for instance ARM, has the start_pfn of a zone as zero. Therefore the first try to compaction via /proc doesn't work. It needs to force to reset compaction scanner position at first. Signed-off-by: Gioh Kim <gioh.kim@lge.com> --- mm/compaction.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index 8c0d945..ccf48ce 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1587,6 +1587,14 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) INIT_LIST_HEAD(&cc->freepages); INIT_LIST_HEAD(&cc->migratepages); + /* + * When called via /proc/sys/vm/compact_memory + * this makes sure we compact the whole zone regardless of + * cached scanner positions. + */ + if (cc->order == -1) + __reset_isolation_suitable(zone); + if (cc->order == -1 || !compaction_deferred(zone, cc->order)) compact_zone(zone, cc); -- 1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH][RFCv2] mm/compaction: reset compaction scanner positions 2015-03-20 13:00 ` [PATCH][RFCv2] mm/compaction: reset compaction scanner positions Gioh Kim @ 2015-03-20 13:49 ` Vlastimil Babka 2015-03-21 11:53 ` Gioh Kim 0 siblings, 1 reply; 9+ messages in thread From: Vlastimil Babka @ 2015-03-20 13:49 UTC (permalink / raw) To: Gioh Kim, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee On 03/20/2015 02:00 PM, Gioh Kim wrote: > I'm attaching the patch for discussion. > According to Vlastimil's advice, I move the reseting before compact_zone(), > and write more description. > > Vlastimil, can I have your name at Acked-by or Signed-off-by? Yes. But note below that whitespace seems broken in the patch. Acked-by: Vlastimil Babka <vbabka@suse.cz> > Which one do you prefer? Acked-by, as Signed-off-by is for maintainers who resend the patches towards Linus. > ------------------------- 8< ---------------------- > > From 575983c887e6478ca7cbba49a892dbc4cd69986b Mon Sep 17 00:00:00 2001 > From: Gioh Kim <gioh.kim@lge.com> > Date: Fri, 20 Mar 2015 21:09:13 +0900 > Subject: [PATCH] [RFCv2] mm/compaction: reset compaction scanner positions > > When the compaction is activated via /proc/sys/vm/compact_memory > it would better scan the whole zone. > And some platform, for instance ARM, has the start_pfn of a zone as zero. > Therefore the first try to compaction via /proc doesn't work. > It needs to force to reset compaction scanner position at first. > > Signed-off-by: Gioh Kim <gioh.kim@lge.com> > --- > mm/compaction.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 8c0d945..ccf48ce 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1587,6 +1587,14 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) > INIT_LIST_HEAD(&cc->freepages); > INIT_LIST_HEAD(&cc->migratepages); > > + /* > + * When called via /proc/sys/vm/compact_memory > + * this makes sure we compact the whole zone regardless of > + * cached scanner positions. > + */ > + if (cc->order == -1) > + __reset_isolation_suitable(zone); Indentation seems off, some tabs vs spaces issue? > + > if (cc->order == -1 || !compaction_deferred(zone, cc->order)) > compact_zone(zone, cc); > > -- > 1.7.9.5 > > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][RFCv2] mm/compaction: reset compaction scanner positions 2015-03-20 13:49 ` Vlastimil Babka @ 2015-03-21 11:53 ` Gioh Kim 0 siblings, 0 replies; 9+ messages in thread From: Gioh Kim @ 2015-03-21 11:53 UTC (permalink / raw) To: Vlastimil Babka, akpm, rientjes, iamjoonsoo.kim, mgorman Cc: linux-mm, linux-kernel, gunho.lee 2015-03-20 i??i?? 10:49i?? Vlastimil Babka i?'(e??) i?' e,?: > On 03/20/2015 02:00 PM, Gioh Kim wrote: >> I'm attaching the patch for discussion. >> According to Vlastimil's advice, I move the reseting before compact_zone(), >> and write more description. >> >> Vlastimil, can I have your name at Acked-by or Signed-off-by? > > Yes. But note below that whitespace seems broken in the patch. > > Acked-by: Vlastimil Babka <vbabka@suse.cz> > >> Which one do you prefer? > > Acked-by, as Signed-off-by is for maintainers who resend the patches towards Linus. > >> ------------------------- 8< ---------------------- >> >> From 575983c887e6478ca7cbba49a892dbc4cd69986b Mon Sep 17 00:00:00 2001 >> From: Gioh Kim <gioh.kim@lge.com> >> Date: Fri, 20 Mar 2015 21:09:13 +0900 >> Subject: [PATCH] [RFCv2] mm/compaction: reset compaction scanner positions >> >> When the compaction is activated via /proc/sys/vm/compact_memory >> it would better scan the whole zone. >> And some platform, for instance ARM, has the start_pfn of a zone as zero. >> Therefore the first try to compaction via /proc doesn't work. >> It needs to force to reset compaction scanner position at first. >> >> Signed-off-by: Gioh Kim <gioh.kim@lge.com> >> --- >> mm/compaction.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/mm/compaction.c b/mm/compaction.c >> index 8c0d945..ccf48ce 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -1587,6 +1587,14 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) >> INIT_LIST_HEAD(&cc->freepages); >> INIT_LIST_HEAD(&cc->migratepages); >> >> + /* >> + * When called via /proc/sys/vm/compact_memory >> + * this makes sure we compact the whole zone regardless of >> + * cached scanner positions. >> + */ >> + if (cc->order == -1) >> + __reset_isolation_suitable(zone); > > Indentation seems off, some tabs vs spaces issue? It's my email client. I'll send the patch again without [RFC]. > >> + >> if (cc->order == -1 || !compaction_deferred(zone, cc->order)) >> compact_zone(zone, cc); >> >> -- >> 1.7.9.5 >> >> >> -- >> To unsubscribe, send a message with 'unsubscribe linux-mm' in >> the body to majordomo@kvack.org. For more info on Linux MM, >> see: http://www.linux-mm.org/ . >> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> >> > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-03-21 11:53 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-03-19 5:30 [PATCH] [RFC] mm/compaction: initialize compaction information Gioh Kim 2015-03-19 8:41 ` Vlastimil Babka 2015-03-19 8:52 ` Gioh Kim 2015-03-19 9:01 ` Vlastimil Babka 2015-03-19 23:33 ` Gioh Kim 2015-03-20 7:51 ` Vlastimil Babka 2015-03-20 13:00 ` [PATCH][RFCv2] mm/compaction: reset compaction scanner positions Gioh Kim 2015-03-20 13:49 ` Vlastimil Babka 2015-03-21 11:53 ` Gioh Kim
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).