mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
d91beaa505
To update DAMOS quota goals, users need to enter 'commit' command to the 'state' file of the kdamond, which applies not only the goals but entire inputs. It is inefficient. Implement yet another 'state' file input command for reading and committing only the scheme quota goals, namely 'commit_schemes_quota_goals'. Link: https://lkml.kernel.org/r/20231130023652.50284-5-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Brendan Higgins <brendanhiggins@google.com> Cc: David Gow <davidgow@google.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
62 lines
1.5 KiB
C
62 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Common Primitives for DAMON Sysfs Interface
|
|
*
|
|
* Author: SeongJae Park <sj@kernel.org>
|
|
*/
|
|
|
|
#include <linux/damon.h>
|
|
#include <linux/kobject.h>
|
|
|
|
extern struct mutex damon_sysfs_lock;
|
|
|
|
struct damon_sysfs_ul_range {
|
|
struct kobject kobj;
|
|
unsigned long min;
|
|
unsigned long max;
|
|
};
|
|
|
|
struct damon_sysfs_ul_range *damon_sysfs_ul_range_alloc(
|
|
unsigned long min,
|
|
unsigned long max);
|
|
void damon_sysfs_ul_range_release(struct kobject *kobj);
|
|
|
|
extern const struct kobj_type damon_sysfs_ul_range_ktype;
|
|
|
|
/*
|
|
* schemes directory
|
|
*/
|
|
|
|
struct damon_sysfs_schemes {
|
|
struct kobject kobj;
|
|
struct damon_sysfs_scheme **schemes_arr;
|
|
int nr;
|
|
};
|
|
|
|
struct damon_sysfs_schemes *damon_sysfs_schemes_alloc(void);
|
|
void damon_sysfs_schemes_rm_dirs(struct damon_sysfs_schemes *schemes);
|
|
|
|
extern const struct kobj_type damon_sysfs_schemes_ktype;
|
|
|
|
int damon_sysfs_set_schemes(struct damon_ctx *ctx,
|
|
struct damon_sysfs_schemes *sysfs_schemes);
|
|
|
|
void damon_sysfs_schemes_update_stats(
|
|
struct damon_sysfs_schemes *sysfs_schemes,
|
|
struct damon_ctx *ctx);
|
|
|
|
int damon_sysfs_schemes_update_regions_start(
|
|
struct damon_sysfs_schemes *sysfs_schemes,
|
|
struct damon_ctx *ctx, bool total_bytes_only);
|
|
|
|
bool damos_sysfs_regions_upd_done(void);
|
|
|
|
int damon_sysfs_schemes_update_regions_stop(struct damon_ctx *ctx);
|
|
|
|
int damon_sysfs_schemes_clear_regions(
|
|
struct damon_sysfs_schemes *sysfs_schemes,
|
|
struct damon_ctx *ctx);
|
|
|
|
void damos_sysfs_set_quota_scores(struct damon_sysfs_schemes *sysfs_schemes,
|
|
struct damon_ctx *ctx);
|