mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: George Guo <dongtai.guo@linux.dev>
Cc: etsal@meta.com, changwoo@igalia.com, guodongtai@kylinos.cn,
	linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev,
	tj@kernel.org, void@manifault.com
Subject: Re: [PATCH 1/1] sched_ext: Add error logging for dsq creation failures
Date: Thu, 8 Jan 2026 07:25:41 +0100	[thread overview]
Message-ID: <aV9N5UxymrzJ9jSP@gpd4> (raw)
In-Reply-To: <20260108032328.85947-1-dongtai.guo@linux.dev>

Hi George,

On Thu, Jan 08, 2026 at 11:23:28AM +0800, George Guo wrote:
> Hi Etsal,
> Thanks for reviewing!
> 
> > While the change looks correct, is there any benefit to it?
> Yes, definitely. I found this issue while adding sched_ext support for
> LoongArch. When scx_bpf_create_dsq() failed during my development, there
> were no error messages at all, which made debugging difficult.
> 
> Specifically:
> 1. The failure was silent - no log, no error message in dmesg

Which kernel is that?

In theory you should get a clear message in dmesg. For example, if I try to
create an invalid DSQ in scx_simple I get this in dmesg:

  [690301.673313] sched_ext: BPF scheduler "simple" disabled (runtime error)
  [690301.673324] sched_ext: simple: ops.init() failed (-22)
  [690301.673327]    scx_enable.isra.0+0xc8b/0x11f0
  [690301.673343]    bpf_struct_ops_link_create+0x141/0x1b0
  [690301.673352]    __sys_bpf+0x1c0c/0x2de0
  [690301.673357]    __x64_sys_bpf+0x21/0x30
  [690301.673359]    do_syscall_64+0x81/0x820
  [690301.673368]    entry_SYSCALL_64_after_hwframe+0x76/0x7e

And in stdout:

DEBUG DUMP
================================================================================

scx_simple[364999] triggered exit kind 1024:
  runtime error (ops.init() failed (-22))

Backtrace:
  scx_enable.isra.0+0xc8b/0x11f0
  bpf_struct_ops_link_create+0x141/0x1b0
  __sys_bpf+0x1c0c/0x2de0
  __x64_sys_bpf+0x21/0x30
  do_syscall_64+0x81/0x820
  entry_SYSCALL_64_after_hwframe+0x76/0x7e

CPU states
----------

CPU 2   : nr_run=0 flags=0x1 cpu_rel=0 ops_qseq=87907495 pnt_seq=66861592
          curr=scx_simple[364999] class=fair_sched_class

CPU 3   : nr_run=0 flags=0x1 cpu_rel=0 ops_qseq=85461608 pnt_seq=64229201
          curr=pacman[364201] class=fair_sched_class

Event counters
--------------
              SCX_EV_SELECT_CPU_FALLBACK:                0
       SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE:                0
               SCX_EV_DISPATCH_KEEP_LAST:                0
                 SCX_EV_ENQ_SKIP_EXITING:                0
      SCX_EV_ENQ_SKIP_MIGRATION_DISABLED:                0
                 SCX_EV_REFILL_SLICE_DFL:                0
                  SCX_EV_BYPASS_DURATION:                0
                  SCX_EV_BYPASS_DISPATCH:                0
                  SCX_EV_BYPASS_ACTIVATE:                0

================================================================================

EXIT: runtime error (ops.init() failed (-22))

> 2. I had to add bpf_printk() temporarily to confirm it was dsq creation failing
> 
> So the benefit is improved debuggability and faster issue diagnosis.
> 
> Thanks!
> 

Thanks,
-Andrea

  reply	other threads:[~2026-01-08  6:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07  6:28 George Guo
2026-01-07 17:32 ` Emil Tsalapatis
2026-01-08  3:23   ` George Guo
2026-01-08  6:25     ` Andrea Righi [this message]
2026-01-09 10:02       ` George Guo

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=aV9N5UxymrzJ9jSP@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=dongtai.guo@linux.dev \
    --cc=etsal@meta.com \
    --cc=guodongtai@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.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

Powered by JetHome