From nobody Sun Jan 29 12:42:55 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 4P4WF43mCSz3cQq4; Sun, 29 Jan 2023 12:43:04 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4P4WF366yBz3tn9; Sun, 29 Jan 2023 12:43:03 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.1/8.16.1) with ESMTP id 30TCgtZv067122; Sun, 29 Jan 2023 15:42:55 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 30TCgtaK067121; Sun, 29 Jan 2023 15:42:55 +0300 (MSK) (envelope-from dchagin) Date: Sun, 29 Jan 2023 15:42:55 +0300 From: Dmitry Chagin To: Dmitry Chagin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 01f74ccd5a0d - main - libthr: Fix pthread_attr_[g|s]etaffinity_np to match it's manual and the kernel. Message-ID: References: <202301291238.30TCcKFb050951@gitrepo.freebsd.org> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202301291238.30TCcKFb050951@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4P4WF366yBz3tn9 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sun, Jan 29, 2023 at 12:38:20PM +0000, Dmitry Chagin wrote: > The branch main has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=01f74ccd5a0d1a444703e931339709c7de5296b5 > > commit 01f74ccd5a0d1a444703e931339709c7de5296b5 > Author: Dmitry Chagin > AuthorDate: 2023-01-29 12:35:18 +0000 > Commit: Dmitry Chagin > CommitDate: 2023-01-29 12:35:18 +0000 > > libthr: Fix pthread_attr_[g|s]etaffinity_np to match it's manual and the kernel. > > Since f35093f8 semantics of a thread affinity functions is changed to be a > compatible with Linux: > > In case of getaffinity(), the minimum cpuset_t size that the kernel permits is > the maximum CPU id, present in the system, / NBBY bytes, the maximum size is not > limited. > In case of setaffinity(), the kernel does not limit the size of the user-provided > cpuset_t, internally using only the meaningful part of the set, where the upper > bound is the maximum CPU id, present in the system, no larger than the size of > the kernel cpuset_t. > > To match pthread_attr_[g|s]etaffinity_np checks of the user-provided cpusets to > the kernel behavior export the minimum cpuset_t size allowed by running kernel > via new sysctl kern.sched.cpusetsizemin and use it in checks. > > Reviewed by: whoops, kib@