From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAE21C001B0 for ; Tue, 8 Aug 2023 06:27:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D30F6B0071; Tue, 8 Aug 2023 02:27:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 482BB6B0074; Tue, 8 Aug 2023 02:27:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 349CE8D0001; Tue, 8 Aug 2023 02:27:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2555D6B0071 for ; Tue, 8 Aug 2023 02:27:04 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D9331405F1 for ; Tue, 8 Aug 2023 06:27:03 +0000 (UTC) X-FDA: 81099954726.29.555BCFA Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf13.hostedemail.com (Postfix) with ESMTP id 3659C20010 for ; Tue, 8 Aug 2023 06:26:57 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691476022; h=from:from:sender: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=9TnjOMt0LBs3be6cTtEJDHBJh2hUTd3J8B9tI83Vv1o=; b=0NNkn6LshMdMiBBvDEq7Ezab/jVqcltxPYORgJf5D83OtehjkjkGudsx4Gulg2Ji6Jxlyi 2V5OYccrluQkKS/hjQ8/k6LVUKb88Glg4ORt3dQIPJ4gTdc5WCxrzl0O7GXfIhpg5avsYW akqOS5zXtw+BStSMIFvCD51Ep3eAxZ0= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691476022; a=rsa-sha256; cv=none; b=QZosyqZ/+W7gsUoy2kwc9crGiH5nhOuld8bKC3bES0OFPHXkUQoGvc5qA5Di/yE5i2Wc3X WNUahdO0Ilm7odULOZLhMUAhEMMn6wTRxl80KlUd8l4yLWDQJThsadQpTa7sDSmcgU/Tzd LSVwjrZ9RpOPOtdOK7X8z7vp5z+t09g= Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RKjqP3sLZzrSFp; Tue, 8 Aug 2023 14:25:37 +0800 (CST) Received: from [10.67.110.112] (10.67.110.112) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 14:26:47 +0800 Message-ID: <62f24e5d-195f-411b-26f9-9f0b92bd0406@huawei.com> Date: Tue, 8 Aug 2023 14:26:47 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH -next] mm: zswap: update comment for struct zswap_entry Content-Language: en-US To: Yosry Ahmed , Xiu Jianfeng CC: , , , , References: <20230808024714.292048-1-xiujianfeng@huaweicloud.com> From: xiujianfeng In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.112] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 3659C20010 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: u7znbu7w1wr1mjsshncejeuqs86fnndz X-HE-Tag: 1691476017-441693 X-HE-Meta: U2FsdGVkX18k1GMSoixRG/U0Ch7s+IxvPI/UcacQtyY1o0Gjgk1ZXWcHF4jrMU9J8fCAySZD5RSuPMx/UU9vv3g8ibNsIIM+I7tcUMylOhgRt4bQFirGS0UZZMd4n5ygnkw3/nIRruxRZosxDEs+SbzGCO+GnbmY+ofm75GbEvDSgBvd3f5/UT0bAZo46AQ8q554ydRKHWNbDOdYtjNPpMButVKOp5hxCikclBckbdNS5dizk6kRIrDlT6wz+S+AQsC8/IX6pSZryvmFanLtsEa0PrAA/Qs1xif4NAb3ASJYcSYvhmWWiAgEPYLchG25jJyKufgtOJRuY79R8Pa8VEP+jRzry5NPp/2H1y+JOrnATujAyi117zQPOzX73qq39DGoEUWhAeAR6K9qFsvlH8mt3UcqEVpFP88L+m5bHiJRRKRiI+i5DmU8fh563q6AzTPTDmcW9OnPuKJILvwztOP+43c5DxCKMWfrXricLCTxpYBX99eDX/VZEjKq/98TjsevO35UGHPfRHZhCBvug8vGWIFysa732NNCj2NPNWmfGvHvPPCX3QgMDsOx9PS/7tXHRYIxpXBQUAePiG3wxQTa6fVEv7kLeg6WjtAp9rkzGymjLzKT0U04Y51JM8rAa6bJ7PCinCZPN9Up+VkQ+0OfcRlt8KWorrTxcdQvnyp29Phto+3NtCvkRzB1erRqZOT5FOShgfKkAlLopHNxAuGky2XOv+tDtqGmd9EXowr8UvYVVb/Xux8A16P/TG+CeqIWMJQ2+3FTwg0WPIvyOsThLRYUg0Q+uodgAQ1Uu0wS0kPYhFiJB76GavProRgX8tn7ljQ5pkciYhhXVwjHDyIxTeiOGcT90rOMedCwSiRGniOX2RCvkFaZUlxL/TpoGvPN0UBt+AOdbDJioV0gVbavuGO4Wv4bNLUFUJ48AYEgaRPJLavjsV4VYhnE/8kg8Tc1cPwcJKyvfooc8Jv pbuvNM1+ qk4QuUF5ZZRVGMxgcwv72XDAW2NvJj4+sWmPtHCMeqdK7F96mbePjEipMfiSsvzWIJFsGkKDAxpONTWh1aAIc/kYAHHnRVuX2PB0gyZ0u4C79yQwfqR/FTSgw6D0TdIi1EVi4CKXkOke12xutlwQx+GJdkWRg7fvlQN6/I2ILbnEaCjdIEQuQGVoI1rA5rhJHKHhmOHf34Pr5xCXTrsKFQ29H5WpK1O7wycLXGOb3HY1gRBDRQGgWV+1m0DT3rS4aoaXMNrXxRmowN8k= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Yosry, On 2023/8/8 13:59, Yosry Ahmed wrote: > Hi Xiu, > > On Mon, Aug 7, 2023 at 7:49 PM Xiu Jianfeng wrote: >> >> From: Xiu Jianfeng >> >> Since commit 0bb488498c98 ("mm: zswap: remove zswap_header"), the >> 'offset' has been replaced by swpentry, update the comment for it, >> and also add comment for 'objcg'. >> >> Signed-off-by: Xiu Jianfeng >> --- >> mm/zswap.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/mm/zswap.c b/mm/zswap.c >> index 5b56d38e7339..d7863c139c82 100644 >> --- a/mm/zswap.c >> +++ b/mm/zswap.c >> @@ -182,7 +182,7 @@ struct zswap_pool { >> * page within zswap. >> * >> * rbnode - links the entry into red-black tree for the appropriate swap type >> - * offset - the swap offset for the entry. Index into the red-black tree. >> + * swpentry - the swap entry for the entry, include 'type' and 'offset' fields > > > This is not the place to document that a swap entry has 'type' and > 'offset' fields. > > I would also avoid the repetitive 'entry'. Maybe something like: > swpentry - associated swap entry, the offset indexes into the red-black tree > >> >> * refcount - the number of outstanding reference to the entry. This is needed >> * to protect against premature freeing of the entry by code >> * concurrent calls to load, invalidate, and writeback. The lock >> @@ -195,6 +195,7 @@ struct zswap_pool { >> * pool - the zswap_pool the entry's data is in >> * handle - zpool allocation handle that stores the compressed page data >> * value - value of the same-value filled pages which have same content >> + * objcg - the obj_cgroup(actually memcg) this entry belongs to > > > Again, not the place to document that objcg is an abstraction layer > above a memcg. > > I would do something like: > objcg - the obj_cgroup that the compressed memory is charged to Thanks for your review, I've just sent out the v2 patch. > >> >> * lru - handle to the pool's lru used to evict pages. >> */ >> struct zswap_entry { >> -- >> 2.34.1 >> >>