From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 E9F473446AB for ; Fri, 21 Nov 2025 11:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763725222; cv=none; b=H7bJg/nOjs8iLyaal+rwn+YiRgu0WIk6Xqhpl3SIgG/YJ5zxIa2a932X1pIZYJY5AJc0ULd7ZxcI3unc1yjXVfUHuApq5DlPt/72WGH31Cothb88arP6cmelBWISSIX8NIBG/YtpflkQkSFlLa4XQSA4srYI8D5kub7ptOsu9IA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763725222; c=relaxed/simple; bh=1SX1CeQkr8M3iLz42srH78h0bVONGYvqz544TgWbYRs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gJ+AulqhNWrJt0kZo67EjuymY9tIKy8xv0mBF7yh21zljXsN1XfzX2aQCaptz+TYt/Fev6FhqiCgdlfIcSyz4xIi6jnU3/RKO3QhU5ej2JWLaaPw8GPLqQa7tITDhLCs8dJocJk9Nratcn/adC1Sd86NOfOzgsqmvq2ud745lq8= 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=fa6jKAhz; arc=none smtp.client-ip=209.85.221.44 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="fa6jKAhz" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-42b31c610fcso1659682f8f.0 for ; Fri, 21 Nov 2025 03:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1763725217; x=1764330017; 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=Vhd0z5G/L7h7MLT55sYTaC/qxnDz9iOOGe9BsQAb9Os=; b=fa6jKAhzOzVUd+0KPqepmpq7IHnyo9w4p9OA/bmOphB+Ni2cbYRUizPZL+1/4KB+9e m77uO9a37P44rviCVKjJy/xVK84U+yncI92YnlgBtjdpRGWL1Ui7epyxWCPptSNspNIH xQAtwEZaMryqojW9EiDl//ynkIl1nzoQ+g9QsPjU78fbuijZqo5p82/UlDMXDtQ5tEJC pAaHIxL+jDJFP2WEv4twLvQXzS/I615ykOpP3bhh68aeZqErIZ1GDmlq0OCq48fGz8ol LzlJx93j9rzmf866Vuiwvo20aZdT9pVACAaD1JLBhMCIw1S8uAt76yBing5of6X+awMe UGmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763725217; x=1764330017; 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=Vhd0z5G/L7h7MLT55sYTaC/qxnDz9iOOGe9BsQAb9Os=; b=RY02J4WTCR1gsgWe2Uyg5KdP+Dw8ymthsCXofdMg9EVaRwSrEVtiagp7FQRr5xX45h OQNw/FdMEUiWgcdaW/wgRI/x44N6dFIXhqKGxw5xWIV3J8RPFslotyl3Ql7CULaeoVNn a40vGoDMFAQ6aOhr6SxfCww7ICu3KkfO3Umm938yeXqnT6Psy9LiPo+baqfnPV2Z7xxe 1LNsC6dxRNajtpfydDyAz6j7X/6zPqNgIi2PJirOM2Z4Bzj1EHjEyr93ZQ7BZJpxczFL y9/TfrjS3N5IoclAL5Qe84ZwGoKAHY1kg/CYrpVbE+TOiNyhqTZ4SMGUFAz20H/SADZL Jqiw== X-Forwarded-Encrypted: i=1; AJvYcCXZo+dd4nahSO+Gc28PcZxdN+wrQQxxFskABiWIc9ycVyDsyub1osHGjUG+vLCfBSnNocjpuMD8NlBbLm0=@vger.kernel.org X-Gm-Message-State: AOJu0YySbaqYop2Xs1aJ3l0A/1ba9GYusVERy6HNM/2XzqhV+pUkIpSG 9tUR/IXEqq8Dha2A42muLyg+TWSg3+DwPbokQLY2i5S0XsMiroTYzbEkE6m7SGP29NA= X-Gm-Gg: ASbGncvyIeodfHte2DdPoXw2Zoj73FBH/7wl8TEQeMvAr04PsKgpFw7MQcXtG+bwhoG T8p0N75n8zkuBLBM8Zzzic85MtxJQZgtF8EMvEblQCiRJxqOw2rz/eFNEKL3mQ/F+Oa4/j9Cj/a uzK6pOM/N89qYesrtepbnurzvJGIg8Gf9rCHFHoxRmrk6fJI9ioAYVlxKTRge9xuBrZlWwPmvAd zx8mYKplPt3IB/CUVYeWUjv3hzjCbcJDBuyX3yEh13i6+zQJAPcwBAk8Bfac7wNnPDqwrO90UXv AcQEcfEZarnBbfMMhO9PzhzNXClV4ebm7SEoqEn+H5G55SqEaAN9U7vBpXUwzPotP9D4FKz8JQ9 uEoovLbMlY7lI671n2OrojXIkDT8aU61MY98fHtJv2ksuLto7joR1kfaGXVlftSqB6oBD X-Google-Smtp-Source: AGHT+IEgsvla2icfCYM18HjMX7hO+ZfzwY8kLg+zvj18fqSOqNkdKKiBm7nhf0ttJREO7eB4OShiRA== X-Received: by 2002:a05:6000:2909:b0:42b:2c61:86f1 with SMTP id ffacd0b85a97d-42cc1d0cf81mr1931981f8f.35.1763725216785; Fri, 21 Nov 2025 03:40:16 -0800 (PST) Received: from localhost ([2620:10d:c092:600::1:610c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fd9b45sm10401328f8f.43.2025.11.21.03.40.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:40:15 -0800 (PST) Date: Fri, 21 Nov 2025 06:40:11 -0500 From: Johannes Weiner To: Chris Li Cc: Andrew Morton , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Yosry Ahmed , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org, pratmal@google.com, sweettea@google.com, gthelen@google.com, weixugc@google.com Subject: Re: [PATCH RFC] mm: ghost swapfile support for zswap Message-ID: <20251121114011.GA71307@cmpxchg.org> References: <20251121-ghost-v1-1-cfc0efcf3855@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: <20251121-ghost-v1-1-cfc0efcf3855@kernel.org> On Fri, Nov 21, 2025 at 01:31:43AM -0800, Chris Li wrote: > The current zswap requires a backing swapfile. The swap slot used > by zswap is not able to be used by the swapfile. That waste swapfile > space. > > The ghost swapfile is a swapfile that only contains the swapfile header > for zswap. The swapfile header indicate the size of the swapfile. There > is no swap data section in the ghost swapfile, therefore, no waste of > swapfile space. As such, any write to a ghost swapfile will fail. To > prevents accidental read or write of ghost swapfile, bdev of > swap_info_struct is set to NULL. Ghost swapfile will also set the SSD > flag because there is no rotation disk access when using zswap. Zswap is primarily a compressed cache for real swap on secondary storage. It's indeed quite important that entries currently in zswap don't occupy disk slots; but for a solution to this to be acceptable, it has to work with the primary usecase and support disk writeback. This direction is a dead-end. Please take a look at Nhat's swap virtualization patches. They decouple zswap from disk geometry, while still supporting writeback to an actual backend file. Nacked-by: Johannes Weiner