linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: brookxu <brookxu.cn@gmail.com>
Cc: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	vipinsh@google.com, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org
Subject: Re: [RFC PATCH 3/3] misc_cgroup: remove error log to avoid log flood
Date: Thu, 9 Sep 2021 16:37:20 +0200	[thread overview]
Message-ID: <20210909143720.GA14709@blackbody.suse.cz> (raw)
In-Reply-To: <86e89df640f2b4a65dd77bdbab8152fa8e8f5bf1.1631077837.git.brookxu@tencent.com>

On Wed, Sep 08, 2021 at 01:24:36PM +0800, brookxu <brookxu.cn@gmail.com> wrote:
> This log provides less information, we can get more detailed failure
> records through
> misc.events, misc.events.local and misc.failcnt.
> From this, perhaps we can remove it.

I hope: a) it's not used widely, b) no-one relies on parsing the
message so this is an acceptable change.

> @@ -157,13 +157,6 @@ int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg,
>  		new_usage = atomic_long_add_return(amount, &res->usage);
>  		if (new_usage > READ_ONCE(res->max) ||
>  		    new_usage > READ_ONCE(misc_res_capacity[type])) {
> -			if (!res->failed) {
> -				pr_info("cgroup: charge rejected by the misc controller for %s resource in ",
> -					misc_res_name[type]);
> -				pr_cont_cgroup_path(i->css.cgroup);
> -				pr_cont("\n");
> -				res->failed = true;
> -			}

`i` is the misc_cg whose limit was hit. In a sense, I think the current
implementation of the log message (before your patch) is not as useful
as it could be. The logged message here should not refer to `i` but `cg`
(i.e. the cgroup where the actual chargee resides). It's basically the
idea from [1].

So there could be two type of events (not referring to the v1-specific
failcnt):
- max - number of times the cgroup's misc.max was hit,
- fail - number of times operation failed (rejected) in the cgroup.

The former would tell you which limit is probably set too low, the
latter would capture which cgroup workload is affected. (The difference
would become apparent with >1 level deep hierarchies.)

Regards,
Michal

[1] https://lore.kernel.org/lkml/20191202191100.GF16681@devbig004.ftw2.facebook.com/


  reply	other threads:[~2021-09-09 14:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08  5:24 [RFC PATCH 1/3] misc_cgroup: introduce misc.events and misc_events.local brookxu
2021-09-08  5:24 ` [RFC PATCH 2/3] misc_cgroup: introduce misc.failcnt for V1 brookxu
2021-09-09 14:37   ` Michal Koutný
2021-09-08  5:24 ` [RFC PATCH 3/3] misc_cgroup: remove error log to avoid log flood brookxu
2021-09-09 14:37   ` Michal Koutný [this message]
2021-09-09 16:49     ` Vipin Sharma
2021-09-09 18:56       ` Michal Koutný
2021-09-10  5:30         ` brookxu
2021-09-10  9:23           ` Michal Koutný
2021-09-10 14:29             ` brookxu.cn
2021-09-10 15:36               ` Michal Koutný
2021-09-10 16:29                 ` Tejun Heo
2021-09-10 17:16                   ` Vipin Sharma
2021-09-10 17:19                     ` Tejun Heo
2021-09-10 17:31                       ` Vipin Sharma
2021-09-10 17:37                         ` Tejun Heo
2021-09-09 14:37 ` [RFC PATCH 1/3] misc_cgroup: introduce misc.events and misc_events.local Michal Koutný
2021-09-09 17:08   ` Vipin Sharma
2021-09-10  5:20     ` brookxu
2021-09-10 10:33       ` Michal Koutný
2021-09-10 16:32         ` Tejun Heo
2021-09-09 16:56 ` Vipin Sharma
2021-09-10  5:21   ` brookxu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210909143720.GA14709@blackbody.suse.cz \
    --to=mkoutny@suse.com \
    --cc=brookxu.cn@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=tj@kernel.org \
    --cc=vipinsh@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).