diff mbox series

[-next,v2] mm: zswap: update comment for struct zswap_entry

Message ID 20230808062056.292950-1-xiujianfeng@huaweicloud.com (mailing list archive)
State New
Headers show
Series [-next,v2] mm: zswap: update comment for struct zswap_entry | expand

Commit Message

Xiu Jianfeng Aug. 8, 2023, 6:20 a.m. UTC
From: Xiu Jianfeng <xiujianfeng@huawei.com>

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 <xiujianfeng@huawei.com>

---
v2: reword the comment
---
 mm/zswap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Yosry Ahmed Aug. 8, 2023, 6:37 a.m. UTC | #1
On Mon, Aug 7, 2023 at 11:22 PM Xiu Jianfeng
<xiujianfeng@huaweicloud.com> wrote:
>
> From: Xiu Jianfeng <xiujianfeng@huawei.com>
>
> 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 <xiujianfeng@huawei.com>

Reviewed-by: Yosry Ahmed <yosryahmed@google.com>

Thanks!

>
> ---
> v2: reword the comment
> ---
>  mm/zswap.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 5b56d38e7339..1e17f11a7896 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 - 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 that the compressed memory is charged to
>   * lru - handle to the pool's lru used to evict pages.
>   */
>  struct zswap_entry {
> --
> 2.34.1
>
>
Nhat Pham Aug. 8, 2023, 5:01 p.m. UTC | #2
On Mon, Aug 7, 2023 at 11:22 PM Xiu Jianfeng
<xiujianfeng@huaweicloud.com> wrote:
>
> From: Xiu Jianfeng <xiujianfeng@huawei.com>
>
> 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 <xiujianfeng@huawei.com>
>
> ---
> v2: reword the comment
> ---
>  mm/zswap.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 5b56d38e7339..1e17f11a7896 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 - 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 that the compressed memory is charged to
>   * lru - handle to the pool's lru used to evict pages.
>   */
>  struct zswap_entry {
> --
> 2.34.1
>
>

LGTM! Thanks for updating the comments.
Acked-by: Nhat Pham <nphamcs@gmail.com>
diff mbox series

Patch

diff --git a/mm/zswap.c b/mm/zswap.c
index 5b56d38e7339..1e17f11a7896 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 - 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 that the compressed memory is charged to
  * lru - handle to the pool's lru used to evict pages.
  */
 struct zswap_entry {