From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (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 2D09733D6D6 for ; Thu, 23 Jul 2026 13:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784814000; cv=none; b=uSBsevyONd1vf71B5osXPCvVHTRgVm7FXPQ3uT6V3x+Fy80GOLWfrWr5wFepMURxmggUSC1iK35RkU5xc+ogwnKek3cyW5NBRmwTbbV9nOLJItTiBbqkUhQVwLwY5wptSMCNGaXJsHhgiHgexDWNrITzDAfptDCx+ggVRaQ0RQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784814000; c=relaxed/simple; bh=I8LhLJQGKlLzmSUfdTmlxio2Ouv1yW2nz0ZGC24SFaU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iy1HdLOaTo3/QtYjxuM/0Z6k5EtKpRSSOFhovh4KeMWD2ADc5YmzD+mLfg/DGGczhA3voDD4SkBzKuvW58Uqb/yGjCFKELVnhFN14L2BvUgzELV9gSFyJI5W1j+e4w3RUlwHZSF/nYoV11ejapxdWs6ULEwL2d4cuedmg1bQb/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=tUXLX/VJ; arc=none smtp.client-ip=209.85.160.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="tUXLX/VJ" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-52192509869so4760551cf.1 for ; Thu, 23 Jul 2026 06:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1784813994; x=1785418794; darn=vger.kernel.org; h=in-reply-to: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=5OXNEFjRCaitHQKe2wfBmPOWIET8WKaJvN/RgwCYDNw=; b=tUXLX/VJdwZmnyCn1KtQ4aINMkwFrSTzYVRnHJBscaYGWzw24DPCdrIHdahlmbebtK Ud0wBPD/AcW2AY9xBeO7Lqcn+0C5fPOroriMAEtQ6QFf4I/KPxm2pZW3V4lXM3fDnKba /Nb7E/XX4SGRLInI5Jtt9v7ef9GSEolxNxMi2/OpxdYUC6WbHfEXKh8ZkZCT0tkDq6US debzQy8BanKUVltY9opXvW8TzAsNgRg7POBZ+b0jpEFE2EuyMRXagHDVb8E5pGB05RyN ez6cgJMSjKE7GSq0naF0c4EXZaRljmpr6XcouVklCgnzDZ24vG2b2VjhZKYOh0OxCtfU 6X5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784813994; x=1785418794; h=in-reply-to: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=5OXNEFjRCaitHQKe2wfBmPOWIET8WKaJvN/RgwCYDNw=; b=lW89jP7+goVWC4aB7n/CEeaO3OVC22AEOl5f1qNhCCwnl7UjWpCdfEgp5zh+r2EUnh opdXEX9WA4tarLeWzInekd+GCtceQc0CNG6UYc8RGzI/AIqwbTD6eOEsYJSh1qhuVW2v M0lHfWDHlI3f6z+6nnbmLxiuGw4Cn8Ik45dKlRPTbQMtEf180wW535676vc49Z8esPAx yCXXP3NYSMWDsbRwc6uZVydK6JGNEZzV7ikL82+um9sKoOU2xWpe6hSp1Df+XgpoGnNh gp/OEJNk5m6JwmgjPxajLxayfJsqU3ikRfwrrxBiIRfb2sbRHk74g7ho97S9mJDEVuts XNBw== X-Forwarded-Encrypted: i=1; AHgh+RqaoyqsDlXKKubyJpyntQWqY8X+X52rvqAcg+aiRrd4XgRWiUgnW8ab5mdDH+39xWYHLif0HXYpJg5waTo=@vger.kernel.org X-Gm-Message-State: AOJu0YytHdQVBxCzT0jupToaJcdj7/iCihjCcyu6dizU3Fx3d3Y5sje8 CUN4EeYByOYDOtFzsNceHCEmKhhhZ4Hi9SOCwljQ8IV897Vu8mzRuoGQitJfTeN0EKM= X-Gm-Gg: AR+sD10ddvCItQ03deswLXQU7qpC3KLi6IjU3BC5hLGQ9ROhTv0V6Eo/ckEGkSdmldO 78LWVCn9cAWV5NCToE+fiILvsoXWD4w+VNq+TdJf4WBBT58EQ8WZRJk6Sk+OykomCtxBjq1chIH o3ENwvyvhfWSYBiTQyrb0j50zbJPq42cQ75nv0gWAK2RfP85lpFmxoJ8jmc9y2czv73UVQt2eQF xpia+fkFnDqNbzQhpe75+rKYU6SGRw1Or2U2AYxv8cSXJaIQxcX+K8Rk0Jd3adPs1kqYk+bqfyu he55zglYMzSb42AcHL+R4h8Gv/5JIDbv9ZFBF5xTAnbb7ZFjsxQvoAnutsT0vALoTUPkUQX0NCD x5PUiL5nzoYBPyvFoQq1gAc2ErXRbT16MNsMPCuYTHFilNj1oOJCuQTpe72BJXNy09YZQPzkykG E2 X-Received: by 2002:a05:622a:5906:b0:528:30e1:b5d3 with SMTP id d75a77b69052e-5283e0419fdmr25761861cf.84.1784813993716; Thu, 23 Jul 2026 06:39:53 -0700 (PDT) Received: from localhost ([2603:7001:f100:500:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-527d0c4ce60sm35155751cf.7.2026.07.23.06.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 06:39:52 -0700 (PDT) Date: Thu, 23 Jul 2026 09:39:51 -0400 From: Johannes Weiner To: Alexandre Ghiti Cc: Yosry Ahmed , Nhat Pham , Andrew Morton , Chris Li , Kairui Song , Chengming Zhou , "Matthew Wilcox (Oracle)" , Jan Kara , Kemeng Shi , Baoquan He , Barry Song , Youngjun Park , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/2] mm: zswap: free synchronous-IO writeback folios directly Message-ID: References: <20260718093723.153324-1-alex@ghiti.fr> <20260718093723.153324-2-alex@ghiti.fr> 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: <20260718093723.153324-2-alex@ghiti.fr> On Sat, Jul 18, 2026 at 11:36:39AM +0200, Alexandre Ghiti wrote: > @@ -972,6 +972,30 @@ static bool zswap_decompress(struct zswap_entry *entry, struct folio *folio) > /********************************* > * writeback code > **********************************/ > +static void zswap_writeback_free_folio(struct folio *folio) > +{ > + folio_lock(folio); > + > + /* The folio was allocated off the LRU and nothing re-adds it here. */ > + VM_WARN_ON_ONCE_FOLIO(folio_test_lru(folio), folio); > + > + /* > + * Gate remove_mapping() on folio_test_swapcache(): a racing swapin may > + * have freed the swap slot (folio_free_swap()) and dropped the folio from > + * the cache, and remove_mapping() must not run on a non-swapcache folio > + * (it would trip __remove_mapping()'s mapping == folio_mapping() check). > + */ > + if (folio_test_swapcache(folio) && > + remove_mapping(swap_address_space(folio->swap), folio)) I just chatted with Alexandre off-list, but this path does not store an eviction shadow like the reclaim path does. That means no refaults are detected from dropbehind pages, which can fundamentally alter reclaim decisions, zswap shrinker force, and pressure detection.