linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: lsf-pc@lists.linux-foundation.org, linux-mm <linux-mm@kvack.org>
Subject: Re: [LSF/MM/BPF TOPIC] Single Owner Memory
Date: Tue, 21 Feb 2023 15:55:21 +0000	[thread overview]
Message-ID: <Y/TpaVwiWYnZsj5E@casper.infradead.org> (raw)
In-Reply-To: <CA+CK2bD5gztcyTm18cnznNi48o_G7H-F+LG=TSk=0WSGL39hrA@mail.gmail.com>

On Mon, Feb 20, 2023 at 02:10:24PM -0500, Pasha Tatashin wrote:
> The discussion should include the following topics:
> -  Interaction with folio and the proposed struct page {memdesc}.
> - Handling for migrate_pages() and friends.
> - Handling for FOLL_PIN and FOLL_LONGTERM.
> - What type of madvise() properties the som memory should handle

Something I didn't see covered was how you'd want to handle memory
pressure.  The answer for memdescs is that we'd treat each userspace
allocation as a single object; if you allocate a 256kB folio, that has
one accessed bit (set every time any of the PTEs which reference that
folio is accessed), one dirty bit, is aged on the LRU as a single unit
and will be written to swap as a single unit.

Assuming we're dealing with objects smaller than PMDs, we have a number
of PTEs each of which has its own A and D bits, so we can determine
at each revolution of the LRU clock whether it still makes sense to be
treating the folio as a single unit, or whether pages in the first half
of the folio are no longer being accessed and we should split the folio
in half and age the two halves separately.

All of that is still theoretical; we don't allocate anon memory in sizes
other than PAGE_SIZE and PMD size.  And we don't track page cache A and
D bits to see whether the decision to allocate a particular page size was
the right one (most page cache memory is never mapped into userspace, so
it might be of limited value, but I'm sure we could track the equivalent
information with read() and write()).


  parent reply	other threads:[~2023-02-21 15:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 19:10 Pasha Tatashin
2023-02-21 13:46 ` Matthew Wilcox
2023-02-21 14:37   ` Pasha Tatashin
2023-02-21 15:05     ` Matthew Wilcox
2023-02-21 17:16       ` Pasha Tatashin
2023-02-22 16:18         ` Matthew Wilcox
2023-02-22 16:40           ` Pasha Tatashin
2023-02-21 15:55 ` Matthew Wilcox [this message]
2023-02-21 17:20   ` Pasha Tatashin

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=Y/TpaVwiWYnZsj5E@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=pasha.tatashin@soleen.com \
    /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