mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +00:00
mm/damon/core: remove duplicate list_empty quota->goals check
damos_set_effective_quota() checks quota contidions but there are some duplicate checks for quota->goals inside. This patch reduces one of if statement to simplify the esz calculation logic by setting esz as ULONG_MAX by default. Link: https://lkml.kernel.org/r/20241125184307.41746-1-sj@kernel.org Signed-off-by: Honggyu Kim <honggyu.kim@sk.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
45b47cd37b
commit
d58ca47b85
@ -1542,7 +1542,7 @@ static unsigned long damos_quota_score(struct damos_quota *quota)
|
||||
static void damos_set_effective_quota(struct damos_quota *quota)
|
||||
{
|
||||
unsigned long throughput;
|
||||
unsigned long esz;
|
||||
unsigned long esz = ULONG_MAX;
|
||||
|
||||
if (!quota->ms && list_empty("a->goals)) {
|
||||
quota->esz = quota->sz;
|
||||
@ -1564,10 +1564,7 @@ static void damos_set_effective_quota(struct damos_quota *quota)
|
||||
quota->total_charged_ns;
|
||||
else
|
||||
throughput = PAGE_SIZE * 1024;
|
||||
if (!list_empty("a->goals))
|
||||
esz = min(throughput * quota->ms, esz);
|
||||
else
|
||||
esz = throughput * quota->ms;
|
||||
esz = min(throughput * quota->ms, esz);
|
||||
}
|
||||
|
||||
if (quota->sz && quota->sz < esz)
|
||||
|
Loading…
Reference in New Issue
Block a user