mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
blkcg: remove blkio_group->path[]
blkio_group->path[] stores the path of the associated cgroup and is used only for debug messages. Just format the path from blkg->cgroup when printing debug messages. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
c94bed8999
commit
54e7ed12ba
4 changed files with 36 additions and 14 deletions
|
@ -114,7 +114,6 @@ static struct blkio_group *blkg_alloc(struct blkio_cgroup *blkcg,
|
||||||
INIT_LIST_HEAD(&blkg->q_node);
|
INIT_LIST_HEAD(&blkg->q_node);
|
||||||
blkg->blkcg = blkcg;
|
blkg->blkcg = blkcg;
|
||||||
blkg->refcnt = 1;
|
blkg->refcnt = 1;
|
||||||
cgroup_path(blkcg->css.cgroup, blkg->path, sizeof(blkg->path));
|
|
||||||
|
|
||||||
for (i = 0; i < BLKCG_MAX_POLS; i++) {
|
for (i = 0; i < BLKCG_MAX_POLS; i++) {
|
||||||
struct blkio_policy_type *pol = blkio_policy[i];
|
struct blkio_policy_type *pol = blkio_policy[i];
|
||||||
|
|
|
@ -77,8 +77,6 @@ struct blkio_group {
|
||||||
struct list_head q_node;
|
struct list_head q_node;
|
||||||
struct hlist_node blkcg_node;
|
struct hlist_node blkcg_node;
|
||||||
struct blkio_cgroup *blkcg;
|
struct blkio_cgroup *blkcg;
|
||||||
/* Store cgroup path */
|
|
||||||
char path[128];
|
|
||||||
/* reference count */
|
/* reference count */
|
||||||
int refcnt;
|
int refcnt;
|
||||||
|
|
||||||
|
@ -167,9 +165,24 @@ static inline struct blkio_group *pdata_to_blkg(void *pdata)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline char *blkg_path(struct blkio_group *blkg)
|
/**
|
||||||
|
* blkg_path - format cgroup path of blkg
|
||||||
|
* @blkg: blkg of interest
|
||||||
|
* @buf: target buffer
|
||||||
|
* @buflen: target buffer length
|
||||||
|
*
|
||||||
|
* Format the path of the cgroup of @blkg into @buf.
|
||||||
|
*/
|
||||||
|
static inline int blkg_path(struct blkio_group *blkg, char *buf, int buflen)
|
||||||
{
|
{
|
||||||
return blkg->path;
|
int ret;
|
||||||
|
|
||||||
|
rcu_read_lock();
|
||||||
|
ret = cgroup_path(blkg->blkcg->css.cgroup, buf, buflen);
|
||||||
|
rcu_read_unlock();
|
||||||
|
if (ret)
|
||||||
|
strncpy(buf, "<unavailable>", buflen);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -155,9 +155,12 @@ static inline int throtl_tg_##name(const struct throtl_grp *tg) \
|
||||||
|
|
||||||
THROTL_TG_FNS(on_rr);
|
THROTL_TG_FNS(on_rr);
|
||||||
|
|
||||||
#define throtl_log_tg(td, tg, fmt, args...) \
|
#define throtl_log_tg(td, tg, fmt, args...) do { \
|
||||||
blk_add_trace_msg((td)->queue, "throtl %s " fmt, \
|
char __pbuf[128]; \
|
||||||
blkg_path(tg_to_blkg(tg)), ##args); \
|
\
|
||||||
|
blkg_path(tg_to_blkg(tg), __pbuf, sizeof(__pbuf)); \
|
||||||
|
blk_add_trace_msg((td)->queue, "throtl %s " fmt, __pbuf, ##args); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define throtl_log(td, fmt, args...) \
|
#define throtl_log(td, fmt, args...) \
|
||||||
blk_add_trace_msg((td)->queue, "throtl " fmt, ##args)
|
blk_add_trace_msg((td)->queue, "throtl " fmt, ##args)
|
||||||
|
|
|
@ -573,14 +573,21 @@ static inline void cfqg_put(struct cfq_group *cfqg)
|
||||||
return blkg_put(cfqg_to_blkg(cfqg));
|
return blkg_put(cfqg_to_blkg(cfqg));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \
|
#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) do { \
|
||||||
|
char __pbuf[128]; \
|
||||||
|
\
|
||||||
|
blkg_path(cfqg_to_blkg((cfqq)->cfqg), __pbuf, sizeof(__pbuf)); \
|
||||||
blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \
|
blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \
|
||||||
cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \
|
cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \
|
||||||
blkg_path(cfqg_to_blkg((cfqq)->cfqg)), ##args)
|
__pbuf, ##args); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) \
|
#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do { \
|
||||||
blk_add_trace_msg((cfqd)->queue, "%s " fmt, \
|
char __pbuf[128]; \
|
||||||
blkg_path(cfqg_to_blkg((cfqg))), ##args) \
|
\
|
||||||
|
blkg_path(cfqg_to_blkg(cfqg), __pbuf, sizeof(__pbuf)); \
|
||||||
|
blk_add_trace_msg((cfqd)->queue, "%s " fmt, __pbuf, ##args); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg,
|
static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg,
|
||||||
struct cfq_group *curr_cfqg, int rw)
|
struct cfq_group *curr_cfqg, int rw)
|
||||||
|
|
Loading…
Reference in a new issue