Re: [LSF/MM/BPF TOPIC] Dynamic Growth of Kernel Stacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 23, 2024 at 1:56 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> 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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux