From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 9FBA3355F5F for ; Wed, 3 Jun 2026 15:10:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780499441; cv=none; b=Tn52BO4U05UGQWlusup85rTj/ctsyQIMwA5nk4SXDSheIuylc9hXQM2ggD1ZuKA8+tDP1i03SrpKDmELxj5lAWJOmIu1F+KfD2dOTxbGEmb0t8AJ30bXupLBS2oV/3tgfgK/9ZS/BOcnYDreUOS2cn7f/bLL+Xed31eOA5yg8d4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780499441; c=relaxed/simple; bh=9E9CvLqS7V27WBx46ec8bdGPUELH8q52xSpkvm9nF2E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HRHjdGjYUiTn+9EyLRDG/ouXjPMLXTHHhavnVJLxBEXZWub3xWDKH+W2y4KKmTB4HPFZsoRsFwWMnoAE7f8XuXVAho8WgtZWUuhQ9efk8ldh1SlNX2le6i3ht/wV/CmSPV9oCMDYo1+Giv8eLSjVkE+3N8DdraD44RmZtQ2rcrg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=S+4Z2CjW; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="S+4Z2CjW" Date: Wed, 3 Jun 2026 23:10:27 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1780499437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UwyE00rrj7YKUAiyH8ti6NE4tmnyPUBdLYn07MV8MEM=; b=S+4Z2CjWVwdImKKTlKF0PC/QctyLevgRJcGkXte8oq9tHbfSwMeMtof58D48AcISbCXwO7 kHtRFU0/IMPtKalsGQ8q8BUdGcAURSZUKoYpOqfBTMqVzKvE/sDndypwSAKGr/VWMB7u8N 9uIAUtYNT7sBZBjABJrkEkE5PKx7HTY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Baoquan He To: Lorenzo Stoakes Cc: Matthew Wilcox , Jianyue Wu , Tal Zussman , Andrew Morton , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Youngjun Park , Qi Zheng , Shakeel Butt , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Hugh Dickins , Baolin Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] mm: move folio LRU code out of swap Message-ID: References: <20260602-ch-swap-series-plus-folio-lru-cleanup-v3-0-5bbb567f8c99@gmail.com> <20260602-ch-swap-series-plus-folio-lru-cleanup-v3-2-5bbb567f8c99@gmail.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: X-Migadu-Flow: FLOW_OUT On 06/03/26 at 01:03pm, Lorenzo Stoakes wrote: > On Wed, Jun 03, 2026 at 06:49:16PM +0800, Baoquan He wrote: > > On 06/02/26 at 04:57pm, Matthew Wilcox wrote: > > > On Tue, Jun 02, 2026 at 09:01:16AM +0800, Jianyue Wu wrote: > > > > Rename mm/swap.c to mm/folio_lru.c so the filename better matches > > > > the code's main responsibility. > > > > > > > > This keeps the implementation split from swap-specific code without > > > > changing the published LRU helper interfaces. > > > > > > At the same time, we have Tal trying to split folio_wait.c out > > > of filemap.c. https://lore.kernel.org/linux-mm/20260520-filemap-split-v1-0-c36ddc2b6cf2@columbia.edu/ > > > > > > I wonder if instead of folio_lru.c and folio_wait.c, we shouldn't simply > > > have folio.c. Tal has 700 lines in his diffstat, you'll have about 1100 > > > lines, so that's about 1800 llines which seems like a good size. > > > There's some functions from mm/util.c that would fit nicely too -- > > > folio_mapping(), folio_anon_vma(), folio_copy(), flush_dcache_folio() > > > > I think folio_lru.c and folio_wait.c are better than a single folio.c. > > > > A single folio.c with all of them would have no clear boundary for what > > belongs there and what doesn't. For comparison, page_alloc.c isn't called > > page.c (we have files called mm/page*.c). > > Well page_alloc.c doesn't only contain things that operate on struct page * > right? > > Whereas folio.c is strictly operations literally performed on folios which seems > like a good match to me. If so, then maybe folio.c is a better name. Maybe in the future it becomes much bigger when more and more folio related codes are added in, surely that's another story. > > I find folio_lru.c and folio_wait.c far more difficult to figure out what goes > where and there'll be a bunch of miscellaneous stuff all over the place. > > I vote for folio.c. > > > > > > > > > Other people have thoughts? > > > > > Thanks, Lorenzo >