From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Omar Polo Newsgroups: gmane.emacs.devel,gmane.comp.lib.gnulib.bugs Subject: Re: [PATCH] support for accessing CPU/core count (processor-count) Date: Sun, 10 Oct 2021 23:16:32 +0200 Message-ID: <87pmscbmsb.fsf@omarpolo.com> References: <87h7dpgues.fsf@omarpolo.com> <9f927b85-c284-789a-36a7-041632156511@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16062"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.6; emacs 28.0.50 Cc: Gnulib bugs , Stefan Kangas , Campbell Barton , Emacs developers To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 10 23:20:48 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 1mZgFU-00044x-HG for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Oct 2021 23:20:48 +0200 Original-Received: from localhost ([::1]:35566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZgFT-0006wu-EO for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Oct 2021 17:20:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZgEP-0006DU-IR; Sun, 10 Oct 2021 17:19:41 -0400 Original-Received: from mail.omarpolo.com ([144.91.116.244]:64113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZgEN-0002Sp-V3; Sun, 10 Oct 2021 17:19:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omarpolo.com; s=20200327; t=1633900777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A5abdkj5z3m+qJYOcXLp/rBmapsPpLuan4M6E05ktl8=; b=EamPGWF+K3Z5XBQXXslQAyxDnIpBP5Kf8YYHzsI9T+ncFETz/sTv7w6Qwd8Yac6CtOT/8n +rzl2DlsheVroAqPRPf9HGtSeWVOp9YPSx63g7wEL3PHppkWHyAKdXu/WM4SsV8iaB54sc Kw/Q0qvPxYrWhsAZdim3nogJirzX3ZI= Original-Received: from localhost (host-79-45-237-189.retail.telecomitalia.it [79.45.237.189]) by mail.omarpolo.com (OpenSMTPD) with ESMTPSA id 20345537 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 10 Oct 2021 23:19:37 +0200 (CEST) Original-Received: from venera (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id bf70ee40; Sun, 10 Oct 2021 23:19:32 +0200 (CEST) In-reply-to: <9f927b85-c284-789a-36a7-041632156511@cs.ucla.edu> Received-SPF: pass client-ip=144.91.116.244; envelope-from=op@omarpolo.com; helo=mail.omarpolo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:276701 gmane.comp.lib.gnulib.bugs:45126 Archived-At: Paul Eggert writes: > On 10/10/21 5:21 AM, Stefan Kangas wrote: >> Omar Polo writes: >>> 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? > > > No need for a bug report as I'm one of those developers. To fix the > Gnulib nproc OpenBSD issue I installed the first attached patch into > Gnulib, and to port Emacs's recently-added processor-count code to > more platforms I installed the second attached patch into Emacs's > emacs-28 branch. Although I think the latter patch means that > emacs/src/w32proc.c's w32-get-nproc function can be removed, I'll let > the Emacs MS-Windows experts opine on that. I had just cloned glib when I saw your mail :) FWIW the first patch reads fine to me. Thanks!