From nobody Sat Feb 04 22:14:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P8Rf22tZ0z3kSyS; Sat, 4 Feb 2023 22:14:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P8Rf10JQWz3sMD; Sat, 4 Feb 2023 22:14:49 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=epaGUTum; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2001:4860:4864:20::29 as permitted sender) smtp.mailfrom=mjguzik@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-15ff0a1f735so10971406fac.5; Sat, 04 Feb 2023 14:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=RRGNv27Dx9Ejy01wYuz0Tz4a9dIcjL2iLPJJCHkXfF0=; b=epaGUTumF8tvUKiqOSlkjwQMCkyB07DegQTRdUOoa1S+p8sltnR5f6V4ZFmBfyMqKG vJoxkd2XTsVtDO5F/UhlE/VJikhKeYp5Trg1j57dHPpQKzi45/xEj8F/YW4XNCEoPrml qlDNsLTI9iGHI8pNGMVxVWJCf+ynpfK7JeMVgfaRuqKUUtpuDIPV1yeHJWKFLBbKycPs 44dA+jISd9XMnfEVIHPLo9rq2So8NHVQqEJN8d334zsa/ZyOhCDYn0YkUBTX18cS+KTb NlHEwbW/3Fdb6atUE0DjqDoipWDqKZAAtS4tU5UORsaTfLk0HJ2XP5aFWuZWIwkU1dRi KY6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RRGNv27Dx9Ejy01wYuz0Tz4a9dIcjL2iLPJJCHkXfF0=; b=lHz7vtGQV7JNCkWVsNWG8s1OQXH4y4aHiWmj1whzLwLQm/R1ZBuw6DF1ARmmek7WU3 e6XHH1PaqPyNOsuxI8/8Btfi0oiA9U4fw3zl2+qBNe+6vfiI6Rm9ClaTAhLHOiNGf4JK Ms5gdU1JaxEsOARfVGPmbbI4TdeKRf1wSkxTwFSiV8KTP4/wsZuOPsePm4tzZkGF3P9n auDLkXV7CsFMwHl68ZioQenDB4QvNo7PkkUUn0IQcRhe4naN/QwgO3taqjDDeY76lgHu VXPyPPKP5AeEiyGTDI4nE5iWVAPufdYr+UcS8lxbPVUVyjqd2W1MenGf4/b2EByBrNfU 64Zg== X-Gm-Message-State: AO0yUKVS5Y0OUWnyp8dWOKaoJluQfBM5ZOVnUxG4Z3O94Wk22iZZ7Bf9 t7YSnoBdeyImFA16pVw6AkVEtksLm2QTknih/SqLP+iG X-Google-Smtp-Source: AK7set8twX0KOm5kNOfiGCN6XhIi+20k/uh7ImqlBEbE66V9kHIfHMjFWMpzKJ3+pGR85dSaVTeq2eXHuBXcLo+9Dvg= X-Received: by 2002:a05:6870:40c8:b0:163:c837:6968 with SMTP id l8-20020a05687040c800b00163c8376968mr837773oal.81.1675548887582; Sat, 04 Feb 2023 14:14:47 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Received: by 2002:a8a:ad6:0:b0:49c:e11d:f815 with HTTP; Sat, 4 Feb 2023 14:14:46 -0800 (PST) In-Reply-To: <20230204203529.CusFt%steffen@sdaoden.eu> References: <202302041751.314HpRrn042970@gitrepo.freebsd.org> <20230204203529.CusFt%steffen@sdaoden.eu> From: Mateusz Guzik Date: Sat, 4 Feb 2023 23:14:46 +0100 Message-ID: Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count To: Mateusz Guzik , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-2.96 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2001:4860:4000::/36]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.04)[0.044]; RCVD_IN_DNSWL_NONE(0.00)[2001:4860:4864:20::29:from]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US]; DKIM_TRACE(0.00)[gmail.com:+]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4P8Rf10JQWz3sMD X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 2/4/23, Steffen Nurpmeso wrote: > Mateusz Guzik wrote in > <202302041751.314HpRrn042970@gitrepo.freebsd.org>: > |The branch main has been updated by mjg: > | > |URL: https://cgit.FreeBSD.org/src/commit/?id=d9d5f2c042a51a9f0dd69eb1fc3\ > |49efd81ffa483 > | > |commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 > |Author: Mateusz Guzik > |AuthorDate: 2023-02-04 17:47:41 +0000 > |Commit: Mateusz Guzik > |CommitDate: 2023-02-04 17:50:41 +0000 > | > | cpuset: add --count > | > | Can be used to count the number of hardware threads in the cpu set. > ... > | The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus \ > | which > | can be found in the tree, which are not adequate given existence of > | cpusets. > > This is great (in respect to a #freebsd IRC from 2021-07-02)! > Are there plans to address > > 19:26 < RhodiumToad> and in fact sysconf(_SC_NPROCESSORS_ONLN) is > implemented as sysctl hw.ncpu > > or > > 19:25 < RhodiumToad> on fbsd 13 on a 4-cpu box, cpuset -l 0-1 getconf > _NPROCESSORS_ONLN returns 4 rather than 2 > So I just checked on Linux and get: $ taskset --cpu-list 0 getconf _NPROCESSORS_ONLN 4 iow the current behavior is probably the expected one. > or even add a shallow usr.bin/nproc(1) that does only this > operation, as in Linux? (Or ln(1) it and check out argv[0] to do > so?) Having a "portable" thing would be great. > I have no opinion on this one, looks a trivial addition, but someone else will have to ack it (most notably whether to add it to cpuset as you suggested above or create new utility altogether). That said, happy to take a look at a patch which adds a *new* nproc utility. -- Mateusz Guzik