From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 9C81A34028D for ; Wed, 8 Apr 2026 01:38:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775612339; cv=none; b=fDvKEmDoRGj8g0i8CJYDPO6Qs+aX/Rn4KXnx/ZPOBchSmY2fG3t2kDxfudA08TMGlRxoR/Vh4GlXvSy/NMPyqLb1EcvaZoBa/Tfi6xIXnXaqW8heq80z27aS/+X/mG4bJB10aDGdIdwwNu1BepwHgxi10MS0NIslg+5BVjJv6do= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775612339; c=relaxed/simple; bh=8vgacSyCKWoTA2qf9u49OAYZvrjQHSH6WyC33xImG64=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lECFvDq3L+97P0Ro9FNM/UdI33Hdgp4hMZsxAly7OcRKBHALEuFkLReUKA8eT6Wycwqn7fIIfc5PKPC21K2B+DHDUfzzz4TS0jsgPOb4NYZT3d+UOQUPs1+bMx+j72G5tygsy3uOjekXX9JEA4rqdel6/dnoHQnVyvBK6P4r4Bo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=a9pDp5TC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="a9pDp5TC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775612337; 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=0KJ/NgB0Ojo2aHtP+IOyiMd2ituEthuu9DnTYaHttBg=; b=a9pDp5TC+YFTXCpansDcE6uLqcarVSYpG21AEJiaJD9OtCRkrw9PWShrEClNTgKm0n3Wsc oRoFnFCqBPRCmP8c++Kgt4xr7nBxBWOu1WKwPX9oC3fVhyzSY8CsnIQXJvk2PALEqemrAA PCw1FlO8p4rDu1LC1HTZul9Ie0e2Cwk= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-2Qb9RMGOOu-tgCd1e2KupA-1; Tue, 07 Apr 2026 21:38:51 -0400 X-MC-Unique: 2Qb9RMGOOu-tgCd1e2KupA-1 X-Mimecast-MFC-AGG-ID: 2Qb9RMGOOu-tgCd1e2KupA_1775612329 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D756719560B4; Wed, 8 Apr 2026 01:38:48 +0000 (UTC) Received: from localhost (unknown [10.72.112.14]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F0D511955D84; Wed, 8 Apr 2026 01:38:46 +0000 (UTC) Date: Wed, 8 Apr 2026 09:38:42 +0800 From: Baoquan He To: Johannes Weiner Cc: Jianyue Wu , linux-mm@kvack.org, akpm@linux-foundation.org, david@kernel.org, mhocko@suse.com, zhengqi.arch@bytedance.com, shakeel.butt@linux.dev, lorenzo.stoakes@oracle.com, chrisl@kernel.org, kasong@tencent.com, shikemeng@huaweicloud.com, nphamcs@gmail.com, baohua@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: move folio LRU helpers out of swap Message-ID: References: <20260407110002.204755-1-wujianyue000@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-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 04/07/26 at 10:22am, Johannes Weiner wrote: > On Tue, Apr 07, 2026 at 07:00:02PM +0800, Jianyue Wu wrote: > > All allocated folios are added into lru lists for later reclaim whether > > they are file or anonymous folios. However those folio lru operation codes > > are put in mm/swap.c which is not so appropriate. Because swap code is > > only for anonymous folios. > > Ironically, the only thing that doesn't fit in this file is the swap > stuff. The page_cluster & sysctl should be static in swap_state.c. > > The rest seems thematically relatively clean - infrastructure for > managing folio lifetime. swap.c is not the best name for it, but short > of finding a very clear improvement I'd just leave it alone. Can't agree more. We should move page_cluster & sysctl and swap_setup() to mm/swap_state.c, and rename mm/swap.c to mm/folio_lru.c or something like that.