linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mateusz Guzik <mjguzik@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  Pasha Tatashin <pasha.tatashin@soleen.com>
Subject: Re: [PATCH v2 0/5] fork: Page operation cleanups in the fork code
Date: Wed, 7 May 2025 19:03:30 +0200	[thread overview]
Message-ID: <wk2wjbmh4woeyuvji2sozac5fjh4wp25sygijlzzopmmzj3liu@wg7nyhbvfnlt> (raw)
In-Reply-To: <20250507-fork-fixes-v2-0-82ab1e42cde3@linaro.org>

On Wed, May 07, 2025 at 02:46:26PM +0200, Linus Walleij wrote:
> This patch set consists of outtakes from a 1 year+ old
> patch set from Pasha, which all stand on their own.
> See:
> https://lore.kernel.org/all/20240311164638.2015063-1-pasha.tatashin@soleen.com/
> 
> What the code mainly does is make the fork.c file more
> oriented around pages and remove reliance on THREAD_SIZE.
> 
> These are good cleanups for readability and in one case
> (last patch using clear_page()) a performance improvement,
> so I split these off, rebased on v6.15-rc1, addressed review
> comments and send them separately.
> 
> All mentions of dynamic stack are removed from the patch
> set as we have no idea whether that will go anywhere.
> 
> This is mostly MM related so when the patches are ready
> I expect they would land in Andrew's patch stack.
> 

The ifdef clean up looks fine.

If readability is concerned I think a big problem is code duplication in
alloc_thread_stack_node().

The code instead obtain the stack space and only then do the memcg
charge and tsk var popoulation work.

The real problem here is that the cache is incredibly primitive and in
fact with a performance bug (ignoring NUMA affinity -- pages get added
to the cache and removed from it without any regard for that aspect or
the node parameter!)


  parent reply	other threads:[~2025-05-07 17:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 12:46 Linus Walleij
2025-05-07 12:46 ` [PATCH v2 1/5] fork: Clean-up ifdef logic around stack allocation Linus Walleij
2025-05-13  6:29   ` Mike Rapoport
2025-05-07 12:46 ` [PATCH v2 2/5] fork: Clean-up naming of vm_stack/vm_struct variables in vmap stacks code Linus Walleij
2025-05-13  6:33   ` Mike Rapoport
2025-05-07 12:46 ` [PATCH v2 3/5] fork: Remove assumption that vm_area->nr_pages equals to THREAD_SIZE Linus Walleij
2025-05-07 16:56   ` Mateusz Guzik
2025-05-09  5:44     ` Linus Walleij
2025-05-07 12:46 ` [PATCH v2 4/5] fork: check charging success before zeroing stack Linus Walleij
2025-05-13  7:38   ` Mike Rapoport
2025-05-07 12:46 ` [PATCH v2 5/5] fork: zero vmap stack using clear_page() instead of memset() Linus Walleij
2025-05-07 16:51   ` Mateusz Guzik
2025-05-09  5:49     ` Linus Walleij
2025-05-07 17:03 ` Mateusz Guzik [this message]
2025-05-09  6:57   ` [PATCH v2 0/5] fork: Page operation cleanups in the fork code Linus Walleij
2025-05-09 11:16     ` Mateusz Guzik

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=wk2wjbmh4woeyuvji2sozac5fjh4wp25sygijlzzopmmzj3liu@wg7nyhbvfnlt \
    --to=mjguzik@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mm@kvack.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