Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1534734

Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5

Path csiph.com!news.freedyn.net!newsfeed.datemas.de!enother.net!enother.net!enother.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5
Date Fri, 02 Dec 2016 09:30:01 +0100
Message-ID <sJRod-1bm-3@gated-at.bofh.it> (permalink)
References <sJJTH-4xc-13@gated-at.bofh.it> <sJJTH-4xc-11@gated-at.bofh.it> <sJPcJ-8fP-3@gated-at.bofh.it>
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iTTgckijZ9PVSdBuhtNqG32BDS7yQ4CRR9UTQgCRuoI=; b=F9oK0ghhCQkOszhuA1qdYjvuhaeqXfmbtmi2GjzgwJVk8o45TNxxgZ/kMmD/ZwDks0 jBpt+edmSEhZ8qy9MIeWP+rzPRVUFxfF5Gw1AmBeHWBpO8fg/FOYWc/AAZur7eQ61CRS BrDodO+aH2hiwjHH5PTWOR1KcJvw/dXp6nwUaDH/OAnJDI4epcK+JD7aF+x39ifEk7F7 EcgCF2af0tisBx2FlfT0QN/RG3YSVm5aVsSr+FRwqeGFHgo/036SQ6NS1xKJbU/qcRTx WrKQw+MdpfQxfWR2Sq6SANeldBTvnyWkmilVJVcogdNtasfic3ylrP5R751h3EsljELJ icdA==
X-Gm-Message-State AKaTC03sQ1qM/isciCnuWhKtR6OR+hL9t8nSSNC7CC7Cta3zYh/8TR6hP3NMbLKQkvv+kA==
X-Received by 10.194.77.83 with SMTP id q19mr37088480wjw.186.1480666870209; Fri, 02 Dec 2016 00:21:10 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.6.0 (2016-04-01)
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 50
Organization linux.* mail to news gateway
X-Original-Cc Mel Gorman <mgorman@techsingularity.net>, Andrew Morton <akpm@linux-foundation.org>, Christoph Lameter <cl@linux.com>, Vlastimil Babka <vbabka@suse.cz>, Johannes Weiner <hannes@cmpxchg.org>, Jesper Dangaard Brouer <brouer@redhat.com>, Linux-MM <linux-mm@kvack.org>, Linux-Kernel <linux-kernel@vger.kernel.org>
X-Original-Date Fri, 2 Dec 2016 09:21:08 +0100
X-Original-Message-ID <20161202082108.GB6830@dhcp22.suse.cz>
X-Original-References <20161202002244.18453-1-mgorman@techsingularity.net> <20161202002244.18453-3-mgorman@techsingularity.net> <20161202060346.GA21434@js1304-P5Q-DELUXE>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1534734

Show key headers only | View raw


On Fri 02-12-16 15:03:46, Joonsoo Kim wrote:
[...]
> > o pcp accounting during free is now confined to free_pcppages_bulk as it's
> >   impossible for the caller to know exactly how many pages were freed.
> >   Due to the high-order caches, the number of pages drained for a request
> >   is no longer precise.
> > 
> > o The high watermark for per-cpu pages is increased to reduce the probability
> >   that a single refill causes a drain on the next free.
[...]
> I guess that this patch would cause following problems.
> 
> 1. If pcp->batch is too small, high order page will not be freed
> easily and survive longer. Think about following situation.
> 
> Batch count: 7
> MIGRATE_UNMOVABLE -> MIGRATE_MOVABLE -> MIGRATE_RECLAIMABLE -> order 1
> -> order 2...
> 
> free count: 1 + 1 + 1 + 2 + 4 = 9
> so order 3 would not be freed.

I guess the second paragraph above in the changelog tries to clarify
that...
 
> 2. And, It seems that this logic penalties high order pages. One free
> to high order page means 1 << order pages free rather than just
> one page free. This logic do round-robin to choose the target page so
> amount of freed page will be different by the order.

Yes this is indeed possible. The first paragraph above mentions this
problem.

> I think that it
> makes some sense because high order page are less important to cache
> in pcp than lower order but I'd like to know if it is intended or not.
> If intended, it deserves the comment.
> 
> 3. I guess that order-0 file/anon page alloc/free is dominent in many
> workloads. If this case happen, it invalidates effect of high order
> cache in pcp since cached high order pages would be also freed to the
> buddy when burst order-0 free happens.

Yes this is true and I was wondering the same but I believe this can be
enahanced later on. E.g. we can check the order when crossing pcp->high
mark and only the given order portion of the batch. I just wouldn't over
optimize at this stage.
-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] High-order per-cpu cache v5 Mel Gorman <mgorman@techsingularity.net> - 2016-12-02 01:30 +0100
  [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in sync if struct page is corrupted Mel Gorman <mgorman@techsingularity.net> - 2016-12-02 01:30 +0100
    Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in sync if struct page is corrupted "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-12-02 05:00 +0100
      Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in  sync if struct page is corrupted Vlastimil Babka <vbabka@suse.cz> - 2016-12-02 07:20 +0100
        Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in sync if struct page is corrupted "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-12-02 10:40 +0100
          Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in  sync if struct page is corrupted Michal Hocko <mhocko@kernel.org> - 2016-12-02 11:20 +0100
            Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in  sync if struct page is corrupted Mel Gorman <mgorman@techsingularity.net> - 2016-12-02 12:10 +0100
    Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in  sync if struct page is corrupted Michal Hocko <mhocko@kernel.org> - 2016-12-02 09:20 +0100
      Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in  sync if struct page is corrupted Mel Gorman <mgorman@techsingularity.net> - 2016-12-02 10:50 +0100
        Re: [PATCH 1/2] mm, page_alloc: Keep pcp count and list contents in  sync if struct page is corrupted Michal Hocko <mhocko@kernel.org> - 2016-12-02 11:10 +0100
  [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Mel Gorman <mgorman@techsingularity.net> - 2016-12-02 01:30 +0100
    Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-12-02 07:10 +0100
      Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Michal Hocko <mhocko@kernel.org> - 2016-12-02 09:30 +0100
        Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-12-05 04:10 +0100
      Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Mel Gorman <mgorman@techsingularity.net> - 2016-12-02 10:10 +0100
        Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-12-05 04:10 +0100
          Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Mel Gorman <mgorman@techsingularity.net> - 2016-12-05 11:00 +0100
            Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-12-06 03:50 +0100
              Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Mel Gorman <mgorman@techsingularity.net> - 2016-12-06 15:00 +0100
    Re: [PATCH 2/2] mm: page_alloc: High-order per-cpu page allocator v5 Michal Hocko <mhocko@kernel.org> - 2016-12-02 09:30 +0100

csiph-web