[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y/8TENp78WSQ0UW3@google.com>
Date: Wed, 1 Mar 2023 17:55:44 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Minchan Kim <minchan@...nel.org>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Yosry Ahmed <yosryahmed@...gle.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCHv2 3/6] zsmalloc: fine-grained inuse ratio based fullness
grouping
On (23/02/28 14:53), Minchan Kim wrote:
> BTW, I still prefer the enum instead of 10 define.
>
> enum fullness_group {
> ZS_EMPTY,
> ZS_INUSE_RATIO_MIN,
> ZS_INUSE_RATIO_ALMOST_FULL = 7,
> ZS_INUSE_RATIO_MAX = 10,
> ZS_FULL,
> NR_ZS_FULLNESS,
> }
For educational purposes, may I ask what do enums give us? We
always use integers - int:4 in zspage fullness, int for arrays
offsets and we cast to plain integers in get/set stats. So those
enums exist only at declaration point, and plain int otherwise.
What are the benefits over #defines?
Powered by blists - more mailing lists