From nobody Tue Feb 14 00:21:29 2023 X-Original-To: dev-commits-src-main@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 4PG2292cnfz3rD7J; Tue, 14 Feb 2023 00:21:37 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PG2292BSwz3lPH; Tue, 14 Feb 2023 00:21:37 +0000 (UTC) (envelope-from jbeich@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676334097; 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=+x2UoDMvxSytTGfuvG6T5gVskPy7OJkjCAEldmPzyVg=; b=wmhKvfeEjOt5stPu3GNIkOTsuE3TlHLmrQ3Z3xMYa4e+DDfpb5RefFBQNhOrc+6d8JVWR8 M/WaMAb0f2WmTdyv1QeqbRzfyANHloGustVYIX0fJT6CuBBQZa2BiiRIT1iaQC6laenUIq Qp9k8hKBr4rT5sMGMiWGqcSK+hDb6QeFbfhI+sp67+PN6kz5E2W46VGFGmg1Zdo+lGI/Yd /nAiOrTmK3Ih7+BQKTgezchOqKY8bv1DDMRBvVHlFpTEbi3+Nq4NSR8VcWQtag2yml6s1S lik63akn1AE688zZPrDEVMqD2kovIzf5g1F+tXgEACGVhJFFKHzXqV3+gYdSpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676334097; 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=+x2UoDMvxSytTGfuvG6T5gVskPy7OJkjCAEldmPzyVg=; b=oqQT3QGENCFoekyTnFiwkffIKUVgi+zIcJzvFOL0Z8Tb0S8lJEZYM/rB/w3qoj3daBX0sn WTq752OJVlCbkrMTB0vqL/bYAl6tdLzOxjS5Gd6EQV9QVAJRL0UWiSacO4ti4OYKJlS9SK pUc2C4jpd9mfxfebl4ZvVDdq5HXNW6qoWwiN4YkcnpsC24wE5DpnhxG3fvc7eonKy5V9XS O5zt5oZ0bs3OKx934L2wOA8lucMUia2TJILgl0EAkYsWPAs5cG9AjMwU5zYBcIsTEFwAxJ H89sNDnPQWCiy3RUcYbOO1rdPoORDkHwA+SAiXBp3NJ2JcI+m7vRMZU/WayVrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676334097; a=rsa-sha256; cv=none; b=dzxvKWy1cWIpP0gm2RJpIo+MDo5TmcugbYx6F8biWvhNWBhTLB+RRTY3iqba+sPOnI14we ipV5L8LEZiIwUBwCyLqKgwaL8L2YnVf+0zkem53Hhy2j1tyEkb0c05gttIN4cSXimTqWag 7SVW2xd2Y+i912EFKkBfpY2ubWJmH8Xtn1gV/99BmEuP9OWwxx7UYGrSUmS2TVcrHr3eWv nrIPcuTcHdj/Ik8bCoyst8xI4gddZRMRJeVo7S+ny3LgPqOhpEIX7gtIVRrmNDGHmtaE5N /BYinrdMjGHZqiMJHbHO40TsSJux3jSsgvKYWDgTmgdL/WJKIQBZg2N3LpqvfA== Received: by freefall.freebsd.org (Postfix, from userid 1354) id 2E1FC1A527; Tue, 14 Feb 2023 00:21:37 +0000 (UTC) From: Jan Beich To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 48bfd3597654 - main - Add nproc(1) In-Reply-To: (Mateusz Guzik's message of "Tue, 14 Feb 2023 00:58:41 +0100") References: <202302081947.318Jlbt6052826@gitrepo.freebsd.org> <20230208202736.L7hpB%steffen__28609.3347867549$1675888077$gmane$org@sdaoden.eu> <1qmt-6s1w-wny@FreeBSD.org> Date: Tue, 14 Feb 2023 01:21:29 +0100 Message-ID: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-ThisMailContainsUnwantedMimeParts: N Mateusz Guzik writes: > On 2/14/23, Jan Beich wrote: > >> Steffen Nurpmeso writes: >> >>> |+ if (all_flag) { >>> |+ cpus = sysconf(_SC_NPROCESSORS_ONLN); >>> >>> is not compatible -- note i like the FreeBSD way better, and maybe >>> someone should make a bug report even. >>> >>> #?0|kent:$ getconf -a|grep NPROC >>> _NPROCESSORS_CONF 8 >>> _NPROCESSORS_ONLN 4 >> >> See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230330 >> >> $ cpuset -l 2-5 -- getconf -a | fgrep _NPROC >> _NPROCESSORS_CONF: 8 >> _NPROCESSORS_ONLN: 4 >> > > As I mentioned previously in the thread, on linux these *don't* react > to cpusets (or tasksets in linux parlance): > > $ getconf -a | grep _NPROC > _NPROCESSORS_CONF 4 > _NPROCESSORS_ONLN 4 > $ taskset --cpu-list 0 getconf -a | grep _NPROC > _NPROCESSORS_CONF 4 > _NPROCESSORS_ONLN 4 > > consequently the patch proposed in the bz would introduce an > incompatibility with linux I've used kern.smp.cpus in old patches but found musl more practical. _SC_NPROCESSORS_ONLN is often used as a default number of jobs. glibc: - /sys/devices/system/cpu/online - /proc/stat - sched_getaffinity musl: - sched_getaffinity bionic: - /sys/devices/system/cpu/online - /proc/stat (Android < 7)