All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: lsf-pc@lists.linux-foundation.org, linux-mm <linux-mm@kvack.org>
Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] Dynamic Growth of Kernel Stacks
Date: Tue, 30 Apr 2024 15:07:04 +0200	[thread overview]
Message-ID: <ZjDs-C6UUjcwM1GU@tiehlicka> (raw)
In-Reply-To: <CA+CK2bBYt9RAVqASB2eLyRQxYT5aiL0fGhUu3TumQCyJCNTWvw@mail.gmail.com>

Hi Pasha,
is this something you still do consider interesting (and also productive
in absence of x86 maintainers) to discuss at LSFMM?

On Thu 22-02-24 20:03:37, Pavel Tatashin wrote:
> For a long time, an 8K kernel stack was large enough. However, since
> 2014, the default stack size has increased to 16K [1]. To conserve
> memory at Google, we maintained 8K stacks via a custom patch while
> verifying that our workload could fit within this limit.
> 
> As we qualify new workloads and kernels, we find it more difficult to
> keep the stacks at 8K. Therefore, we will increase the stack size to
> the mainline value of 16K. However, this translates to a significant
> increase in memory usage, potentially counted in petabytes.
> 
> With virtually mapped stacks [2], it's possible to implement
> auto-growth on faults. Ideally, the vast majority of kernel threads
> could fit into 4K or 8K stacks, with only a small number requiring
> deeper stacks that would expand as needed.
> 
> The complication is that new pages must always be available from
> within an interrupt context. To ensure this, pages must be accessible
> to kernel threads in an atomic and lockless manner. This could be
> achieved by using a per-CPU supply of pages dedicated to handling
> kernel-stack faults.
> 
> [1] https://lwn.net/Articles/600644
> [2] https://lwn.net/Articles/692608
> _______________________________________________
> Lsf-pc mailing list
> Lsf-pc@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/lsf-pc

-- 
Michal Hocko
SUSE Labs


  parent reply	other threads:[~2024-04-30 13:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23  1:03 [LSF/MM/BPF TOPIC] Dynamic Growth of Kernel Stacks Pasha Tatashin
2024-02-23 21:49 ` Peter Collingbourne
2024-02-23 21:56   ` Matthew Wilcox
2024-02-23 22:01     ` Peter Collingbourne
2024-04-30 13:07 ` Michal Hocko [this message]
2024-05-01  0:20   ` [Lsf-pc] " 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=ZjDs-C6UUjcwM1GU@tiehlicka \
    --to=mhocko@suse.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.