From nobody Tue Oct 06 14:42:46 2026 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 4hzfBM4n8xz6vRRf for ; Tue, 06 Oct 2026 14:43:07 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hzfBK4TShz4Vfm for ; Tue, 06 Oct 2026 14:43:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20251104 header.b=bl2AthYB; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::62a as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2e49851734cso6598985ad.3 for ; Tue, 06 Oct 2026 07:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791297779; x=1791902579; darn=freebsd.org; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:content-type:from:to:cc:subject:date:message-id :reply-to:content-type; bh=mmSOvT3yvJTeVGsOD87nCRZWD792RciCbA2SwPvxOeA=; b=bl2AthYBJsTjd/oJXgBpMlKJHr+sdvL3Cf8nwWHEJ07LEK8uFwIFTitJZk3e5bH8UI 3UVMTG+ydrIbkDef/I9Rmy5h4rrPCPO1baHZMpF3uZK0SHxXtbNkSTgeRwKEi/CAew4m zOUkE5Ae2nsnkShm6pO1nTMO1Ro5gFoFSDPz0IKTdual/qNeR2JjBIwKFinCwiO21M4m 3g1sgR4zoSKCMTUIAIAkCAib/jcay5lHyaxjZuw02UvJAafL7QTO14wxwJNjuTqzgFhE Jsx4JlhNgNo9g7//Tj8u6hxJkypdQQ5LNRf/0Y+g1Y9i/bzBx7KCM9Glzy4dapvvs7/Q eVTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791297779; x=1791902579; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:content-type:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=mmSOvT3yvJTeVGsOD87nCRZWD792RciCbA2SwPvxOeA=; b=w54XaLDwUOy2Eedc2EDz8OjIb1m57RGFBGWpQo+mSgMaWSWeqJsQ9+smZaQsKJUBcK TOBkOAuxLVMvZ/ik0jsEmcq0fM6us5YwF99Iiduxo1ipUDvYHAjXpP/aNyFlqcXrqPQP CSmqcgE/tCoy2CMGFTk4DBljAwUzWwAyFV7JcJEi2qij7cOwi261oTD/U5WUE3mLhLjk yzFcXjPHIeFyCF+u3p0RMqI6RVxi3jeDNZenHMh7E0Xtif05SYf/azK6uFiJBgvX2XXP 8BibPlwRtM9HXO4PTNU1zPKv5wYUwnfMYZ9disheG6QtvjOZdxW0S9AknGbSBBaQs1xe xjfA== X-Forwarded-Encrypted: i=1; AKwUvByd3KK2Es63bdr4VcFs/6+AYxmRvg3kQokh97Cd0agHVPpOItuj7yZ6EoS/e0CKa2ZHRt66t2+59DGMasbJcJd5fmRO@freebsd.org X-Gm-Message-State: AFuF++nviz0tsK871eSJwfxGQx16kB0b5bl62mT0l6gmSG6/ug/X0dbp VKN3cWAUk2pKDXlxgWobsJWrUmoExrSjwczZ2I2eimB1DL5K0t8hr3dr X-Gm-Gg: AYBFou1VaF4hODv1zq1fMd5ZzUs9ab+v/Wr6BCha0WxfaDd36phd4f8tNGSm+Famdm3 LDDUq0991rZOZWuSUBuLZ/rDOGhRyLu3Q5VlQv5ehLvviHEB5XnPOkkTLguZ9fUXdyJH9ZRPA34 UcWFVtWKEpMtMJTbmjh8eVls13NHGQzDcWcRHY92OpGpWwZBi/ZtlQT5m5dM64UcARg+fE9DIF8 ObzZAcZGHWQdVUiDhu52ReWpar1q3wmxd1/8l/jXK+2U04b4rsfH8pppisHjVW904z9uugCf1ro or2i3L1C5Kq8OPp0ZbwWG4YaVSsOmmUCMAup2WPVuZqD99MqI88PYbtiK4YGPLft8keexG0VqJP n30Nb7N6ipNiLiXHQYhBZK+zsKNe10bJFFidY88zYzNwdT/sttU8o//JUmksdLDiVkhtTyvP9jZ J+dmiI/gMcVhx0+0lEtRVTOxLC30aT3M4XHNnZsWySep0nK4d4yRQsjeyQ5tI6S+bkQkb2snpAc nRwHAExmkc2SC6eXVVOnnnJJ1ezlHU= X-Received: by 2002:a17:902:f693:b0:2dd:ad73:c989 with SMTP id d9443c01a7336-2e5dcd94ed8mr12414515ad.33.1791297779301; Tue, 06 Oct 2026 07:42:59 -0700 (PDT) Received: from smtpclient.apple ([187.15.153.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e5a5ee0726sm25066145ad.62.2026.10.06.07.42.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2026 07:42:58 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_A0D475CB-DDA4-4AAD-9580-CD8F08041ADC"; protocol="application/pgp-signature"; micalg=pgp-sha256 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.3\)) Subject: Re: git: bb5f10e51bd5 - main - linux: implement sched_getattr() From: "Enji Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 6 Oct 2026 07:42:46 -0700 Cc: Enji Cooper , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: References: <6ac42979.2608d.d368a5e@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3864.700.51.1.3) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; SIGNED_PGP(-2.00)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56:c]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20251104]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62a:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; HAS_ATTACHMENT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Queue-Id: 4hzfBK4TShz4Vfm --Apple-Mail=_A0D475CB-DDA4-4AAD-9580-CD8F08041ADC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 5, 2026, at 4:22=E2=80=AFPM, Mark Johnston = wrote: >=20 > On Mon, Oct 05, 2026 at 10:49:29PM +0000, Enji Cooper wrote: >> The branch main has been updated by ngie: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dbb5f10e51bd53771f1a438f36f554256= fcbd7d08 >>=20 >> commit bb5f10e51bd53771f1a438f36f554256fcbd7d08 >> Author: Enji Cooper >> AuthorDate: 2026-10-05 22:48:22 +0000 >> Commit: Enji Cooper >> CommitDate: 2026-10-05 22:49:09 +0000 >>=20 >> linux: implement sched_getattr() >>=20 >> This change adds the necessary glue to translate Linux scheduler = policy >> and priority from FreeBSD so this information is available to = Linux >> applications. >>=20 >> This unbreaks using the Linux version of Chromium on FreeBSD. >>=20 >> This change was originally submitted via = [freebsd/freebsd-src#2370][github-pr]. >>=20 >> MFC after: 2 weeks >> PR: 297468 >> Co-Authored-By: Enji Cooper >=20 > The commit author is already set to you. I was trying to be a bit more explicit about having=20 >> Signed-off-by: Joao Bonifacio >>=20 >> [github-pr]: https://github.com/freebsd/freebsd-src/pull/2370 >>=20 >> Differential Revision: https://reviews.freebsd.org/D60214 >=20 > = https://docs.freebsd.org/en/articles/committers-guide/#_include_appropriat= e_metadata_in_a_footer > documents the right way to label commits with pull request metadata. > Please follow it instead of inventing your own format. Ok. In case someone is confused, these are Markdown reference links (the = rendered version fills in [github-pr] with the link). I have been using = them to stay under the <80 col text limit and keep things as legible as = possible for humans, but all of the metadata did get shuffled around = more than it needed to be. ... >> + attr.size =3D MIN(args->size, sizeof(attr)); =E2=80=A6 >> + return (copyout(&attr, args->attr, args->size)); >=20 > So, this lets the caller decide how much stack data they want to copy > out, independent of sizeof(attr). The only constraint is the > `args->size > PAGE_SIZE` check at the beginning of the function. I eliminated a duplicate calculation in the copyout which contradicted = the [Linux] documented interface [1]. The interface documented by Linux allows the user to specify the amount = of data to copy out = (https://www.man7.org/linux/man-pages/man2/sched_getattr.2.html): > The fields of the sched_attr structure are as follows: > > size This field should be set to the size of the structure in bytes, as in sizeof(struct sched_attr). If the provided structure is smaller than the kernel structure, any additional fields are assumed to be '0'. If the provided structure is larger than the kernel structure, the kernel verifies that all additional fields are 0; if they are not, sched_setattr() fails with the error E2BIG and updates size to contain the size of the kernel structure. > > The above behavior when the size of the user-space sched_attr structure does not match the size of the kernel structure allows for future extensibility of the interface. Malformed applications that pass oversize structures won't break in the future if the size of the kernel sched_attr structure is increased. In the future, it could also allow applications that know about a larger user-space sched_attr structure to determine whether they are running on an older kernel that does not support the larger structure. =E2=80=A6 > E2BIG The buffer specified by size and attr is too small. > > EINVAL size is invalid; that is, it is smaller than the initial = version of the sched_attr structure (48 bytes) or larger than the system page size. > In fact, the original author of this commit got this bit right, and = the > bug was introduced when you modified their patch. >=20 > Please revert, and in the future be sure to obtain review from kernel > developers before making changes to the syscall layer. Yes, sometimes > patches go unreviewed for longer than we'd like, but that's not an > excuse to simply go ahead and commit if you aren't familiar with the > code being modified. If you're having trouble getting review, please > feel free to reach out to srcmgr@. I reverted the change in 32f5a9f3fb512908805901a1739383766417dd8d . I = hit ^C while the change was being pushed because I realize the branch = wasn=E2=80=99t clean (see 4abfb452ea2d18c4710dffee7f3e65167d543041), = which resulted in the revert commit being pushed to the repo, but = didn=E2=80=99t generate the commit email [3]. -Enji 1. I honestly think the Linux interface is overly complicated and that = welcomes security issues (like the ones you=E2=80=99re concerned with). = I was trying to implement it according to the spec/[Linux] source code = (the documentation contradicts itself [2], so I needed to refer to the = source code) in order to ensure the interface was compatible with Linux. 2. https://bugzilla.kernel.org/show_bug.cgi?id=3D222094 3. Why are emails generated synchronously as part of push operations = instead of asynchronously=E2=80=A6?= --Apple-Mail=_A0D475CB-DDA4-4AAD-9580-CD8F08041ADC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkHfexGRJ3gYRdA2gGpE5DjPsNJgFAmrFCOYACgkQGpE5DjPs NJi70g//UaizE4dkIc8y+EAu/3v6btZYqagbDWT8/UMB2oHtgyxM48fLIjdt+P19 uyEF5MM7n9I4L1nOPK5XHHw19ere7Jpxn4lXe9Qipn0+UusqTHT/nZMMxqfbuvED ACfGIlw50MmlFyb5ZXAMGVZlHpZEdQUGnYuu6HCVbcP/O+vvZjHb7iGaC9scV2XA GNzUp2Ah83cweJCcoCMCv05pngTWX0+Nu21MVVKnRQ+sNTVZK4kvzpcX7rEs1lsG kAGBtu12RoXIrquDkfYwiUi7BoVgDS9YIlJOs3Du3LwuVvVjL9Z9RUmj0MYp+ds3 hR1C52BoYOZZrRJcRTXrw0CLVgYi8aTv4A4+Z1Ev24SBSbaFj3e5BXOYwCKKcwg8 EBRA6HD74unRjvziNrxeHopSuBlcHIVW8+G/wcPH+jSQ50bH3INeD9VBkg3QsZtI RVs+Xkjj6A9z3l6a9v0Em5feVOc8dA8JZV4Xz6DtRt4PZ5M8Udh9BAehtaMuIJ29 Yyj80JPpc9NOYk/19hYjP+X61dxMFkifGRG5lTZlTLvYqPfEz0dvPKOYkx9/J761 M5Z8yCxD4nLEa0ZifXSoPh6tOje7H02v5JgpRMspX9dlg8VZaOK45TogI4IW6XJ+ 0Cx1NxbGcKtCLQA5a+1kvSs3uRG7EZWE4K4H/E71AVtrhemQQRU= =cQHh -----END PGP SIGNATURE----- --Apple-Mail=_A0D475CB-DDA4-4AAD-9580-CD8F08041ADC--