mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
UPSTREAM: cgroup: remove cgroup_rstat_flush_atomic()
Previous patches removed the only caller of cgroup_rstat_flush_atomic().
Remove the function and simplify the code.
Link: https://lkml.kernel.org/r/20230421174020.2994750-6-yosryahmed@google.com
Change-Id: I28939a92d4dcc6b8ad03dfaf7243e6d2b6af9100
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 0a2dc6ac33)
Bug: 322544714
Signed-off-by: T.J. Mercier <tjmercier@google.com>
This commit is contained in:
committed by
T.J. Mercier
parent
b5b6e46444
commit
7e96f2bfaa
@@ -767,7 +767,6 @@ static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
|
||||
*/
|
||||
void cgroup_rstat_updated(struct cgroup *cgrp, int cpu);
|
||||
void cgroup_rstat_flush(struct cgroup *cgrp);
|
||||
void cgroup_rstat_flush_atomic(struct cgroup *cgrp);
|
||||
void cgroup_rstat_flush_hold(struct cgroup *cgrp);
|
||||
void cgroup_rstat_flush_release(void);
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ __weak noinline void bpf_rstat_flush(struct cgroup *cgrp,
|
||||
__diag_pop();
|
||||
|
||||
/* see cgroup_rstat_flush() */
|
||||
static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep)
|
||||
static void cgroup_rstat_flush_locked(struct cgroup *cgrp)
|
||||
__releases(&cgroup_rstat_lock) __acquires(&cgroup_rstat_lock)
|
||||
{
|
||||
int cpu;
|
||||
@@ -207,9 +207,8 @@ static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep)
|
||||
}
|
||||
raw_spin_unlock_irqrestore(cpu_lock, flags);
|
||||
|
||||
/* if @may_sleep, play nice and yield if necessary */
|
||||
if (may_sleep && (need_resched() ||
|
||||
spin_needbreak(&cgroup_rstat_lock))) {
|
||||
/* play nice and yield if necessary */
|
||||
if (need_resched() || spin_needbreak(&cgroup_rstat_lock)) {
|
||||
spin_unlock_irq(&cgroup_rstat_lock);
|
||||
if (!cond_resched())
|
||||
cpu_relax();
|
||||
@@ -236,25 +235,10 @@ void cgroup_rstat_flush(struct cgroup *cgrp)
|
||||
might_sleep();
|
||||
|
||||
spin_lock_irq(&cgroup_rstat_lock);
|
||||
cgroup_rstat_flush_locked(cgrp, true);
|
||||
cgroup_rstat_flush_locked(cgrp);
|
||||
spin_unlock_irq(&cgroup_rstat_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* cgroup_rstat_flush_atomic- atomic version of cgroup_rstat_flush()
|
||||
* @cgrp: target cgroup
|
||||
*
|
||||
* This function can be called from any context.
|
||||
*/
|
||||
void cgroup_rstat_flush_atomic(struct cgroup *cgrp)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&cgroup_rstat_lock, flags);
|
||||
cgroup_rstat_flush_locked(cgrp, false);
|
||||
spin_unlock_irqrestore(&cgroup_rstat_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* cgroup_rstat_flush_hold - flush stats in @cgrp's subtree and hold
|
||||
* @cgrp: target cgroup
|
||||
@@ -269,7 +253,7 @@ void cgroup_rstat_flush_hold(struct cgroup *cgrp)
|
||||
{
|
||||
might_sleep();
|
||||
spin_lock_irq(&cgroup_rstat_lock);
|
||||
cgroup_rstat_flush_locked(cgrp, true);
|
||||
cgroup_rstat_flush_locked(cgrp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user