From: Peter Collingbourne <pcc@google.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
David Hildenbrand <david@redhat.com>,
lsf-pc@lists.linux-foundation.org,
"cc: linux-mm" <linux-mm@kvack.org>
Subject: Re: [LSF/MM/BPF TOPIC] Dynamic Growth of Kernel Stacks
Date: Fri, 23 Feb 2024 14:01:02 -0800 [thread overview]
Message-ID: <CAMn1gO5o6cAK-0EV3BDg67iZg6MUU+hyyZSbrOiq24EZw50edQ@mail.gmail.com> (raw)
In-Reply-To: <ZdkUmh20YVIz0gin@casper.infradead.org>
On Fri, Feb 23, 2024 at 1:56 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Fri, Feb 23, 2024 at 01:49:08PM -0800, Peter Collingbourne wrote:
> > I wonder if this is another potential use case for bringing back
> > cleancache, as proposed in [1]? The idea would be that all kernel
> > stacks have 16KB allocations but only one page accessible and the rest
> > available as cleancache. We can handle a fault on one of those pages
> > by discarding the cleancache page and remapping it as r/w.
>
> That seems like the most complicated way to solve the problem.
> Stack pages which have not been accessed contain no data, so do not
> need swap or cleancache, they just need to be allocatable. And the
> fault handler needs to be able to handle faults from interrupt context,
> which I'm not sure all architectures can do.
>
> The "We need to be able to allocate memory from interrupt context" is
> really not that hard to handle; just keep three pages in a per-cpu array.
> Refill the array at return-to-process-context.
Okay, if it doesn't really need that many pages allocated upfront,
that seems like the best approach to me as well.
Peter
next prev parent reply other threads:[~2024-02-23 22:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 1:03 Pasha Tatashin
2024-02-23 21:49 ` Peter Collingbourne
2024-02-23 21:56 ` Matthew Wilcox
2024-02-23 22:01 ` Peter Collingbourne [this message]
2024-04-30 13:07 ` [Lsf-pc] " Michal Hocko
2024-05-01 0:20 ` Pasha Tatashin
2024-05-02 7:19 ` Michal Hocko
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=CAMn1gO5o6cAK-0EV3BDg67iZg6MUU+hyyZSbrOiq24EZw50edQ@mail.gmail.com \
--to=pcc@google.com \
--cc=alexandru.elisei@arm.com \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=pasha.tatashin@soleen.com \
--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