Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2023 18:19:54 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        dchagin@heemeyer.club, antoine@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. (Just a fixed TO: address.)
Message-ID:  <7CF460A7-C6BD-4494-8C11-0542D61F8F72@yahoo.com>
In-Reply-To: <A97A1A5B-8646-4C22-8ACC-0E0CBD285851@yahoo.com>
References:  <FB916FCB-BCF1-4C0C-A1B0-A0EC125E2191@yahoo.com> <18263DB1-D79D-420A-9F24-EE8C8E071C15@yahoo.com> <A97A1A5B-8646-4C22-8ACC-0E0CBD285851@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 13, 2023, at 16:47, Mark Millard <marklmi@yahoo.com> wrote:

> On Feb 12, 2023, at 22:05, Mark Millard <marklmi@yahoo.com> wrote:
>=20
>> [Just a fixed TO: address.]
>>=20
>>>> On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote:
>>>>> On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin =
<dchagin@heemeyer.club> wrote:
>>>>>>=20
>>>>>> On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote:
>>>>>>> On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote:
>>>>>>>> On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin =
<dchagin@freebsd.org> wrote:
>>>>>>>>>=20
>>>>>>>>> The branch main has been updated by dchagin:
>>>>>>>>>=20
>>>>>>>>> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3Dc21b080f3dc2f5e91ada608d4385b7ed=
6538ba9b
>>>>>>>>>=20
>>>>>>>>> commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b
>>>>>>>>> Author: Dmitry Chagin <dchagin@FreeBSD.org>
>>>>>>>>> AuthorDate: 2023-01-29 13:17:33 +0000
>>>>>>>>> Commit: Dmitry Chagin <dchagin@FreeBSD.org>
>>>>>>>>> CommitDate: 2023-01-29 13:17:33 +0000
>>>>>>>>>=20
>>>>>>>>> cpuset: Fix sched_[g|s]etaffinity() for better compatibility =
with Linux.
>>>>>>>>>=20
>>>>>>>>> Under Linux to sched_[g|s]etaffinity() functions the value =
returned from a call
>>>>>>>>> to gettid(2) (thread id) can be passed in the argument pid. =
Specifying pid as 0
>>>>>>>>> will set the attribute for the calling thread, and passing the =
value returned
>>>>>>>>> from a call to getpid(2) (process id) will set the attribute =
for the main thread
>>>>>>>>> of the thread group.
>>>>>>>>>=20
>>>>>>>>> Native cpuset(2) family of system calls has "which" argument =
to determine how
>>>>>>>>> the value of id argument is interpreted, i.e., CPU_WHICH_TID =
is used to pass
>>>>>>>>> a thread id and CPU_WHICH_PID - to pass a process id.
>>>>>>>>>=20
>>>>>>>>> For now native sched_[g|s]etaffinity() implementation is wrong =
as uses "which"
>>>>>>>>> CPU_WHICH_PID to pass both (process and thread id) to the =
kernel. To fix this
>>>>>>>>> adding a new "which" CPU_WHICH_TIDPID intended to handle both =
id's.
>>>>>>>>>=20
>>>>>>>>> Reviewed by: kib
>>>>>>>>> Differential Revision: https://reviews.freebsd.org/D38209
>>>>>>>>> MFC after: 1 week
>>>>>>>>> ---
>>>>>>>>> lib/libc/gen/sched_getaffinity.c | 2 +-
>>>>>>>>> lib/libc/gen/sched_setaffinity.c | 2 +-
>>>>>>>>> lib/libc/sys/cpuset.2 | 4 +++-
>>>>>>>>> sys/kern/kern_cpuset.c | 42 =
+++++++++++++++++++++++++++++++++++++++-
>>>>>>>>> sys/sys/cpuset.h | 1 +
>>>>>>>>> 5 files changed, 47 insertions(+), 4 deletions(-)
>>>>>>>>=20
>>>>>>>>=20
>>>>>>>> Hello,
>>>>>>>>=20
>>>>>>>> This broke math/py-numpy on main and stable/13
>>>>>>>>=20
>>>>>>>> =
https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p5=
2768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log
>>=20
>> Well, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a
>> 1400079 [2023-02-08..2023-02-10] jail that is using new KBI
>> material not in the older kernel (CPU_WHICH_TIDPID) have problems? :
>>=20
>> =3D>> Building math/py-numpy
>> build started at Fri Feb 10 11:40:51 UTC 2023
>> port directory: /usr/ports/math/py-numpy
>> package name: py39-numpy-1.24.1,1
>> building for: FreeBSD main-amd64-default-baseline-job-04 14.0-CURRENT =
FreeBSD 14.0-CURRENT 1400079 amd64
>> maintained by: python@FreeBSD.org
>> Makefile ident:=20
>> Poudriere version: 3.2.8-23-ga7f8d188
>> Host OSVERSION: 1400073
>> Jail OSVERSION: 1400079
>> Job Id: 04
>>=20
>> !!! Jail is newer than host. (Jail: 1400079, Host: 1400073) !!!
>> !!! This is not supported. !!!
>> !!! Host kernel must be same or newer than jail. !!!
>> !!! Expect build failures. !!!
>>=20
>>=20
>>>>>>>> =
https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-basel=
ine/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log
>>=20
>> Similarly, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running =
a
>> 13.2-PRERELEASE 1301511 [2023-01-10..2023-02-10] jail that is using =
new
>> KBI material not in the older kernel (CPU_WHICH_TIDPID) have =
problems? :
>>=20
>> =3D>> Building math/py-numpy
>> build started at Fri Feb 10 10:36:27 UTC 2023
>> port directory: /usr/ports/math/py-numpy
>> package name: py39-numpy-1.23.5_1,1
>> building for: FreeBSD 13stable-amd64-quarterly-baseline-job-01 =
13.2-PRERELEASE FreeBSD 13.2-PRERELEASE 1301511 amd64
>> maintained by: python@FreeBSD.org
>> Makefile ident:=20
>> Poudriere version: 3.2.8-23-ga7f8d188
>> Host OSVERSION: 1400073
>> Jail OSVERSION: 1301511
>>=20
>>=20
>>=20
>> (Looks to me like CPU_WHICH_TIDPID use for 13.* has to
>> require 13.2+ .)
>=20
> (I should have used "some CPU_WHICH_TIDPID use" and the
> like in various places.)
>=20
> I got my environment to be 140079 (everywhere) with ports
> updated to be have py39-numpy be at 1.24.1,1 . My
> poudriere-devel build result was:
>=20
> [00:25:52] [01] [00:00:00] Building math/py-numpy@py39 | =
py39-numpy-1.24.1,1
> [00:28:39] [01] [00:02:47] Finished math/py-numpy@py39 | =
py39-numpy-1.24.1,1: Success
>=20
> (It built 47 other ports first to get ready for that.)
>=20
> FYI:
>=20
> # uname -apKU
> FreeBSD amd64_ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT #60 =
main-n260797-dc1b8c9a846e-dirty: Thu Feb  9 22:17:26 PST 2023     =
root@amd64_ZFS:/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.a=
md64/sys/GENERIC-NODBG amd64 amd64 1400079 1400079
>=20
> Looks to me like, if the ABI incompatibilities are to
> stay as they are, then the FreeBSD build servers need an
> update for HOST OSVERSION to be more modern in order to
> avoid having odd problems with building some ports.
>=20

Now I question what happens for going the other way,
imagine:

HOST OSVERSION: 1400079
Jail OSVERSION: 1301000 for 13.1-RELEASE-p6

Might this change the behavior of 13.1-RELEASE-p6 port
build activity based on the live kernel using the new
CPU_WHICH_TIDPID related behavior? Is something
translating things to get the old behavior for such a
combination?

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7CF460A7-C6BD-4494-8C11-0542D61F8F72>