linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	Matthew Wilcox <willy@infradead.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: What size anonymous folios should we allocate?
Date: Tue, 28 Mar 2023 19:56:48 +0800	[thread overview]
Message-ID: <20230328115648.2557-1-hdanton@sina.com> (raw)
In-Reply-To: <7981dd12-4e56-a449-980b-52f27279df81@arm.com>

On 28 Mar 2023 11:12:54 +0100 Ryan Roberts <ryan.roberts@arm.com>
> On 27/03/2023 16:48, Vlastimil Babka wrote:
> > 
> > Hm if it's 4 entries on arm64 and presumably 8 on AMD, maybe we can only
> > care about how actively accessed are the individual "subpages" above that
> > size, to avoid dealing with this uncertainty whether HW tracks them. At such
> > smallish sizes we shouldn't induce massive overhead?
> 
> I'm not sure I've fully understood this point. For arm64's HPA, there is no
> "uncertainty [about] whether HW tracks them"; HW will always track access/dirty
> individually for each base page. The problem is the inverse; if SW (or HW) sets
> those bits differently in each page, then TLB coalescing performance may
> decrease. Or are you actually suggesting that SW should always set the bits the
> same for a 4 or 8 page run, and forgo the extra granularity?

That inverse side looks like a bleak cloud above anon order-5/6 pages
for instance.

> >> I'm hearing that there are workloads where being able to use the contiguous bit
> >> really does make a difference, so I would like to explore solutions that can
> >> work when we only have access/dirty at the folio level.
> > 
> > And on the higher orders where we have explicit control via bits, we could
> > split the explicitly contiguous mappings once in a while to determine if the
> > sub-folios are still accessed? Although maybe with 16x4kB pages limit it may
> > still be not worth the trouble?
> 
> I have a bigger-picture question; why is it useful to split these large folios?
> I think there are 2 potential reasons (but would like to be educated):
> 
> 1. If a set of sub-pages that were pre-faulted as part of a large folio have
> _never_ been accessed and we are under memory pressure, I guess we would like to
> split the folio and free those pages?
> 
> 2. If a set of subpages within a folio are cold (but were written in the past)
> and a separate set of subpages within the same folio are hot and we are under
> memory pressure, we would like to swap out the cold pages?
> 
> If the first reason is important, I guess we would want to initially map
> non-contig, then only remap as contig once every subpage has been touched at
> least once.
> 
> For the second reason, my intuition says that a conceptual single access and
> dirty bit per folio should be sufficient, and folios could be split from
> time-to-time to see if one half is cold?

It makes no sense to detect hot pages at the cost of order-5 compound page
particularly given the bleakness above.


  reply	other threads:[~2023-03-28 11:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 21:49 What size anonymous folios should we allocate? Matthew Wilcox
2023-02-21 23:05 ` Yang Shi
2023-02-22  3:08   ` Kent Overstreet
2023-02-22  3:52   ` Matthew Wilcox
2023-02-22 22:48     ` Yang Shi
2023-03-27 12:41     ` Vlastimil Babka
2023-03-27 15:30       ` Ryan Roberts
2023-03-27 15:48         ` Vlastimil Babka
2023-03-28 10:12           ` Ryan Roberts
2023-03-28 11:56             ` Hillf Danton [this message]
2023-03-28 12:16             ` Vlastimil Babka
2023-02-22  2:28 ` Hillf Danton
2023-03-01 10:24 ` Ryan Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230328115648.2557-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ryan.roberts@arm.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).