From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] support for accessing CPU/core count (processor-count) Date: Sun, 10 Oct 2021 14:21:32 +0200 Message-ID: References: <87h7dpgues.fsf@omarpolo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38414"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Paul Eggert , Campbell Barton , Emacs developers To: Omar Polo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 10 14:23:35 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZXrb-0009n5-Er for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Oct 2021 14:23:35 +0200 Original-Received: from localhost ([::1]:59520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZXra-0007zy-C9 for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Oct 2021 08:23:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZXpr-0006bI-Nq for emacs-devel@gnu.org; Sun, 10 Oct 2021 08:21:47 -0400 Original-Received: from mail-pl1-f177.google.com ([209.85.214.177]:44824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mZXpp-0001Rr-IH for emacs-devel@gnu.org; Sun, 10 Oct 2021 08:21:46 -0400 Original-Received: by mail-pl1-f177.google.com with SMTP id t11so9307931plq.11 for ; Sun, 10 Oct 2021 05:21:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iK9k37mGSOGCuqOZApiZ03cThukQeSdT0ZF04lViGM4=; b=2YLxvy6JXOeHVN5l1EA09OWfwUsnVNyxnbPznhZr13NCzRDQVoqgOAGIhnUYwDNVBw B8VwD7nCqgFwouzldqUik9GHVOKXihDkcT2zb0QoMF4XWHag5ObdW1qBpsanNZgyfbzx F7JzZ8rXFd47SjME4Fdjm13p2lAzHWGOZwjmH/Dp3jxvaUsedmfsIdAXcxc77mh752oA MuvsIINjBte7/PX3Qa3RsQ2n5DdOOB6y5YVwrhVrObaFpUUZtb0TZAVAznKr1TnMbRi3 zHmCq3ALN8/8Lm1nJGIxKmYfQ7tQ0Q73LxeKBgiWmqJ4SFgCMxlwddiL2UnFS2BGWqWy 9Tag== X-Gm-Message-State: AOAM533fWSUZY9GRFvvBPttJSJL43IV1lzpPUCim/MFoQ1DHeDG8BGmt 1/AjDLuhAiADXrCgcir0uaWHhNELQkk+Pjo9TIg= X-Google-Smtp-Source: ABdhPJyVSWMpwMk/H65AK/WI1a6mnE+8nqe55k8RxZ4hsct676IqnqeC68+Xm3WzbsziqvTe3hbFeUwXr2pzWqDHgag= X-Received: by 2002:a17:902:e74a:b0:13f:3538:fca0 with SMTP id p10-20020a170902e74a00b0013f3538fca0mr1274083plf.22.1633868504044; Sun, 10 Oct 2021 05:21:44 -0700 (PDT) In-Reply-To: <87h7dpgues.fsf@omarpolo.com> Received-SPF: pass client-ip=209.85.214.177; envelope-from=stefankangas@gmail.com; helo=mail-pl1-f177.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:276662 Archived-At: Omar Polo writes: > > + mib[1] = HW_NCPU; > > at least on OpenBSD this should be HW_NCPUONLINE. > > OpenBSD disables hyperthreading by default so HW_NCPU is (almost) always > misleading. For example, on my machine > > % uname -a > OpenBSD venera 7.0 GENERIC.MP#221 amd64 > % sysctl hw.ncpu > hw.ncpu=8 > % sysctl hw.ncpuonline > hw.ncpuonline=4 > > and this has been the case for a while already (I mean, a couple of > years if not more.) BTW, Gnulib doesn't seem to make this distinction (lib/nproc.c:313). Maybe that should be reported to the Gnulib developers?