Path: csiph.com!fu-berlin.de!bofh.it!news.nic.it!robomod From: Emanuel Berg Newsgroups: linux.debian.user Subject: Re: how to limit a CPU temperature? Date: Sun, 09 Apr 2023 14:40:01 +0200 Message-ID: References: X-Mailbox-Line: From debian-user-request@lists.debian.org Sun Apr 9 12:36:18 2023 Old-Return-Path: X-Amavis-Spam-Status: No, score=-6.75 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, HEADER_FROM_DIFFERENT_DOMAINS=0.25, LDO_WHITELIST=-5] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate:hard: -4.6 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: debian-user@lists.debian.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:UcQzJr4q0+j9QMs1mmcChsSQaeU= Mail-Copies-To: never X-Mailing-List: archive/latest/798261 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/87pm8d2py2.fsf@dataswamp.org Approved: robomod@news.nic.it Lines: 33 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sun, 09 Apr 2023 14:35:49 +0200 X-Original-Message-ID: <87pm8d2py2.fsf@dataswamp.org> X-Original-References: Xref: csiph.com linux.debian.user:256959 Darac Marjal wrote: > As an alternative, you could try writing a small shell > script that works like the following (pseudocode): > >  STOP_TEMP=70 > START_TEMP=65 > JOB_RUNNING=1 > > while true: > cpu_temp=$(cat /sys/something/temperature) > > if JOB_RUNNING and cpu_temp > STOP_TEMP: > systemctl stop something.service > JOB_RUNNING=0 > elif not JOB_RUNNING and cpu_temp < START_TEMP: > systemctl start something.service > JOB_RUNNING=1 > endif > > sleep 1 > wend Maybe the software scheduler should already schedule optimally, be it preemptive SJF or whatever, anyway so only possibility to reduce CPU temperature that way is to schedule less anyway - also backwards, since computing is like the "king" here it means if heat is a problem, it's not on our side of it really. -- underground experts united https://dataswamp.org/~incal