lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240618031751.3470464-2-yukuai1@huaweicloud.com>
Date: Tue, 18 Jun 2024 11:17:45 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: axboe@...nel.dk,
	tj@...nel.org,
	gregkh@...uxfoundation.org,
	bvanassche@....org,
	hch@...radead.org,
	josef@...icpanda.com,
	lizefan.x@...edance.com,
	hannes@...xchg.org
Cc: linux-block@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	cgroups@...r.kernel.org,
	yukuai3@...wei.com,
	yukuai1@...weicloud.com,
	yi.zhang@...wei.com,
	yangerkun@...wei.com
Subject: [PATCH RFC v2 1/7] blk-cgroup: add a new helper pr_cont_blkg_path()

From: Yu Kuai <yukuai3@...wei.com>

To print blkg path in iocost, and prepare to build iocost as kernel
module.

Signed-off-by: Yu Kuai <yukuai3@...wei.com>
---
 block/blk-cgroup.c | 6 ++++++
 block/blk-cgroup.h | 1 +
 block/blk-iocost.c | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 37e6cc91d576..4da70fc7775e 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -2196,5 +2196,11 @@ bool blk_cgroup_congested(void)
 	return ret;
 }
 
+void pr_cont_blkg_path(struct blkcg_gq *blkg)
+{
+	return pr_cont_cgroup_path(blkg->blkcg->css.cgroup);
+}
+EXPORT_SYMBOL_GPL(pr_cont_blkg_path);
+
 module_param(blkcg_debug_stats, bool, 0644);
 MODULE_PARM_DESC(blkcg_debug_stats, "True if you want debug stats, false if not");
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 90b3959d88cf..25833221a12b 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -220,6 +220,7 @@ int blkg_conf_open_bdev(struct blkg_conf_ctx *ctx);
 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
 		   struct blkg_conf_ctx *ctx);
 void blkg_conf_exit(struct blkg_conf_ctx *ctx);
+void pr_cont_blkg_path(struct blkcg_gq *blkg);
 
 /**
  * bio_issue_as_root_blkg - see if this bio needs to be issued as root blkg
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 690ca99dfaca..ca72a62bc9c0 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -1954,7 +1954,7 @@ static void transfer_surpluses(struct list_head *surpluses, struct ioc_now *now)
 				 iocg->hweight_donating <= 1 ||
 				 iocg->hweight_after_donation == 0)) {
 			pr_warn("iocg: invalid donation weights in ");
-			pr_cont_cgroup_path(iocg_to_blkg(iocg)->blkcg->css.cgroup);
+			pr_cont_blkg_path(iocg_to_blkg(iocg));
 			pr_cont(": active=%u donating=%u after=%u\n",
 				iocg->hweight_active, iocg->hweight_donating,
 				iocg->hweight_after_donation);
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ