linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [LSF/MM TOPIC] Eliminating tail pages
Date: Tue, 12 Feb 2019 11:55:49 +0300	[thread overview]
Message-ID: <20190212085549.ez5ghqrzkcqx2h46@kshutemo-mobl1> (raw)
In-Reply-To: <20190211190908.GA21683@bombadil.infradead.org>

On Mon, Feb 11, 2019 at 11:09:08AM -0800, Matthew Wilcox wrote:
> 
> I can't follow simple instructions.
> 
> ----- Forwarded message from Matthew Wilcox <willy@infradead.org> -----
> 
> Date: Mon, 11 Feb 2019 11:07:28 -0800
> From: Matthew Wilcox <willy@infradead.org>
> To: lsf-pc@lists.linux-foundation.org
> Subject: [LSF/MM TOPIC] Eliminating tail pages
> User-Agent: Mutt/1.9.2 (2017-12-15)
> 
> 
> Tail pages are a pain.  All over the kernel, we call compound_head()
> (or occasionally forget to ...).  So what would it take to eliminate them?
> 
> I'm doing my best to eliminate them from being stored in the page cache.
> That's a nice first step, but the very first thing that functions like
> find_get_entry(), find_get_entries(), et al do is convert any large
> page they find to a tail page.  So we'll probably need to introduce new
> functions which will return head pages and convert users over to them.
> I know Kirill has a lot more experience with this.
> 
> Another place where we return tail pages is get_user_pages().  Callers of
> get_user_pages() expect tail or small pages; they do things like calculate
> the offset of the byte within the page by AND with PAGE_MASK.  There'll be
> a lot of work to check all the users and convert them to something like
> 
> unsigned int page_offset(struct page *page, unsigned long addr);
> 
> Another thing to consider is that some architectures have a third-level
> page size of 16GB (looking at you, POWER).  So an unsigned int isn't
> going to cut it.  Do we want to support pages that large, or do we declare
> that there will never be any point in supporting pages larger than 4GB?
> 
> There are probably other pitfalls I'm forgetting or have never known.

Another place where we see tail pages is on plain page walk: we do map
compund pages with PTEs: THP after split_huge_pmd() or simillar. Some
drivers also allocate compound pages that can be mmaped into userspace
with PTE. I saw sound subsystem do this.

-- 
 Kirill A. Shutemov

      reply	other threads:[~2019-02-12  8:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 19:09 [LSF/MM TOPIC] Eliminating tail pages Matthew Wilcox
2019-02-12  8:55 ` Kirill A. Shutemov [this message]

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=20190212085549.ez5ghqrzkcqx2h46@kshutemo-mobl1 \
    --to=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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).