From nobody Thu Feb 16 18:21:13 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 4PHjv01BmDz3rGwQ for ; Thu, 16 Feb 2023 18:21:16 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) (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 4PHjtz3fJTz4Myd for ; Thu, 16 Feb 2023 18:21:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=lAArgQQa; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2001:4860:4864:20::33 as permitted sender) smtp.mailfrom=mjguzik@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-16e55be7c76so3536044fac.6 for ; Thu, 16 Feb 2023 10:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WseQ6WeGM4Q0d4cOnEYeTZ2hK+HrctevXAUtCanvU8E=; b=lAArgQQanAlzHArv/J27bNoDbgNSuwaknLeIZ/YgWJkNebVO6JZIUW4IhrDpSplCQx 35A1sIMQi4wWsmXsA/+Ni+JuohgyocbT4wHxFhFifTUDX02ZWrhrz+lyh5uXpf5XjZXK GdaB4rOAc3SjiIouiYHa0fgs09nnwYatuQMbYQfqdOmAP+iuFuFkYLz7wiVGoOHwPsbL NslZuwjVXMkw4WQs0ZGGH3NKNcnq97a+xkc94PXiXuxPfqErmSShFupXpSTM0l4OBhNC Botao/gyAr8uFQ1rgD/NSdKNtshWt/mHh3SgbEkJ785nKK0+CuUmme1BpA5et++A3CDS ALNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc: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=WseQ6WeGM4Q0d4cOnEYeTZ2hK+HrctevXAUtCanvU8E=; b=qqmzrqMfGU+IDXHDJUbYMNY+u7Cq2ZIiE5vEp3ZA4KOb8JuufxwEMtmpRJ3TeVBx49 gdSzaxEEp5vMTcz3Ie1QNgjYcMe+Qc95oB2XSyv8+o8+pSwF82NtBR5nXg3afrNaiqY+ M0wmfznvYNbEtvfNI/C2xuoxpbgDrNDLOp3cvZxwKl6qSeU44xsE7om7ul1+mEl9ZZAI g1AHiJ3319wn7r5Rdl4vZKS0jCq/E/K5hA6vRv7F2rims5xqIjjhNhVyQkF1Ekp1lZVV aoL0v/Vs4NVW//w9gfWypEvrLjEk4qhfXY9sdfc4lqIN0RwLIsV9go/FFcgPtV51XG4T vobQ== X-Gm-Message-State: AO0yUKWomOTX1fYtCa0+rXRyhauG0oiOZBK+dZKltt829MAIrJyNAmYM VSG+PryN7SA0aGSZAHlrGN9rlPFnTa5CaXQkJPuzNQqO X-Google-Smtp-Source: AK7set9YtLLeBMJPsiJ28dd0MktPnfeetqZEr6QLVBKDIGbbmv3jhOYvqJG8j9fyq4q1Iliiq+b9pGCwB0aaTttpQ3I= X-Received: by 2002:a05:6870:eca1:b0:16e:25e:f294 with SMTP id eo33-20020a056870eca100b0016e025ef294mr212945oab.81.1676571674530; Thu, 16 Feb 2023 10:21:14 -0800 (PST) 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 Received: by 2002:ac9:4381:0:b0:4b9:9c2d:ce62 with HTTP; Thu, 16 Feb 2023 10:21:13 -0800 (PST) In-Reply-To: References: From: Mateusz Guzik Date: Thu, 16 Feb 2023 19:21:13 +0100 Message-ID: Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count [changed/broken command line parsing] To: Mark Millard Cc: dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; 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:c]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[2001:4860:4864:20::33:from]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_TO(0.00)[yahoo.com]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PHjtz3fJTz4Myd X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On 2/15/23, Mark Millard wrote: > On Feb 14, 2023, at 23:08, Mateusz Guzik wrote: > >> On 2/15/23, Mark Millard wrote: >>> Mateusz Guzik wrote on >>> Date: Sat, 04 Feb 2023 17:51:27 UTC : >>> >>>> The branch main has been updated by mjg: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 >>>> >>>> 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. >>>> >>>> For example: >>>> $ cpuset -g -p $$ >>>> pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, >>>> 16, >>>> 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, >>>> 35, 36, 37, 38, 39 >>>> pid 2440 domain policy: first-touch mask: 0, 1 >>>> $ cpuset -g --count -p $$ >>>> 40 >>>> >>>> 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. >>>> >>>> Right now only -g -p combination is supported to reduce complexity. >>>> As anything else errors out, this can be expanded later as needed. >>>> >>>> Differential Revision: https://reviews.freebsd.org/D36351 >>> >>> This broke long standing commands sequences in some makefiles >>> that I use to build and run some benchmarks, the commands >>> at issue involve use of cpuset. >>> >>> However I can show the oddity in a much simpler context: >>> >>> # cpuset echo "text" >>> text >>> >>> # cpuset echo "-text" >>> usage: cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] cmd ... >>> cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] -p pid >>> cpuset [-c] [-l cpu-list] [-n policy:domain-list] -C -p pid >>> cpuset [-c] [-l cpu-list] [-n policy:domain-list] >>> [-j jailid | -p pid | -t tid | -s setid | -x irq] >>> cpuset -g [-cir] >>> [-d domain | -j jailid | -p pid | -t tid | -s setid | -x >>> irq] >>> cpuset -g --count -p pid >>> >>> >>> By contrast, in my stable/13 context, so, showing the old behavior: >>> >>> # cpuset echo "-text" >>> -text > > FYI: the use of quotes was in my original text for other > reasons. I should not have duplicated them into the above > examples. (Same results without quotes.) > >> the idiomatic way to pass progs to spawn is to denote the end of any >> opts with -- > > The cpuset man page gives no indication that it requires such > notation. Programs with that requirement normally document it > explicitly. (Programs that do not require the ntoation often > allow the notation without documenting it.) > > There may be a consideration of how long it has allowed such > a lack of use of "--" and how many things might break because > it worked before. > > Lots of programs taking commands do not require such. For > example: "time echo -text", "truss echo -text", and "ktrace > echo -text". These have not and are not being changed to > require such. They do allow the "--" notation. > > > If it stays as it is, the change should probably be in UPDATING > or other such place(s) that note where changes are required to > keep things working. > >> so in particular you would: >> cpuset -- echo -text > > Yep. > >> the fact that previous version worked without it is kind of a bug > > I disagree with that last statement, given the many programs > that do not require such. Some programs have some specific > notational complication lead to making it required. But, from > what I've seen, most of the others do not make "--" required. > > So I found that on Linux 'perf stat' et al don't require --. Due to a just found bug in the change anyway I decided to just whack it: https://cgit.FreeBSD.org/src/commit/?id=2924ae099a1e8ffc5b6040f3af5645aa54c0f629 -- Mateusz Guzik