From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 E09B2379C48 for ; Fri, 7 Aug 2026 21:22:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786137773; cv=none; b=sMr9uLffwGUT1cOdAQM3iFfbuvniLpUcH+ZA/R4lJFTYkY1/rFIaDaJgsrvDUOCiNnzad5/pPWsqOesdpNYZE8l3zQfaIT9ujEAC/HHspGzMWABRb1TjqgQKNYxfNR3HUIoyPrQowe5lN/HQ23Ea1xgK+GSfYJlqz1FHQJFExJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786137773; c=relaxed/simple; bh=y6i7cx39WD7HSV+yrKeXcNZ2XryPQykkSj0bXTMcu9Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mkTBNh+kH37WabVJftRooJeu6IUDNM6hA0+co03odd/FmWieNUTgyVxvjq2GqEp/Yw/L7a6Im3sWe2WWDXBba5YYaFXzgTfKQwG2eM+sFDmooVKBGv8ZnrdR8AcsC7DXIQAu7sXMAurX24G3nL4oVT0X6prJ6C+uISWFbqWCHyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U/9Eycxp; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U/9Eycxp" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2ced3386430so354025ad.1 for ; Fri, 07 Aug 2026 14:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786137771; x=1786742571; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=wGhPRnqQkvQ9XTDuFD2lcLHAbRWoNgCOpfXPrXNXFpc=; b=U/9Eycxpu4u+Ktpx6DOI8zPQDkoPsYDV3sCmK59RIg+sZ1h1nMM3y4744GurbZ/S2K w1HsleTWTEsKxmDtnxTrsjf7XxSZiVckakTvNhMVBA3bJp3sjVvJLnNh55FZJlK8xSrp 5pE4eWqNshCgMZbMgTp+9x/JrdBNzMIhn8oXp2qYeXvdMSZLeEJFsK9wZzgCkfzN9nT9 lJwncvh/8C2GRex07rVsBUR3LdFypGfohfJcsLgN9Qks9/yJB5tqjLgwedcPYRG4vb8/ O6KbUkdkI3DZ9aWpZHj0Kw6Ntwef6JQQrivdiqDMgDrw4wkAJg5f3Yk+Q9w0CYZjUVPF Q5bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786137771; x=1786742571; h=in-reply-to:content-transfer-encoding:content-disposition :content-type: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:content-type; bh=wGhPRnqQkvQ9XTDuFD2lcLHAbRWoNgCOpfXPrXNXFpc=; b=h23/cXKjwELMAE5xDNkcHxLqXakFyrc31pJbFNWEp91ymJCKMZ56Gkkq+ktrIPDHgu JklnQ5gvabd+4zlyFnwfPagLwtaS7SQpOua8X1WETAhqJ6GesUF//CRLT0n0mxnmiCkr d8zkFR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-2d294b29499mr79128275ad.3.1786137771208; Fri, 07 Aug 2026 14:22:51 -0700 (PDT) Received: from KASONG-MC4 ([101.32.222.185]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d14dbeaad6sm13880585ad.51.2026.08.07.14.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 14:22:50 -0700 (PDT) Date: Sat, 8 Aug 2026 05:22:41 +0800 From: Kairui Song To: Zi Yan Cc: Shivam Kalra , Kairui Song , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Baolin Wang , "Liam R. Howlett" , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Shuah Khan , Nico Pache , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 0/3] mm: support splitting mappingless swapcache folios Message-ID: References: <20260805-b4-mappingless-swapcache-v1-0-b1d78ba257ca@zohomail.in> <590B3189-5B66-4ECB-84CD-7B7EF18C0E54@nvidia.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Aug 07, 2026 at 10:18:05AM +0800, Zi Yan wrote: > On Wed Aug 5, 2026 at 11:54 AM EDT, Kairui Song wrote: > > On Wed, Aug 05, 2026 at 08:03:33AM +0800, Zi Yan wrote: > >> On 5 Aug 2026, at 7:18, Shivam Kalra via B4 Relay wrote: > >> > >> > Large shmem folios lose their address-space mapping when they are written > >> > to swap, but remain valid members of the swap cache. Folios read from swap > >> > but not yet associated with an anon_vma can have the same mappingless > >> > swapcache state. folio_check_splittable() currently mistakes both cases for > >> > truncation and rejects the split with -EBUSY. > >> > > >> > Implement the longstanding TODO for this state. Allow mappingless > >> > swapcache folios to use the existing uniform order-0 swapcache split path, > >> > while continuing to reject truly truncated folios and unsupported > >> > higher-order or non-uniform swapcache splits. > >> > >> Thank you for your patches. > >> > >> As Kairui (cc’d) mentioned in [1] (see “A bit more details on this”), > >> we might not need to implement this split. I will let Kairui to decide > >> how we should deal with this patchset. > >> > >> [1] https://lore.kernel.org/all/CAMgjq7CHDG8JhesSPMkn1kzG8jKb0BXO756BvxMQC_MCn2eTyA@mail.gmail.com/ > > > > Thanks for the CC, this is actually not hard to implement as shown by > > Shivam, I just found the code more and more hard to follow and fragile > > as we add more logic to it. And we don't have to reject higher order > > split either which can be seen easily if the code is cleaner. > > > > Personally I think doing some cleanup first is better, I haven't post any > > code as right now there doesn't seem to be much user of this. It will be > > needed if more clean THP swapcache begin to show up due to things like > > THP readahead for swap, which isn't here yet. I think I can send an RFC > > tomorrow just for reference. I'm fine if we prefer to remove that TODO > > using this smaller change first :) > > Thanks. Can you also help review this patchset? The changes looks good > to me but I am not sure if I get all the details about swapcache handling. > > -- > Best Regards, > Yan, Zi Hello, Thanks for the reminder, I got a bit busy so delayed for a day on that RFC. For this series I think it's functionally fine, just the split logic is a bit complex to follow and we still have restriction on swap cache for order 0 uniform split only. I'll have a closer look later. Also let me know how you think about that RFC.