From nobody Thu May 16 01:23:08 2024 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 4VfsmH1R7tz5KDLd; Thu, 16 May 2024 01:23:11 +0000 (UTC) (envelope-from karels@freebsd.org) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (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 (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VfsmG3Lwlz4WVM; Thu, 16 May 2024 01:23:10 +0000 (UTC) (envelope-from karels@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.18.1/8.18.1) with ESMTP id 44G1N8aG008209; Wed, 15 May 2024 20:23:08 -0500 (CDT) (envelope-from karels@freebsd.org) Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id 37eUNvxfRWYPIAAAs/W3XQ (envelope-from ); Wed, 15 May 2024 20:23:08 -0500 From: Mike Karels To: Zhenlei Huang Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: b827afb9e3a7 - releng/14.1 - Revert "intrng: switch from MAXCPU to mp_ncpus" Date: Wed, 15 May 2024 20:23:08 -0500 X-Mailer: MailMate (1.14r6028) Message-ID: <68191B25-A5CB-48CE-BD17-F5E7F95CF052@freebsd.org> In-Reply-To: <88AD738C-4E2C-430D-8AE1-D1C7A633B977@FreeBSD.org> References: <202405151635.44FGZxAS021246@gitrepo.freebsd.org> <88AD738C-4E2C-430D-8AE1-D1C7A633B977@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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Queue-Id: 4VfsmG3Lwlz4WVM On 15 May 2024, at 19:58, Zhenlei Huang wrote: >> On May 16, 2024, at 12:35 AM, Mike Karels wrote: >> >> The branch releng/14.1 has been updated by karels: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3Db827afb9e3a7aaaa2da7d10= 1c46881c646d4df2f >> >> commit b827afb9e3a7aaaa2da7d101c46881c646d4df2f >> Author: Mike Karels >> AuthorDate: 2024-05-14 22:44:58 +0000 >> Commit: Mike Karels >> CommitDate: 2024-05-15 16:35:38 +0000 >> >> Revert "intrng: switch from MAXCPU to mp_ncpus" >> >> This reverts commit b4d11915c73f199501672b278be86e1f63790036. >> This is a direct commit to stable/14. The change breaks booting >> on older Raspberry Pi 4's, although that works on main. The cause > > Emm, I think this revert affects other arch also. Does this have large = impact ? If yes, and only > older Paspberry Pi 4 is to be fixed, why not add conditional compile #i= f directive for Paspberry Pi 4 > instead ? That won't help with installations. We use one GENERIC config for arm64.= On the other hand, arm64 has 32K counters for interrupts and only 1K for IPI= s (with this reverted and MAXCPU at 1024), so this isn't that big an increm= ent. arm has MAXCPU of 4; riscv has 16. This reversion makes the outcome the = same as on 14.0. > For amd64 the MAXCPU has been bumped from 256 to 1024 [1]. That is larg= e IMO. This change does not affect amd64 or i386, just systems with INTRNG (arm,= arm64, and riscv). So the change is only significant on arm64. Mike > 1. 9051987e40c5 amd64: Bump MAXCPU to 1024 (from 256) > >> is unknown. The original commit should be redone on stable/14 >> if/when it catches up with main. >> >> (cherry picked from commit 3e627553bbd791a4f73eaeea2c2d795fd4e0ee70= ) >> >> Approved-by: re (cperciva) >> --- >> sys/kern/subr_intr.c | 22 +++++++++++----------- >> 1 file changed, 11 insertions(+), 11 deletions(-) >> >> diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c >> index 49fe20cdc890..6535c42f2404 100644 >> --- a/sys/kern/subr_intr.c >> +++ b/sys/kern/subr_intr.c >> @@ -175,11 +175,11 @@ intr_irq_init(void *dummy __unused) >> >> /* >> * - 2 counters for each I/O interrupt. >> - * - mp_maxid + 1 counters for each IPI counters for SMP. >> + * - MAXCPU counters for each IPI counters for SMP. >> */ >> nintrcnt =3D intr_nirq * 2; >> #ifdef SMP >> - nintrcnt +=3D INTR_IPI_COUNT * (mp_maxid + 1); >> + nintrcnt +=3D INTR_IPI_COUNT * MAXCPU; >> #endif >> >> intrcnt =3D mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, >> @@ -312,18 +312,18 @@ intr_ipi_setup_counters(const char *name) >> mtx_lock(&isrc_table_lock); >> >> /* >> - * We should never have a problem finding mp_maxid + 1 contiguous >> - * counters, in practice. Interrupts will be allocated sequentially >> - * during boot, so the array should fill from low to high index. Onc= e >> - * reserved, the IPI counters will never be released. Similarly, we >> - * will not need to allocate more IPIs once the system is running. >> + * We should never have a problem finding MAXCPU contiguous counters= , >> + * in practice. Interrupts will be allocated sequentially during boo= t, >> + * so the array should fill from low to high index. Once reserved, t= he >> + * IPI counters will never be released. Similarly, we will not need = to >> + * allocate more IPIs once the system is running. >> */ >> - bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); >> + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); >> if (index =3D=3D -1) >> panic("Failed to allocate %d counters. Array exhausted?", >> - mp_maxid + 1); >> - bit_nset(intrcnt_bitmap, index, index + mp_maxid); >> - for (i =3D 0; i < mp_maxid + 1; i++) { >> + MAXCPU); >> + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); >> + for (i =3D 0; i < MAXCPU; i++) { >> snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); >> intrcnt_setname(str, index + i); >> } > > Best regards, > Zhenlei