public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Manuel McLure <manuel@mclure.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Would constant max CPU speed cause lockups?
Date: Sun, 6 Jun 2021 11:04:05 -0700	[thread overview]
Message-ID: <CAGJrxsQj+oA_SK4-W8oXOZxv564JGBBZTmNzPYcP0vZxVAFQOQ@mail.gmail.com> (raw)
In-Reply-To: <YLux166+ZqKD72+b@waltdnes.org>

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

On Sat, Jun 5, 2021 at 10:18 AM Walter Dnes <waltdnes@waltdnes.org> wrote:

>   A few years ago, I cheaped out and bought a low-powered Atom desktop
> with 8 gigs of RAM.  Looking back, that was a mistake.  It would default
> to 480p or at best 720p on Youtube.  But I wrote a nifty bash script
> that manually put the CPU into "userspace" mode, and selected the
> maximum available CPU speed.  I finally got Youtube with steady playback
> at 1080p... YAY!  I'd leave it at max speed during my waking hours, and
> drop it to min speed at night before going to bed.
>
>   I saw the occasional mysterious lockups as I mentioned in recent
> threads.  I wonder if pushing the CPU to max speed most of the day would
> cause overheating and lockups.  I'm leaving my current, more powerfull,
> machine in "conservative" mode.
>
>   Should I stay in conservative mode?  Or forget about speed control
> entirely, and let "Intel Speed Step" handle things for me?  Also, is
> there a way to enable CPU throttling based on temperature?
>
>
Depending on the specific generation of Atom/Celeron processor, there may
be some issues with processor power control (cstates) that can result in a
lockup. This is a processor bug that affects "Bay Trail" CPUs, including
several Atom processors:
https://ark.intel.com/content/www/us/en/ark/products/codename/55844/products-formerly-bay-trail.html
. I ran into this on a J1900 Celeron that I use to control my 3D printer.

There are a couple of workarounds:
- Disable all cstates >1 with the kernel command line option
"intel_idle.max_cstate=1". This will mean that the processor will not be
able to microsleep to save power.
- Disable cstate 6 (the one that causes the problem) and enable cstate 7
with a shell script like the following:

#!/bin/sh

#title:       c6off+c7on.sh
#description: Disables all C6 and enables all C7 core states for Baytrail
CPUs
#author:      Wolfgang Reimer <linuxball (at) gmail.com>
#date:        2016014
#version:     1.0
#usage:       sudo <path>/c6off+c7on.sh
#notes:       Intended as test script to verify whether erratum VLP52 (see
#             [1]) is the root cause for kernel bug 109051 (see [2]). In
order
#             for this to work you must _NOT_ use boot parameter
#             intel_idle.max_cstate=<number>.
#
# [1]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/pentium-n3520-j2850-celeron-n2920-n2820-n2815-n2806-j1850-j1750-spec-update.pdf
# [2] https://bugzilla.kernel.org/show_bug.cgi?id=109051

# Disable ($1 == 1) or enable ($1 == 0) core state, if not yet done.
disable() {
        local action
        read disabled <disable
        test "$disabled" = $1 && return
        echo $1 >disable || return
        action=ENABLED; test "$1" = 0 || action=DISABLED
        printf "%-8s state %7s for %s.\n" $action "$name" $cpu
}

# Iterate through each core state and for Baytrail (BYT) disable all C6
# and enable all C7 states.
cd /sys/devices/system/cpu
for cpu in cpu[0-9]*; do
        for dir in $cpu/cpuidle/state*; do
                cd "$dir"
                read name <name
                case $name in
                        C6*) disable 1;;
                        C7*) disable 0;;
                esac
                cd ../../..
        done
done

I have been using the above script successfully for over a year.

-- 
Manuel A. McLure WW1FA <manuel@mclure.org> <http://www.mclure.org>
...for in Ulthar, according to an ancient and significant law,
no man may kill a cat.                       -- H.P. Lovecraft

[-- Attachment #2: Type: text/html, Size: 5017 bytes --]

      parent reply	other threads:[~2021-06-06 18:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 17:18 [gentoo-user] Would constant max CPU speed cause lockups? Walter Dnes
2021-06-05 17:37 ` tastytea
2021-06-05 23:21   ` Michael
2021-06-06  0:42     ` Dottie Keogh
2021-06-06 10:34 ` Frank Steinmetzger
2021-06-06 18:04 ` Manuel McLure [this message]

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=CAGJrxsQj+oA_SK4-W8oXOZxv564JGBBZTmNzPYcP0vZxVAFQOQ@mail.gmail.com \
    --to=manuel@mclure.org \
    --cc=gentoo-user@lists.gentoo.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