[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <153201627722.12295.11034132843390627757.stgit@localhost.localdomain>
Date: Thu, 19 Jul 2018 19:04:51 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: akpm@...ux-foundation.org, ktkhai@...tuozzo.com,
vdavydov.dev@...il.com, mhocko@...e.com,
penguin-kernel@...ove.SAKURA.ne.jp, shakeelb@...gle.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mm: Cleanup in do_shrink_slab()
Group long variables together to minimize number of occupied lines
and place all definitions in back Christmas tree order. Also,
simplify expression around batch_size: use all power of C language!
Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
---
mm/vmscan.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9918bfc1d2f9..636657213b9b 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -445,16 +445,11 @@ EXPORT_SYMBOL(unregister_shrinker);
static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
struct shrinker *shrinker, int priority)
{
- unsigned long freed = 0;
+ long total_scan, freeable, nr, new_nr, next_deferred, scanned = 0;
+ long batch_size = shrinker->batch ? : SHRINK_BATCH;
unsigned long long delta;
- long total_scan;
- long freeable;
- long nr;
- long new_nr;
int nid = shrinkctl->nid;
- long batch_size = shrinker->batch ? shrinker->batch
- : SHRINK_BATCH;
- long scanned = 0, next_deferred;
+ unsigned long freed = 0;
freeable = shrinker->count_objects(shrinker, shrinkctl);
if (freeable == 0 || freeable == SHRINK_EMPTY)
Powered by blists - more mailing lists