From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD49B3AC0F1 for ; Mon, 23 Mar 2026 13:43:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774273436; cv=none; b=cMWR5rh4Q/pXyuGfFQYgq6VHYzAdbY77i7lyEiWCijSZqn/trUsecki//hNrejGQq84q7kHewpIfIbChE6qYD13Bpb2RAL+MNfGM2twgieZjBsAxu8Ptjw8K+Hy3gHS3E+0Q+uVk9RkebRlrhWLl9Z4t5cKDJ1HrZVM/S+rdG/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774273436; c=relaxed/simple; bh=R7YP+qB9sJk1773FzD06z+m+hbk73RC7zQtOk2w4qcs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PLHSAmG2MajpdnCuDU9yXP/KR3qKKFFHhmly+Ep0TYbpzEvUEsCkIc1MiDgNZNyIuo4CWUUxsRQrevwji1BPN9tfV8Z112sI/fFQVF8Nmlgk3ShHPB0Sqrl54zjx1yZbcXZqpZqbwyudSQ1OjN7/EgNHzm3YzCBQPuScCYxznXc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=srPRDA9y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="srPRDA9y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3A6BC4CEF7; Mon, 23 Mar 2026 13:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774273436; bh=R7YP+qB9sJk1773FzD06z+m+hbk73RC7zQtOk2w4qcs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=srPRDA9yRhiPLbMsiJDPRUPs9V2ZzT1YQObGxngCh3yI6TMcMJqDDMptnr0UFNfO4 H8JYgliPQxwe4TjOVsrO2hlq9Yeot+FMTiaTSll7ozxIMV1uNBqN/1B5LyFQxwn+cz Jor79O5R5NBW4rA4q1hADdJyVQghSwmybBUhU3LaTQ6LyZw/7U41CYnKCv/c7OqNSZ EczkCypYIxIZwkeRcxtH9LK5FYYpT7jvswnwmsaOGqP2vbr0jvOlN8VVnrgQ6hnBkV Fc+Tz1kowYl6cvREIp38CzUfwLEb22AZ3FKb9GpXX4r5KTV63VUFrVwk8xNyks+3mj 4bEqunXHbXUZg== Date: Mon, 23 Mar 2026 13:43:52 +0000 From: "Lorenzo Stoakes (Oracle)" To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, david@kernel.org, mhocko@kernel.org, zhengqi.arch@bytedance.com, yuzhao@google.com, shakeel.butt@linux.dev, willy@infradead.org, Liam.Howlett@oracle.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] mm/vmscan: prevent MGLRU reclaim from pinning address space Message-ID: <65cb38ee-2815-4b11-929d-3fc1528cc620@lucifer.local> References: <20260322070843.941997-1-surenb@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260322070843.941997-1-surenb@google.com> On Sun, Mar 22, 2026 at 12:08:43AM -0700, Suren Baghdasaryan wrote: > When shrinking lruvec, MGLRU pins address space before walking it. > This is excessive since all it needs for walking the page range is > a stable mm_struct to be able to take and release mmap_read_lock and > a stable mm->mm_mt tree to walk. This address space pinning results > in delays when releasing the memory of a dying process. This also > prevents mm reapers (both in-kernel oom-reaper and userspace > process_mrelease()) from doing their job during MGLRU scan because > they check task_will_free_mem() which will yield negative result due > to the elevated mm->mm_users. > > Replace unnecessary address space pinning with mm_struct pinning by > replacing mmget/mmput with mmgrab/mmdrop calls. mm_mt is contained > within mm_struct itself, therefore it won't be freed as long as > mm_struct is stable and it won't change during the walk because > mmap_read_lock is being held. > > Fixes: bd74fdaea146 ("mm: multi-gen LRU: support page table walks") > Signed-off-by: Suren Baghdasaryan Oh and sorry, missed this - do we need a 'Fixed' for something that's just a perf improvement? This doesn't seem buggy? Thanks, Lorenzo