Re: [PATCH] mm: remove unnecessary page_table_lock on stack expansion

From: Linus Torvalds
Date: Fri Nov 01 2024 - 15:00:26 EST


On Fri, 1 Nov 2024 at 08:46, Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> wrote:
>
> Each of which acquire the mmap write lock before doing so. Despite this, we
> maintain code that acquires a page table lock in the expand_upwards() and
> expand_downwards() code, stating that we hold a shared mmap lock and thus
> this is necessary.
>
> It is not, we do not have to worry about concurrent VMA expansions so we
> can simply drop this, and update comments accordingly.
>
> We do not even need be concerned with racing page faults, as
> vma_start_write() is invoked in both cases.

Ack, seems ObviouslyCorrect(tm).

Linus