mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Vernet <void@manifault.com>
To: Tejun Heo <tj@kernel.org>
Cc: Phil Auld <pauld@redhat.com>,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH sched_ext/for-6.12] sched_ext: Improve logging around enable/disable
Date: Thu, 8 Aug 2024 12:00:06 -0500	[thread overview]
Message-ID: <20240808170006.GB6223@maniforge> (raw)
In-Reply-To: <ZrQW4gqIr_hTgp0z@slm.duckdns.org>

[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]

On Wed, Aug 07, 2024 at 02:52:50PM -1000, Tejun Heo wrote:

Hi Tejun,

> sched_ext currently doesn't generate messages when the BPF scheduler is
> enabled and disabled unless there are errors. It is useful to have paper
> trail. Improve logging around enable/disable:
> 
> - Generate info messages on enable and non-error disable.
> 
> - Update error exit message formatting so that it's consistent with
>   non-error message. Also, prefix ei->msg with the BPF scheduler's name to
>   make it clear where the message is coming from.
> 
> - Shorten scx_exit_reason() strings for SCX_EXIT_UNREG* for brevity and
>   consistency.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Suggested-by: Phil Auld <pauld@redhat.com>
> ---
>  kernel/sched/ext.c |   21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 60a7eb7d8a9e..eea2fda8e099 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -4004,11 +4004,11 @@ static const char *scx_exit_reason(enum scx_exit_kind kind)
>  {
>  	switch (kind) {
>  	case SCX_EXIT_UNREG:
> -		return "Scheduler unregistered from user space";
> +		return "unregistered from user space";
>  	case SCX_EXIT_UNREG_BPF:
> -		return "Scheduler unregistered from BPF";
> +		return "unregistered from BPF";
>  	case SCX_EXIT_UNREG_KERN:
> -		return "Scheduler unregistered from the main kernel";
> +		return "unregistered from the main kernel";
>  	case SCX_EXIT_SYSRQ:
>  		return "disabled by sysrq-S";
>  	case SCX_EXIT_ERROR:
> @@ -4126,14 +4126,17 @@ static void scx_ops_disable_workfn(struct kthread_work *work)
>  	percpu_up_write(&scx_fork_rwsem);
>  
>  	if (ei->kind >= SCX_EXIT_ERROR) {
> -		printk(KERN_ERR "sched_ext: BPF scheduler \"%s\" errored, disabling\n", scx_ops.name);
> +		pr_err("sched_ext: BPF scheduler \"%s\" disabled (%s)\n",
> +		       scx_ops.name, ei->reason);
>  
> -		if (ei->msg[0] == '\0')
> -			printk(KERN_ERR "sched_ext: %s\n", ei->reason);
> -		else
> -			printk(KERN_ERR "sched_ext: %s (%s)\n", ei->reason, ei->msg);
> +		if (ei->msg[0] != '\0')
> +			printk(KERN_ERR "sched_ext: %s: %s\n",
> +			       scx_ops.name, ei->msg);

Was it intentional to use pr_err() above, and printk() here? If not,
let's make them consistent?

Looks good otherwise.

Acked-by: David Vernet <void@manifault.com>

Thanks,
David

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2024-08-08 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08  0:52 Tejun Heo
2024-08-08 12:38 ` Phil Auld
2024-08-08 17:00 ` David Vernet [this message]
2024-08-08 23:47 ` [PATCH v2 " Tejun Heo

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=20240808170006.GB6223@maniforge \
    --to=void@manifault.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pauld@redhat.com \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®