From nobody Sun Feb 12 09:47:15 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 4PF2h30LvYz3qSwQ; Sun, 12 Feb 2023 09:47:31 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 4PF2h22DQ8z3kdf; Sun, 12 Feb 2023 09:47:30 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of antoine.brodin.freebsd@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=antoine.brodin.freebsd@gmail.com; dmarc=none Received: by mail-lf1-f47.google.com with SMTP id v17so14956209lfd.7; Sun, 12 Feb 2023 01:47:30 -0800 (PST) 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:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a2bHPE+lk8nZCUO2/WEaQvW8lGV9sCErUkJCp1xX0cU=; b=PpaRpUkOHJx69red+0VYBCMp7ASznLj+ijHjtAJ0co4qrm+4xQn3nfoLDjFL2TAgk5 lO5SNilPE6picWDHeHPFrH650bhvjJVR1dvMU8Md3IoesHtA7jlZXGkqcfTH1x2/lQMt NY8DORFA4hfLHOzBf4V1vInPDnG6b9+JeitQ3Gr6uHklwgboHW4ckanaoA0U2B6dwn1S QgYD8pBMLI15Hw0W5gSshKxXnQpXJyG3W26V12Skl80CW4i99+UYP8CPjaFWX1kQkir9 GjiEbA41rELQPnvg/5HjQ0hn2S0lr9lAX06vEXvp2hLykj0m7uixAk5HpvvItoey890i xmRQ== X-Gm-Message-State: AO0yUKXBl6GZDycUdaJQw2Chb0Y8Jhis3KABQOvP6IU5qiI2/FZPfO+K 02hKz2Yl6AU9rBEr1yZZQE7lX79GwIdUmrOgDaENUxK6rzA= X-Google-Smtp-Source: AK7set+Ri60q2bpiKqo6jh0GDVvCk00DYw7Of+rxH2DG7120YknVD1dQF+gorbN+XRSBD5fw71Hm7C+tl4Oq+ey0HtU= X-Received: by 2002:ac2:431a:0:b0:4b5:5bf8:24fd with SMTP id l26-20020ac2431a000000b004b55bf824fdmr3444235lfh.187.1676195247496; Sun, 12 Feb 2023 01:47:27 -0800 (PST) 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 References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> In-Reply-To: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> From: Antoine Brodin Date: Sun, 12 Feb 2023 09:47:15 +0000 Message-ID: Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. To: Dmitry Chagin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-2.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; NEURAL_HAM_SHORT(-0.99)[-0.992]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.47:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.47:from]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4PF2h22DQ8z3kdf X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > The branch main has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > Author: Dmitry Chagin > AuthorDate: 2023-01-29 13:17:33 +0000 > Commit: Dmitry Chagin > CommitDate: 2023-01-29 13:17:33 +0000 > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > 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. > > 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. > > 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. > > 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(-) Hello, This broke math/py-numpy on main and stable/13 https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", line 93, in get_num_build_jobs cpu_count = len(os.sched_getaffinity(0)) OverflowError: could not allocate a large enough CPU set Cheers, Antoine