From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8632B2C21D9; Fri, 6 Feb 2026 03:15:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770347718; cv=none; b=aJQ1oWMQatpyKLDbiZEv2K67BA2KkG3tKbR1mbQL5UY9bFAPiAuS6V2Vki8+BBYTyrN0QO+nlcgkigee606zvn31iP52VOVgs3unDAyYrWInyqawlseRqJestfmT+KtQqi2FugyUMSpyAAhCFM8/SsbBRbEWMimgMoauw1xp06A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770347718; c=relaxed/simple; bh=uPXDqLDLtK0pqdFOgCp+rr9C19DDhLskCTGooJBdwTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eH1pV2LIr8WURLEl9B3Y8XWrely62+EI6XLUZsT6FMKRPgyjszY9CBGrUxfDAFJMeDgJ6s6IpiJ77Q5PxVTZhkaEBy52typn5Xhcrg7P5jRtyhv9Am31g+gr6FiD0fNLBBRnzuDs7DCw+8S8jHuc9j1qMpoRXTo8P6ocwsZ8SHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OdmgRg3q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OdmgRg3q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0F98C4CEF7; Fri, 6 Feb 2026 03:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770347718; bh=uPXDqLDLtK0pqdFOgCp+rr9C19DDhLskCTGooJBdwTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OdmgRg3qyn6J8aDsbqLaGp0YTTaluhiZhWbkHR3umhSBbE8aYtGUlHk/e/adSV9hW VkRWFb1ddniw7FTb+jOja5JusVe1kt63cNiVsMwknLtRRCRQ6apiwHp9HbeZivqfzV QHwRU4m05XBFBFW5uCuhh/x1oXdDQ2NMe9sF8BI7ax9S3W7rp944KLlnBccq4blXhZ ecX2zxqDsd403YnagGtHitK2eKdvWjCspHuoe1tSeiTulxdmSgVwhYpkTimAyqlV7u s+RU+pd7A4bcugMnk7Fjfk851NxzpT0KnjHdPWRO451TyVqifObRGPnCkAaxAJKjQo 74KzFLtsloFbQ== From: SeongJae Park To: "Jiayuan Chen" Cc: SeongJae Park , linux-mm@kvack.org, "Jiayuan Chen" , "Johannes Weiner" , "Michal Hocko" , "Roman Gushchin" , "Shakeel Butt" , "Muchun Song" , "Yosry Ahmed" , "Nhat Pham" , "Chengming Zhou" , "Andrew Morton" , "Nick Terrell" , "David Sterba" , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] mm: zswap: add per-memcg stat for incompressible pages Date: Thu, 5 Feb 2026 19:15:09 -0800 Message-ID: <20260206031509.68313-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 06 Feb 2026 02:47:58 +0000 "Jiayuan Chen" wrote: > February 6, 2026 at 10:21, "SeongJae Park" wrote: > > > > > > On Thu, 5 Feb 2026 13:30:12 +0800 Jiayuan Chen wrote: [...] > > > @@ -941,7 +941,7 @@ static bool zswap_decompress(struct zswap_entry *entry, struct folio *folio) > > > zs_obj_read_sg_begin(pool->zs_pool, entry->handle, input, entry->length); > > > > > > /* zswap entries of length PAGE_SIZE are not compressed. */ > > > - if (entry->length = PAGE_SIZE) { > > > + if (zswap_is_raw(entry->length)) { > > > WARN_ON_ONCE(input->length != PAGE_SIZE); > > > memcpy_from_sglist(kmap_local_folio(folio, 0), input, 0, PAGE_SIZE); > > > dlen = PAGE_SIZE; > > > > > Below this part, I show 'dlen = PAGE_SIZE'. Should it also be converted to > > use the helper function? > > > > The dlen variable represents the decompressed (plaintext) size. > Since we compress individual pages, the decompressed output should > always be PAGE_SIZE in normal cases. > > This check validates whether decompression produced the expected result, not whether the entry is incompressible. > > Using zswap_is_incomp() here would be semantically incorrect - the helper is meant to check if an > entry was stored without compression (i.e., compression failed to reduce size), while dlen = PAGE_SIZE > verifies the output of decompression is valid. You are right. Thank you for kindly correcting me. Thanks, SJ