Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1342506
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Andrew Morton <akpm@linux-foundation.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: limit direct reclaim for higher order allocations |
| Date | Thu, 25 Feb 2016 00:10:01 +0100 |
| Message-ID | <r5QJb-3eT-3@gated-at.bofh.it> (permalink) |
| References | <r5Pk6-27v-1@gated-at.bofh.it> |
| X-Mailer | Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=US-ASCII |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 61 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, hannes@cmpxchg.org, vbabka@suse.cz, mgorman@suse.de, linux-mm@kvack.org |
| X-Original-Date | Wed, 24 Feb 2016 15:02:31 -0800 |
| X-Original-Message-ID | <20160224150231.7dac6dc8c7dd9078db83eea4@linux-foundation.org> |
| X-Original-References | <20160224163850.3d7eb56c@annuminas.surriel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1342506 |
Show key headers only | View raw
On Wed, 24 Feb 2016 16:38:50 -0500 Rik van Riel <riel@redhat.com> wrote:
> For multi page allocations smaller than PAGE_ALLOC_COSTLY_ORDER,
> the kernel will do direct reclaim if compaction failed for any
> reason. This worked fine when Linux systems had 128MB RAM, but
> on my 24GB system I frequently see higher order allocations
> free up over 3GB of memory, pushing all kinds of things into
> swap, and slowing down applications.
hm. Seems a pretty obvious flaw - why didn't we notice+fix it earlier?
> It would be much better to limit the amount of reclaim done,
> rather than cause excessive pageout activity.
>
> When enough memory is free to do compaction for the highest order
> allocation possible, bail out of the direct page reclaim code.
>
> On smaller systems, this may be enough to obtain contiguous
> free memory areas to satisfy small allocations, continuing our
> strategy of relying on luck occasionally. On larger systems,
> relying on luck like that has not been working for years.
>
It would be nice to see some solid testing results on real-world
workloads?
(patch retained for linux-mm)
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index fc62546096f9..8dd15d514761 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2584,20 +2584,17 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
> continue; /* Let kswapd poll it */
>
> /*
> - * If we already have plenty of memory free for
> - * compaction in this zone, don't free any more.
> - * Even though compaction is invoked for any
> - * non-zero order, only frequent costly order
> - * reclamation is disruptive enough to become a
> - * noticeable problem, like transparent huge
> - * page allocations.
> + * For higher order allocations, free enough memory
> + * to be able to do compaction for the largest possible
> + * allocation. On smaller systems, this may be enough
> + * that smaller allocations can skip compaction, if
> + * enough adjacent pages get freed.
> */
> - if (IS_ENABLED(CONFIG_COMPACTION) &&
> - sc->order > PAGE_ALLOC_COSTLY_ORDER &&
> + if (IS_ENABLED(CONFIG_COMPACTION) && sc->order &&
> zonelist_zone_idx(z) <= requested_highidx &&
> - compaction_ready(zone, sc->order)) {
> + compaction_ready(zone, MAX_ORDER)) {
> sc->compaction_ready = true;
> - continue;
> + return true;
> }
>
> /*
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm: limit direct reclaim for higher order allocations Rik van Riel <riel@redhat.com> - 2016-02-24 22:40 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations David Rientjes <rientjes@google.com> - 2016-02-24 23:20 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations Rik van Riel <riel@redhat.com> - 2016-02-24 23:20 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-02-25 01:30 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations Rik van Riel <riel@redhat.com> - 2016-02-25 03:50 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-02-25 05:50 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations Andrew Morton <akpm@linux-foundation.org> - 2016-02-25 00:10 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations Rik van Riel <riel@redhat.com> - 2016-02-25 00:30 +0100
Re: [PATCH] mm: limit direct reclaim for higher order allocations Michal Hocko <mhocko@kernel.org> - 2016-02-25 15:50 +0100
csiph-web