From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oC7/Gf1Se1/oaQAA0tVLHw (envelope-from ) for ; Mon, 05 Oct 2020 17:08:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mOF1Ff1Se18PPgAA1q6Kng (envelope-from ) for ; Mon, 05 Oct 2020 17:08:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 40EB89404C2 for ; Mon, 5 Oct 2020 17:08:12 +0000 (UTC) Received: from localhost ([::1]:55956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPTy6-00075B-Me for larch@yhetil.org; Mon, 05 Oct 2020 13:08:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPTxy-00073z-7B for bug-guix@gnu.org; Mon, 05 Oct 2020 13:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38868) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPTxx-0003XW-UL for bug-guix@gnu.org; Mon, 05 Oct 2020 13:08:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kPTxx-0005tb-Og for bug-guix@gnu.org; Mon, 05 Oct 2020 13:08:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#43773: [PATCH] offload: Improve load normalization and configurability. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 05 Oct 2020 17:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43773 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 43773-submit@debbugs.gnu.org id=B43773.160191764922622 (code B ref 43773); Mon, 05 Oct 2020 17:08:01 +0000 Received: (at 43773) by debbugs.gnu.org; 5 Oct 2020 17:07:29 +0000 Received: from localhost ([127.0.0.1]:50414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPTxQ-0005sn-Qq for submit@debbugs.gnu.org; Mon, 05 Oct 2020 13:07:29 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:46545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPTxP-0005sZ-Hu for 43773@debbugs.gnu.org; Mon, 05 Oct 2020 13:07:28 -0400 Received: by mail-qk1-f194.google.com with SMTP id f142so12768539qke.13 for <43773@debbugs.gnu.org>; Mon, 05 Oct 2020 10:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=3c3tR2puZ5g+em6cSl7IKc11eRSZoVHFy6HFfrfd2Lw=; b=BRJRmnJOHP4y9dSMQGpne+gQEln9ghVk8xtiHRsKPOVLKasvWajavqxnOzFxrXeDjB F2F912jAxwwEhoi2oMLnUOgTaYo7YlCffONLlbvTQKpkmJxZlcmM4SAUlMbg9ARCx8BX hRJpZKR7P7Z0b9Tpcyla6esJ9d1GAkdZk8ZNVExvDIj6xWeFzzslZlEJvCFTXVtlx64X objInmNydcDIEWjstg5+It/mAhCSJvyo0CYLkpW8CGjv1D0YbeNqEnVS6UGJGcLq/QAL 2LK4m3GebjXZ0FDUooGYUJ6VwEj/wQQgvis3VIVx17ZlrRfsVA3/lQ/vbaCdRCr0QBBI IhZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=3c3tR2puZ5g+em6cSl7IKc11eRSZoVHFy6HFfrfd2Lw=; b=nkQpodrD9e6sy3+XAxkI/jQabUmaNFvpSzoQ0DnTX/qboYyvlKrf1JTaBNPPSzShWp XvoA1cqE0yQfC3n4Wz6KFP3lfvNGCeIE8u2w0ZMDEVYuoSBuOhp/X0fy6B3ZxEV8YYbu 2VwWKslr521+4UBxfq4RGDo5deRKES7HFobDDpg+JVWI/7GOarOhAjViPDOVWO34mlGG fp4sDvhZjBiWExSoMvZt7BO5SYpAEgC5QjFc4Ife5K5FVQRKucMmnNhrHE6FPPKp3ByT ZeHKiDC9UhO9AzERhYHpl480pU4ninY8OHBvEyIfsXqBxmPy65iT+lwv3zVlg1jQ03sE 9kSQ== X-Gm-Message-State: AOAM531eo10S1l+aowxe1PMIXLWteNWSh3uFaCe/ngZW3ITf4+ZvWbco PStIGcOT9mMIBtXrkgrmXVh7UzPPEjomFQ== X-Google-Smtp-Source: ABdhPJzL9QJJyT0tgAvJZX3kCCzspNAUFhBrfUPzQzpDlsW7PQWPPK+1j/EF0ZH7DIMsDRfX1C/R8Q== X-Received: by 2002:a37:9f86:: with SMTP id i128mr986774qke.147.1601917641709; Mon, 05 Oct 2020 10:07:21 -0700 (PDT) Received: from hurd (dsl-10-141-84.b2b2c.ca. [72.10.141.84]) by smtp.gmail.com with ESMTPSA id j9sm245208qtk.89.2020.10.05.10.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 10:07:20 -0700 (PDT) From: Maxim Cournoyer References: <875z7sm2kv.fsf@gmail.com> <20201004032112.5916-1-maxim.cournoyer@gmail.com> <87tuv8wywe.fsf@gnu.org> Date: Mon, 05 Oct 2020 13:07:19 -0400 In-Reply-To: <87tuv8wywe.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 05 Oct 2020 16:06:09 +0200") Message-ID: <87d01wk3eg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43773@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=BRJRmnJO; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: CV6iNcHLrvro Hello, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >> Fixes . >> >> The computed normalized load was previously obtained by dividing the load >> average as found in /proc/loadavg by the number of parallel builds defin= ed for >> a build machine. >> >> This normalized didn't allow to compare machines with different number of > ^ > >> cores, as the load average reported by can be as high as the number of c= ores; > ^ > Missing words. Good catch, fixed. [...] >> (define (node-load node) >> - "Return the load on NODE. Return + if NODE is misbehaving." >> + "Return the load on NODE, a normalized value between 0.0 and 1.0. Th= e value >> +is derived from /proc/loadavg and normalized according to the number of >> +logical cores available, to give a rough estimation of CPU usage. Retu= rn >> +1.0 (fully loaded) if NODE is misbehaving." >> (let ((line (inferior-eval '(begin >> (use-modules (ice-9 rdelim)) >> (call-with-input-file "/proc/loadavg" >> read-string)) >> - node))) >> - (if (eof-object? line) >> - +inf.0 ;MACHINE does not respond, so assume it is infinitely lo= aded >> + node)) >> + (ncores (inferior-eval '(begin >> + (use-modules (ice-9 threads)) >> + (current-processor-count)) >> + node))) >> + (if (or (eof-object? line) (eof-object? ncores)) >> + 1.0 ;MACHINE does not respond, so assume it is fully loaded > > Returning 1.0 now is akin to returning + before, meaning that the > machine will never be picked up, is that right? Yes, 1.0 has the same meaning as the +inf.0 value previously used (i.e., the machine is fully loaded). > What if one sets overload-threshold =3D 1.0, the machine would still be > picked up, no? Currently no, the machine would never be picked up, as the maximum value returned by node-load is now 1.0, and the comparison is using the strictly inferior to operator (<). Perhaps this should be made a <=3D operator? >> + (if (and node >> + (or (not threshold) (< load threshold)) > > I think we can assume that THRESHOLD is always a number, including > possible +inf.0. It's no longer possible for node-load to return +inf.0; it's strictly bound between 0.0 and 1.0. The check for #f is done because it is desirable (for semantic clarity) to allow the user to disable overload-threshold altogether by setting it to #f. This is documented. Thanks! Maxim