From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67A6126A0A7 for ; Tue, 14 Apr 2026 06:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776149881; cv=none; b=d7gPjnef6R50e8q4d3nJN+wzh1Zw3cWKM+xPjwh3eZAEkdr8Jy1xMV8qOGnhGbf8MkZgFH33lHeqpcGSee/BXEVD8pRll//7UMujIhEkRPs4uinjiCm5hr0KxxE4A6fAwCoNZ6D25ijYOSHa4dGQDYIhk3RZWWdYZCaJ06jcjm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776149881; c=relaxed/simple; bh=UPXjAoX0Tpm/le/i81Tym+2T8TMmUOO/pxRdtV9L0qE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H5FQ3K7MZW/zR9ixm6WNnaxpDFypeGrrHYUVQJPawxgODYAcod4SBedDzLTMy74hfIN+iN+Gd/5ZYIxvCxEhqJp1BefVNgZClvUH6M+1PYPRbbPezruH64VOn+PGOFCu8RU9vsGjCHMJTdMGvGuuFx8D2EYmKMMAU/rDrkqIj/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=fqsVAJtd; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="fqsVAJtd" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-488971db0fdso51464065e9.0 for ; Mon, 13 Apr 2026 23:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1776149879; x=1776754679; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lwTuR2PhVEgSCyjQCwvbuby19x0diy657rvwRBEtIr0=; b=fqsVAJtdWaeMKliBogFIznvLxI1UPkcJIaHGtMpbViIVT2S2u3zBjnfDObBUIplNWL nMbFg15c3eEn8IkbeiDxDXJOgxX6RlU+nGG/Yj8zQGD7U19rbsGOOIvx9yZTNKa2dTvv wp1XB+jEZJz21YN24PAlSFad459/oVBrcdzDSLztWrwYl4xhq9cvLtKkE9YMFHlVtVBI LSFl5kVKwmRSNnkYkvVNTKSWIsxXgtiGPAJWdHY7vQOanSvicm+klMmJc6W/eatDRl5i gkYTyowjEOJenS4ub9s1P+Hx66bUx1c3wxaSUVtITKRq479hraPYj+0JZfIx2PuK9Utn LVtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776149879; x=1776754679; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lwTuR2PhVEgSCyjQCwvbuby19x0diy657rvwRBEtIr0=; b=JfdlydHGPRCRIB5rt0NfkEOFXjM+JHTK8fO8cPRHG1ZTQyRxG6ya1WsbDYPYEp3Yrv 7rmRDhdHEfABdXuUrkgDb61zvjO2kzxZa3KYKYgQToLrtVMuaOzoLPgAJnySYGNgvrKv yjklulNTnTAZTZOCdDzR9YKg19Goy6ytXQqHqHS/amYj2e/ZsPoixUCjFBH3BM6bU+td h29cU0iCCgGdDNFylsh2jnvehZQWmHg3qAbJ4oreqW5bOhOmtfnkFEVFMpCuo1SDpp6b 95gCVR/wlS5yXQogcUs2Rd88QJr7saeQayot2fHok7btxLbluaZJpH/tbAr+qQ6g10qT h0Eg== X-Forwarded-Encrypted: i=1; AFNElJ+WOSvuFVDW9ZO1h2RjS96ezPjxBBlTUxNtbIE4yvH2VsIpKy0OlN0PluK+g0+AwOYXZuqXvfKLtBrn6pc=@vger.kernel.org X-Gm-Message-State: AOJu0Ywr4mRlwiKZ0W0zipMQ92CUD8ksgP0tDjq/T/5+pPVW1e4vrmjX A/JLE8r2R1sT9fu0IYpx+sgKGOseu7ksycwG6lbz408u8lwQTnZGN4uHlbiyx1oWujA= X-Gm-Gg: AeBDiesbo6+l58SftXC/lEzY+P/gNSx+6JwnGs4oNZ6F4tH5a7Bvd/yAaRh8GTXvl0N SFJXuSv4WUncNUut+LBqhJZCJszIDVUrUaFp+C1WVF0D0/xKJQ5jFUy82Jq+DOHFTxcMXcCXwOa cwMPEmDC/K5+nLgFj2V1M2KPGYRlk+M31p+aF7NgZF/7Hjo5cQkCrmOVXEb9a8HAiz9P6nVX2dr B5nP2/KCWVr/p5wFoU9V9yipwUBjXn+WqhSnFHSv7c4tC4DFn/WA/cCqtzR86vZRxqhFHUAAfOK Ij1Pn8ThmQEiFHF8ztdEjtb5N1Pfw9I8r4Avc+QcgKCUdW/zWTBG2Bjsxxpk7lafgBVNYa+3K9s O4BgYsdZL4pGqN9LshNoJ7RKBQqJNFvhZP/ikDsk4mWvwjTNmli7tp+L7MQWoKTqErJXPG7s5CP 9mLx+Ui3O399JqaOvtKY/emNfKtObuFz4F0SafnDpbt5up X-Received: by 2002:a05:600c:a413:b0:488:a639:b787 with SMTP id 5b1f17b1804b1-488d67f39admr162085275e9.11.1776149878711; Mon, 13 Apr 2026 23:57:58 -0700 (PDT) Received: from localhost (109-81-29-22.rct.o2.cz. [109.81.29.22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488ee018b34sm28791895e9.13.2026.04.13.23.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2026 23:57:58 -0700 (PDT) Date: Tue, 14 Apr 2026 08:57:57 +0200 From: Michal Hocko To: Minchan Kim Cc: akpm@linux-foundation.org, david@kernel.org, brauner@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, surenb@google.com, timmurray@google.com Subject: Re: [RFC 0/3] mm: process_mrelease: expedited reclaim and auto-kill support Message-ID: References: <20260413223948.556351-1-minchan@kernel.org> 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: <20260413223948.556351-1-minchan@kernel.org> On Mon 13-04-26 15:39:45, Minchan Kim wrote: > This patch series introduces optimizations to expedite memory reclamation > in process_mrelease() and provides a secure, race-free "auto-kill" > mechanism for efficient container shutdown and OOM handling. > > Currently, process_mrelease() unmaps pages but leaves clean file folios > on the LRU list, relying on standard memory reclaim to eventually free > them. Furthermore, requiring userspace to send a SIGKILL prior to > invoking process_mrelease() introduces scheduling race conditions where > the victim task may enter the exit path prematurely, bypassing expedited > reclamation hooks. > > This series addresses these limitations in three logical steps. > > Patch #1: mm: process_mrelease: expedite clean file folio reclaim via mmu_gather > Integrates clean file folio eviction directly into the low-level TLB > batching (mmu_gather) infrastructure. Symmetrically truncates clean file > folios alongside anonymous pages during the unmap loop. Why do we need to care about clean page cache? Is this a form of drop_caches? > Patch #2: mm: process_mrelease: skip LRU movement for exclusive file folios > Skips costly LRU marking (folio_mark_accessed) for exclusive file-backed > folios undergoing process_mrelease reclaim. Perf profiling reveals that > LRU movement accounts for ~55% of overhead during unmap. OK, but why is this not desirable behavior fir mrelease? > Patch #3: mm: process_mrelease: introduce PROCESS_MRELEASE_REAP_KILL flag > Adds an auto-kill flag supporting atomic teardown. Utilizes a dedicated > signal code (KILL_MRELEASE) to guarantee MMF_UNSTABLE is marked in the > signal delivery path, preventing scheduling races. Could you explain why those races are a real problem? -- Michal Hocko SUSE Labs