• [gentoo-user] Activating BMQ CPU Scheduler

    From Nikos Chantziaras@21:1/5 to All on Wed Apr 26 18:20:02 2023
    So I wanted to try the BMQ scheduler in gentoo-sources. Is just enabling
    it in the kernel build all that's needed? I did so, booted, and:

    $ dmesg | grep -i bmq
    [ 0.100284] sched/bmq: BMQ CPU Scheduler v6.1-r4 by Alfred Chen.

    That's all and it's in use now? Or do I need to toggle anything else?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Holger_Hoffst=c3=a4tte?=@21:1/5 to Nikos Chantziaras on Wed Apr 26 22:10:01 2023
    On 2023-04-26 18:15, Nikos Chantziaras wrote:
    So I wanted to try the BMQ scheduler in gentoo-sources. Is just enabling it in the kernel build all that's needed? I did so, booted, and:

      $ dmesg | grep -i bmq
      [    0.100284] sched/bmq: BMQ CPU Scheduler v6.1-r4 by Alfred Chen.

    That's all and it's in use now? Or do I need to toggle anything else?

    That's all you need to do, right. You can slso alternatively switch to PDS under
    the "General setup > Scheduler features" kernel-config menu, which is slightly better
    for throughput and "more correct" when many tasks have varying priorities - beefy
    workstation or server.
    BMQ is kind of simplistic (in an elegant way), but that's why it is so effective
    for low-end systems and desktops.
    Run iperf3 over loopback (i.e. both server and client) to see the difference.

    cheers
    Holger

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nikos Chantziaras@21:1/5 to All on Mon May 1 22:30:01 2023
    On 26/04/2023 23:06, Holger Hoffstätte wrote:
    On 2023-04-26 18:15, Nikos Chantziaras wrote:
    So I wanted to try the BMQ scheduler in gentoo-sources. Is just
    enabling it in the kernel build all that's needed? I did so, booted, and:

       $ dmesg | grep -i bmq
       [    0.100284] sched/bmq: BMQ CPU Scheduler v6.1-r4 by Alfred Chen. >>
    That's all and it's in use now? Or do I need to toggle anything else?

    That's all you need to do, right. You can slso alternatively switch to
    PDS under
    the "General setup > Scheduler features" kernel-config menu, which is slightly better
    for throughput and "more correct" when many tasks have varying
    priorities - beefy
    workstation or server.
    BMQ is kind of simplistic (in an elegant way), but that's why it is so effective
    for low-end systems and desktops.
    Run iperf3 over loopback (i.e. both server and client) to see the
    difference.

    Switched back to the default (called "CFS" I think.)

    BMQ has severe issues. When emerging something while I play a game
    (either native or through wine-proton,) there's long lag spikes and
    freezes. Even worse, there's bugs like the system completely hanging on shutdown, or "umount" hanging with 100% CPU use by two kernel threads.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Holger_Hoffst=c3=a4tte?=@21:1/5 to Nikos Chantziaras on Tue May 2 09:00:01 2023
    On 2023-05-01 22:24, Nikos Chantziaras wrote:
    On 26/04/2023 23:06, Holger Hoffstätte wrote:
    On 2023-04-26 18:15, Nikos Chantziaras wrote:
    So I wanted to try the BMQ scheduler in gentoo-sources. Is just
    enabling it in the kernel build all that's needed? I did so,
    booted, and:

    $ dmesg | grep -i bmq [ 0.100284] sched/bmq: BMQ CPU Scheduler
    v6.1-r4 by Alfred Chen.

    That's all and it's in use now? Or do I need to toggle anything
    else?

    That's all you need to do, right. You can slso alternatively switch
    to PDS under the "General setup > Scheduler features" kernel-config
    menu, which is slightly better for throughput and "more correct"
    when many tasks have varying priorities - beefy workstation or
    server. BMQ is kind of simplistic (in an elegant way), but that's
    why it is so effective for low-end systems and desktops. Run iperf3
    over loopback (i.e. both server and client) to see the difference.

    Switched back to the default (called "CFS" I think.)

    BMQ has severe issues. When emerging something while I play a game
    (either native or through wine-proton,) there's long lag spikes and
    freezes. Even worse, there's bugs like the system completely hanging
    on shutdown, or "umount" hanging with 100% CPU use by two kernel
    threads.

    Can you try booting with psi=0 and check if that helps? There's a known
    bad interaction with the PSI (Pressure Stall Information) mechanism,
    which is active by default in many kernel configs. The latest version
    of the BMQ patch makes sure to turn it off, you may not have that version
    yet. BMQ (and PDS) works fine and has done so for quite a while.

    -h

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexe Stefan@21:1/5 to All on Tue May 2 13:50:01 2023
    What scheduler produces the best results on regular desktop systems?

    mar., 2 mai 2023, 09:54 Holger Hoffstätte <holger@applied-asynchrony.com> a scris:

    On 2023-05-01 22:24, Nikos Chantziaras wrote:
    On 26/04/2023 23:06, Holger Hoffstätte wrote:
    On 2023-04-26 18:15, Nikos Chantziaras wrote:
    So I wanted to try the BMQ scheduler in gentoo-sources. Is just
    enabling it in the kernel build all that's needed? I did so,
    booted, and:

    $ dmesg | grep -i bmq [ 0.100284] sched/bmq: BMQ CPU Scheduler
    v6.1-r4 by Alfred Chen.

    That's all and it's in use now? Or do I need to toggle anything
    else?

    That's all you need to do, right. You can slso alternatively switch
    to PDS under the "General setup > Scheduler features" kernel-config
    menu, which is slightly better for throughput and "more correct"
    when many tasks have varying priorities - beefy workstation or
    server. BMQ is kind of simplistic (in an elegant way), but that's
    why it is so effective for low-end systems and desktops. Run iperf3
    over loopback (i.e. both server and client) to see the difference.

    Switched back to the default (called "CFS" I think.)

    BMQ has severe issues. When emerging something while I play a game
    (either native or through wine-proton,) there's long lag spikes and freezes. Even worse, there's bugs like the system completely hanging
    on shutdown, or "umount" hanging with 100% CPU use by two kernel
    threads.

    Can you try booting with psi=0 and check if that helps? There's a known
    bad interaction with the PSI (Pressure Stall Information) mechanism,
    which is active by default in many kernel configs. The latest version
    of the BMQ patch makes sure to turn it off, you may not have that version yet. BMQ (and PDS) works fine and has done so for quite a while.

    -h



    <div dir="auto">What scheduler produces the best results on regular desktop systems?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">mar., 2 mai 2023, 09:54 Holger Hoffstätte &lt;<a href="mailto:holger@applied-asynchrony.com">holger@
    applied-asynchrony.com</a>&gt; a scris:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2023-05-01 22:24, Nikos Chantziaras wrote:<br>
    &gt; On 26/04/2023 23:06, Holger Hoffstätte wrote:<br>
    &gt;&gt; On 2023-04-26 18:15, Nikos Chantziaras wrote:<br>
    &gt;&gt;&gt; So I wanted to try the BMQ scheduler in gentoo-sources. Is just<br>
    &gt;&gt;&gt; enabling it in the kernel build all that&#39;s needed? I did so,<br>
    &gt;&gt;&gt; booted, and:<br>
    &gt;&gt;&gt; <br>
    &gt;&gt;&gt; $ dmesg | grep -i bmq [    0.100284] sched/bmq: BMQ CPU Scheduler<br>
    &gt;&gt;&gt; v6.1-r4 by Alfred Chen.<br>
    &gt;&gt;&gt; <br>
    &gt;&gt;&gt; That&#39;s all and it&#39;s in use now? Or do I need to toggle anything<br>
    &gt;&gt;&gt; else?<br>
    &gt;&gt; <br>
    &gt;&gt; That&#39;s all you need to do, right. You can slso alternatively switch<br>
    &gt;&gt; to PDS under the &quot;General setup &gt; Scheduler features&quot; kernel-config<br>
    &gt;&gt; menu, which is slightly better for throughput and &quot;more correct&quot;<br>
    &gt;&gt; when many tasks have varying priorities - beefy workstation or<br> &gt;&gt; server. BMQ is kind of simplistic (in an elegant way), but that&#39;s<br>
    &gt;&gt; why it is so effective for low-end systems and desktops. Run iperf3<br>
    &gt;&gt; over loopback (i.e. both server and client) to see the difference.<br> &gt; <br>
    &gt; Switched back to the default (called &quot;CFS&quot; I think.)<br>
    &gt; <br>
    &gt; BMQ has severe issues. When emerging something while I play a game<br> &gt; (either native or through wine-proton,) there&#39;s long lag spikes and<br>
    &gt; freezes. Even worse, there&#39;s bugs like the system completely hanging<br>
    &gt; on shutdown, or &quot;umount&quot; hanging with 100% CPU use by two kernel<br>
    &gt; threads.<br>

    Can you try booting with psi=0 and check if that helps? There&#39;s a known<br> bad interaction with the PSI (Pressure Stall Information) mechanism,<br>
    which is active by default in many kernel configs. The latest version<br>
    of the BMQ patch makes sure to turn it off, you may not have that version<br> yet. BMQ (and PDS) works fine and has done so for quite a while.<br>

    -h<br>

    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nikos Chantziaras@21:1/5 to All on Tue May 2 21:20:01 2023
    On 02/05/2023 09:53, Holger Hoffstätte wrote:
    [...]
    Switched back to the default (called "CFS" I think.)

    BMQ has severe issues. When emerging something while I play a game
    (either native or through wine-proton,) there's long lag spikes and
    freezes. Even worse, there's bugs like the system completely hanging
    on shutdown, or "umount" hanging with 100% CPU use by two kernel
    threads.

    Can you try booting with psi=0 and check if that helps? There's a known
    bad interaction with the PSI (Pressure Stall Information) mechanism,
    which is active by default in many kernel configs. The latest version
    of the BMQ patch makes sure to turn it off, you may not have that version yet. BMQ (and PDS) works fine and has done so for quite a while.

    Will have to rebuild again. Does that work on 6.1 kernels? (I only use
    LTS nowadays.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Holger_Hoffst=c3=a4tte?=@21:1/5 to Nikos Chantziaras on Wed May 3 19:20:01 2023
    On 2023-05-02 21:19, Nikos Chantziaras wrote:
    On 02/05/2023 09:53, Holger Hoffstätte wrote:
    [...]
    Switched back to the default (called "CFS" I think.)

    BMQ has severe issues. When emerging something while I play a game
    (either native or through wine-proton,) there's long lag spikes and
    freezes. Even worse, there's bugs like the system completely hanging
    on shutdown, or "umount" hanging with 100% CPU use by two kernel
    threads.

    Can you try booting with psi=0 and check if that helps? There's a known
    bad interaction with the PSI (Pressure Stall Information) mechanism,
    which is active by default in many kernel configs. The latest version
    of the BMQ patch makes sure to turn it off, you may not have that version
    yet. BMQ (and PDS) works fine and has done so for quite a while.

    Will have to rebuild again. Does that work on 6.1 kernels? (I only use LTS nowadays.)

    Check first if you had CONFIG_PSI enabled. The setting will work in any case, but if you already had it disabled/missing then there's no need to try again.

    cheers
    Holger

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nikos Chantziaras@21:1/5 to All on Sat May 6 14:10:01 2023
    On 03/05/2023 20:11, Holger Hoffstätte wrote:
    On 2023-05-02 21:19, Nikos Chantziaras wrote:
    On 02/05/2023 09:53, Holger Hoffstätte wrote:
    [...]
    BMQ has severe issues. When emerging something while I play a game
    (either native or through wine-proton,) there's long lag spikes and
    freezes. Even worse, there's bugs like the system completely hanging
    on shutdown, or "umount" hanging with 100% CPU use by two kernel
    threads.
    [...]

    Check first if you had CONFIG_PSI enabled. The setting will work in any
    case,
    but if you already had it disabled/missing then there's no need to try
    again.

    It was enabled so now I disabled it. I'm not even sure why it was
    enabled in the first place, it sounds useless and is documented as "Say
    N if not sure." Haven't had any issues to far.

    The main thing I was hoping BMQ might be able to fix is the short sound
    dropout when seeking in MPV. Meaning sound dropping out in other
    applications while seeking in a video in MPV. And guess what, it indeed
    fixes it. I had similar audio issues many years ago, and back then BFQ
    was able to fix them.

    Thanks for the help!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Holger_Hoffst=c3=a4tte?=@21:1/5 to Nikos Chantziaras on Sat May 6 16:50:01 2023
    On 2023-05-06 14:07, Nikos Chantziaras wrote:
    On 03/05/2023 20:11, Holger Hoffstätte wrote:
    On 2023-05-02 21:19, Nikos Chantziaras wrote:
    On 02/05/2023 09:53, Holger Hoffstätte wrote:
    [...] BMQ has severe issues. When emerging something while I
    play a game (either native or through wine-proton,) there's
    long lag spikes and freezes. Even worse, there's bugs like
    the system completely hanging on shutdown, or "umount"
    hanging with 100% CPU use by two kernel threads.
    [...]

    Check first if you had CONFIG_PSI enabled. The setting will work in
    any case, but if you already had it disabled/missing then there's
    no need to try again.

    It was enabled so now I disabled it. I'm not even sure why it was
    enabled in the first place, it sounds useless and is documented as
    "Say N if not sure." Haven't had any issues to far.

    Great! PSI is extremely useful, but was made primarily for servers,
    though there are potentially interesting use cases for dektop systems
    as well. It does come at a slight cost at runtime though, so unless you're using it it's probably better to just disable it.

    See https://www.kernel.org/doc/html/latest/accounting/psi.html and https://facebookmicrosites.github.io/psi/docs/overview for more.

    Unfortunately it seems that a recent change in the mainline kernel
    introduced a bit of an incompatibility, which is why the BMQ/PDS patch
    now turns it off. We're trying to get that incompatibility fixed.

    Anyway: glad you're up and running now!

    cheers
    Holger

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)