From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 40B16AD24 for ; Tue, 14 Jul 2026 10:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784023271; cv=none; b=Fc2KVdwBSU00mbOUwC9BvkLs7eYXBajU6i30FQ7RbEsz0ywQ0ZoplrkeTQ/8/qNZLXTqPddAvV8OjDnrz44qlZjwgo9Nh8YuTE3YnROcRad+yBBnOEuaYxoxboYTPSRlYjTvVwAiXowNSSdnUfMYTAv6uhmJ+6dN9XXobZzX8Wk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784023271; c=relaxed/simple; bh=rcjThy9+czymgfI7aGMnXaa/iC2HJhsTDb52eULp0/M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IxdoW9lZOYegKfGt5K1YfBaA3t+O1FFwiSI7DD9oofKMRKosGbMoXHymfffhf6higigC8ja21DR5osrZgD3qAILEqN+OMnWE5Zu5nppBIbK2pYT00F8PKRKdzHFFMRzdRiO3Givi+IMt08eYhALu0A2zvdDrmnouOFMzCuXiSmo= 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=WbTn73Ca; arc=none smtp.client-ip=95.215.58.189 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="WbTn73Ca" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784023267; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lSUnFP23E7MR4lFPLdnwHJ9sWUfwgVFYkHzPKHpXt/4=; b=WbTn73CaweoTDIlGnKps0gEHOLQxXacKRHGEFej6SBrTauU5zvpNnGlY3MKVEL8/krECxL 9x5oiBWoDl8b/FXsa0ic1eRT1XgSgSXh72DWoDHo3zd6t1WCZO6AUlmBTPdM0UE45FjnYK V5ion/OdhO/A/eMwVT8E+NOOwfnftk8= Date: Tue, 14 Jul 2026 11:00:42 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v4 04/11] mm: zswap: add range lookup for large-folio swapin To: Yosry Ahmed Cc: Andrew Morton , david@kernel.org, chrisl@kernel.org, kasong@tencent.com, ljs@kernel.org, ziy@nvidia.com, linux-mm@kvack.org, ying.huang@linux.alibaba.com, Baoquan He , willy@infradead.org, youngjun.park@lge.com, hannes@cmpxchg.org, riel@surriel.com, shakeel.butt@linux.dev, alex@ghiti.fr, kas@kernel.org, baohua@kernel.org, dev.jain@arm.com, baolin.wang@linux.alibaba.com, npache@redhat.com, "Liam R. Howlett" , ryan.roberts@arm.com, Vlastimil Babka , lance.yang@linux.dev, linux-kernel@vger.kernel.org, nphamcs@gmail.com, shikemeng@huaweicloud.com, kernel-team@meta.com, Alexandre Ghiti References: <20260713133613.2707815-1-usama.arif@linux.dev> <20260713133613.2707815-5-usama.arif@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Usama Arif In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 13/07/2026 17:55, Yosry Ahmed wrote: > On Mon, Jul 13, 2026 at 9:29 AM Usama Arif wrote: >> >> >> >> On 13/07/2026 17:02, Yosry Ahmed wrote: >>>> /** >>>> * zswap_load() - load a folio from zswap >>>> * @folio: folio to load >>>> @@ -1571,10 +1588,9 @@ bool zswap_store(struct folio *folio) >>>> * NOT marked up-to-date, so that an IO error is emitted (e.g. do_swap_page() >>>> * will SIGBUS). >>>> * >>>> - * -EINVAL: if the swapped out content was in zswap, but the page belongs >>>> - * to a large folio, which is not supported by zswap. The folio is unlocked, >>>> - * but NOT marked up-to-date, so that an IO error is emitted (e.g. >>>> - * do_swap_page() will SIGBUS). >>>> + * -EIO: if a slot in a large-folio range is unexpectedly still in zswap. >>>> + * The folio is unlocked, but NOT marked up-to-date, so that an IO >>>> + * error is emitted (e.g. do_swap_page() will SIGBUS). >>> >>> Just curious, why the change from -EINVAL to -EIO here? Does it matter >>> in practice or is it just a matter of personal taste? :) >> >> The caller only checks for != -ENOENT so no functional difference here. I viewed >> it as a change in semantic, -EINVAL meant that you passed a large folio, which >> wasn't supported to -EIO meaning the request is valid but zswap cannot safely >> complete a PMD-sized read from per-page compressed state. >> >> I dont want to speak for Alexandre, will let him comment on this properly :) >> But above is what I thought of when I got the patch from Alex. > > A mention of the reasoning in the changelog would be nice, even if > it's only semantic. Ack, Will add in next revision. Alexandre, let me know if there is something specific you prefer to add in the commit message, otherwise will add something similar to above.