Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1376036
| From | Vlastimil Babka <vbabka@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 10/11] mm, oom: protect !costly allocations some more |
| Date | 2016-04-11 16:50 +0200 |
| Message-ID | <rmLk5-7vl-7@gated-at.bofh.it> (permalink) |
| References | <rkxlf-2sv-9@gated-at.bofh.it> <rkxlg-2sv-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 04/05/2016 01:25 PM, Michal Hocko wrote: > From: Michal Hocko <mhocko@suse.com> > > should_reclaim_retry will give up retries for higher order allocations > if none of the eligible zones has any requested or higher order pages > available even if we pass the watermak check for order-0. This is done > because there is no guarantee that the reclaimable and currently free > pages will form the required order. > > This can, however, lead to situations were the high-order request (e.g. > order-2 required for the stack allocation during fork) will trigger > OOM too early - e.g. after the first reclaim/compaction round. Such a > system would have to be highly fragmented and there is no guarantee > further reclaim/compaction attempts would help but at least make sure > that the compaction was active before we go OOM and keep retrying even > if should_reclaim_retry tells us to oom if > - the last compaction round backed off or > - we haven't completed at least MAX_COMPACT_RETRIES active > compaction rounds. > > The first rule ensures that the very last attempt for compaction > was not ignored while the second guarantees that the compaction has done > some work. Multiple retries might be needed to prevent occasional > pigggy packing of other contexts to steal the compacted pages before > the current context manages to retry to allocate them. > > compaction_failed() is taken as a final word from the compaction that > the retry doesn't make much sense. We have to be careful though because > the first compaction round is MIGRATE_ASYNC which is rather weak as it > ignores pages under writeback and gives up too easily in other > situations. We therefore have to make sure that MIGRATE_SYNC_LIGHT mode > has been used before we give up. With this logic in place we do not have > to increase the migration mode unconditionally and rather do it only if > the compaction failed for the weaker mode. A nice side effect is that > the stronger migration mode is used only when really needed so this has > a potential of smaller latencies in some cases. > > Please note that the compaction doesn't tell us much about how > successful it was when returning compaction_made_progress so we just > have to blindly trust that another retry is worthwhile and cap the > number to something reasonable to guarantee a convergence. > > If the given number of successful retries is not sufficient for a > reasonable workloads we should focus on the collected compaction > tracepoints data and try to address the issue in the compaction code. > If this is not feasible we can increase the retries limit. > > Signed-off-by: Michal Hocko <mhocko@suse.com> Looks good. Acked-by: Vlastimil Babka <vbabka@suse.cz>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/11] oom detection rework v5 Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
[PATCH 10/11] mm, oom: protect !costly allocations some more Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
Re: [PATCH 10/11] mm, oom: protect !costly allocations some more Andrew Morton <akpm@linux-foundation.org> - 2016-04-06 02:10 +0200
Re: [PATCH 10/11] mm, oom: protect !costly allocations some more Michal Hocko <mhocko@kernel.org> - 2016-04-06 11:30 +0200
Re: [PATCH 10/11] mm, oom: protect !costly allocations some more Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 16:50 +0200
[PATCH 08/11] mm, compaction: Simplify __alloc_pages_direct_compact feedback interface Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
Re: [PATCH 08/11] mm, compaction: Simplify __alloc_pages_direct_compact feedback interface Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 16:00 +0200
[PATCH 04/11] mm, compaction: cover all compaction mode in compact_zone Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
[PATCH 05/11] mm, compaction: distinguish COMPACT_DEFERRED from COMPACT_SKIPPED Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
Re: [PATCH 05/11] mm, compaction: distinguish COMPACT_DEFERRED from COMPACT_SKIPPED Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 13:10 +0200
Re: [PATCH 05/11] mm, compaction: distinguish COMPACT_DEFERRED from COMPACT_SKIPPED Michal Hocko <mhocko@kernel.org> - 2016-04-11 13:30 +0200
[PATCH 07/11] mm, compaction: Update compaction_result ordering Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
Re: [PATCH 07/11] mm, compaction: Update compaction_result ordering Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 14:20 +0200
[PATCH 02/11] mm: throttle on IO only when there are too many dirty and writeback pages Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
[PATCH 01/11] mm, oom: rework oom detection Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
[PATCH 03/11] mm, compaction: change COMPACT_ constants into enum Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
[PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 14:20 +0200
Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-11 14:50 +0200
Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 15:00 +0200
Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-11 15:30 +0200
Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 15:50 +0200
Re: [PATCH 06/11] mm, compaction: distinguish between full and partial COMPACT_COMPLETE Michal Hocko <mhocko@kernel.org> - 2016-04-11 15:50 +0200
[PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Andrew Morton <akpm@linux-foundation.org> - 2016-04-06 02:00 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Hugh Dickins <hughd@google.com> - 2016-04-06 03:00 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Michal Hocko <mhocko@kernel.org> - 2016-04-06 11:30 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Andrew Morton <akpm@linux-foundation.org> - 2016-04-06 19:50 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 16:40 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Michal Hocko <mhocko@kernel.org> - 2016-04-11 17:20 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Michal Hocko <mhocko@kernel.org> - 2016-04-11 17:40 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Vlastimil Babka <vbabka@suse.cz> - 2016-04-12 14:00 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Michal Hocko <mhocko@kernel.org> - 2016-04-12 14:30 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Michal Hocko <mhocko@kernel.org> - 2016-04-11 18:00 +0200
[RFC PATCH] mm: use compaction feedback for thp backoff conditions Michal Hocko <mhocko@kernel.org> - 2016-04-11 18:10 +0200
Re: [PATCH 09/11] mm, compaction: Abstract compaction feedback to helpers Vlastimil Babka <vbabka@suse.cz> - 2016-04-12 14:00 +0200
[PATCH 11/11] mm: consider compaction feedback also for costly allocation Michal Hocko <mhocko@kernel.org> - 2016-04-05 13:30 +0200
Re: [PATCH 11/11] mm: consider compaction feedback also for costly allocation Michal Hocko <mhocko@kernel.org> - 2016-04-05 14:50 +0200
Re: [PATCH 11/11] mm: consider compaction feedback also for costly allocation Vlastimil Babka <vbabka@suse.cz> - 2016-04-11 17:10 +0200
Re: [PATCH 00/11] oom detection rework v5 Michal Hocko <mhocko@kernel.org> - 2016-04-05 14:50 +0200
csiph-web