[Devel] [PATCH RHEL7 COMMIT] ub: zap ub_reclaim_rate_limit
Konstantin Khorenko
khorenko at virtuozzo.com
Tue May 26 07:46:19 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.5
------>
commit 0c76a2a4e0e69827c118d5859001167ee231b925
Author: Vladimir Davydov <vdavydov at parallels.com>
Date: Tue May 26 18:46:19 2015 +0400
ub: zap ub_reclaim_rate_limit
This was used for throttling virtual swap in/out. We do not need it
anymore as we do not need virtual swap, because its functionality is now
implemented as a part of frontswap/tswap. If we want virtual swap in/out
throttling, we should add it to tswap.
Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
include/bc/beancounter.h | 10 ----------
kernel/bc/beancounter.c | 29 -----------------------------
2 files changed, 39 deletions(-)
diff --git a/include/bc/beancounter.h b/include/bc/beancounter.h
index 8e384f8..ea05b11 100644
--- a/include/bc/beancounter.h
+++ b/include/bc/beancounter.h
@@ -137,11 +137,6 @@ struct user_beancounter {
atomic_long_t wb_requests;
atomic_long_t wb_sectors;
- /* reclaim rate-limit */
- spinlock_t rl_lock;
- unsigned rl_step; /* ns per page */
- ktime_t rl_wall; /* wall time */
-
void *private_data2;
/* resources statistic and settings */
@@ -261,9 +256,6 @@ static inline void uncharge_beancounter(struct user_beancounter *ub,
int resource, unsigned long val) { }
#define uncharge_beancounter_fast uncharge_beancounter
-static inline void ub_reclaim_rate_limit(struct user_beancounter *ub,
- int wait, unsigned count) { }
-
#else /* CONFIG_BEANCOUNTERS */
extern struct list_head ub_list_head;
@@ -510,8 +502,6 @@ int precharge_beancounter(struct user_beancounter *ub,
int resource, unsigned long val);
void ub_precharge_snapshot(struct user_beancounter *ub, int *precharge);
-void ub_reclaim_rate_limit(struct user_beancounter *ub, int wait, unsigned count);
-
#define UB_IOPRIO_MIN 0
#define UB_IOPRIO_MAX 8
diff --git a/kernel/bc/beancounter.c b/kernel/bc/beancounter.c
index f17eb9e..f08402e 100644
--- a/kernel/bc/beancounter.c
+++ b/kernel/bc/beancounter.c
@@ -883,28 +883,6 @@ out:
}
EXPORT_SYMBOL(precharge_beancounter);
-void ub_reclaim_rate_limit(struct user_beancounter *ub, int wait, unsigned count)
-{
- ktime_t wall;
- u64 step;
-
- if (!ub->rl_step)
- return;
-
- spin_lock(&ub->rl_lock);
- step = (u64)ub->rl_step * count;
- wall = ktime_add_ns(ktime_get(), step);
- if (wall.tv64 < ub->rl_wall.tv64)
- wall = ktime_add_ns(ub->rl_wall, step);
- ub->rl_wall = wall;
- spin_unlock(&ub->rl_lock);
-
- if (wait && get_exec_ub() == ub && !test_thread_flag(TIF_MEMDIE)) {
- set_current_state(TASK_KILLABLE);
- schedule_hrtimeout(&wall, HRTIMER_MODE_ABS);
- }
-}
-
/*
* Initialization
*
@@ -924,8 +902,6 @@ static void init_beancounter_struct(struct user_beancounter *ub)
spin_lock_init(&ub->ub_lock);
INIT_LIST_HEAD(&ub->ub_tcp_sk_list);
INIT_LIST_HEAD(&ub->ub_other_sk_list);
- spin_lock_init(&ub->rl_lock);
- ub->rl_wall.tv64 = LLONG_MIN;
}
static void init_beancounter_nolimits(struct user_beancounter *ub)
@@ -944,9 +920,6 @@ static void init_beancounter_nolimits(struct user_beancounter *ub)
/* FIXME: set unlimited rate? */
ub->ub_ratelimit.burst = 4;
ub->ub_ratelimit.interval = 300*HZ;
-
- if (ub != get_ub0())
- ub->rl_step = NSEC_PER_SEC / 25600; /* 100 Mb/s */
}
static void init_beancounter_syslimits(struct user_beancounter *ub)
@@ -980,8 +953,6 @@ static void init_beancounter_syslimits(struct user_beancounter *ub)
ub->ub_ratelimit.burst = 4;
ub->ub_ratelimit.interval = 300*HZ;
-
- ub->rl_step = NSEC_PER_SEC / 25600; /* 100 Mb/s */
}
static DEFINE_PER_CPU(struct ub_percpu_struct, ub0_percpu);
More information about the Devel
mailing list