From nobody Fri Feb 24 21:22:21 2023 X-Original-To: bugs@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 4PNjXF5TYrz3tx0r for ; Fri, 24 Feb 2023 21:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PNjXF3kg2z3xKV for ; Fri, 24 Feb 2023 21:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677273741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FufLtTpZYZLrMVnKdwemWZUVNtWIljezYEQxdD6q4Jw=; b=KzwnN8McvoGDCTIjCmJCBdf1QrzJ3aRsA2pfsyddwi9Jcc/ua7ZfOowfdF8IBpQELgws5z D+db+xsKnItQwHNdGfELU7YyC7EDB//XqNVaAllaWUhIAe/9G0yiQo0QjvmiOur++ezlQH f3QuEeQPs+ri2haDXYLDiHkGS9PzvMQgNRzLfiX7lXdc3PbJhZUVxJ8NxQ6U3v4y8baWXF b/UX2CU2o3ygTKZAmvJSlroyVoEMx0YH/TV/9TIA/E1D7eyD+umYEtZI67WuxkAzLrBaFK OjCNH+n/HuRdBeR6eRugyQiYqj5jVF1bG2VKAIrXKXd+c5ctSmREAYcI2P1SDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677273741; a=rsa-sha256; cv=none; b=w+Aq2sdagCJz1HB+63tpbv8BcUv9YjaDvw4Tg1A8/kKB5ZrJpJZgkI8UCyyyoWvd3NIBOL lLiy4kNnvFr0Dok6MO4BcUaBDpGJPLsgIPhy0ds3Ma9MMwEcRGzRwgYH9S4MgV0Pq8IKQS i5Kto0+RRBIQIBDcqY4mMct3+KXJjenI8GVHmnzt8C7E6Qp9sXUt3s8/372sgTxMd3rB9T kZHVOTdTThohNMj2ldANz3sK5gewMVrdIXaUv73gjX2F17HWnvn2XIn3VpEYwNdoirGVCS 1ijktzTuV3CQLtYS41KxVJ4GbuU58lNW8cavF64zLC4LK8dCGMRv856weWaYYg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNjXF2rKszfBj for ; Fri, 24 Feb 2023 21:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 31OLMLwi073793 for ; Fri, 24 Feb 2023 21:22:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 31OLMLKq073792 for bugs@FreeBSD.org; Fri, 24 Feb 2023 21:22:21 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 222242] [patch] allow masks smaller than cpuset_t, if large enough for mp_maxid Date: Fri, 24 Feb 2023 21:22:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222242 --- Comment #1 from Ed Maste --- Believe addressed by f35093f8d6d8155ab2e56c11ee03d474688b16a2 and subsequent commits commit f35093f8d6d8155ab2e56c11ee03d474688b16a2 Author: Dmitry Chagin Date: Wed May 11 10:36:01 2022 +0300 Use Linux semantics for the thread affinity syscalls. Linux has more tolerant checks of the user supplied cpuset_t's. Minimum cpuset_t size that the Linux kernel permits in case of getaffinity() is the maximum CPU id, present in the system / NBBY, the maximum size is not limited. For setaffinity(), Linux 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. Unlike FreeBSD, Linux ignores high bits if set in the setaffinity(), so clear it in the sched_setaffinity() and Linuxulator itself. Reviewed by: Pau Amma (man pages) In collaboration with: jhb Differential revision: https://reviews.freebsd.org/D34849 MFC after: 2 weeks 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 b= e a compatible with Linux: In case of getaffinity(), the minimum cpuset_t size that the kernel per= mits is the maximum CPU id, present in the system, / NBBY bytes, the maximum si= ze 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 t= he 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: Differential Revision: https://reviews.freebsd.org/D38112 MFC after: 1 week --=20 You are receiving this mail because: You are the assignee for the bug.=