From nobody Thu Jan 11 01:25:01 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 4T9RmY3X4Cz56hCt; Thu, 11 Jan 2024 01:25:01 +0000 (UTC) (envelope-from git@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 4T9RmY2kp5z4TBP; Thu, 11 Jan 2024 01:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936301; 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; bh=ncvc1W1H0e4qVKLPA+HNHci+LZqH0g/ihXRCmaF4R8I=; b=SiQd5i41j8BlsCwjP275ffUqmJPHJHhGObfxGg4DTOSdGIY7yg8SnHQFpHj1a8VPf2mlrB 0+HhIpC8oMu/eqyueXQpxVIkJ+g053TSNsv/hwn/ycWoHOqWT0ONqBXbPo5GfQ9Xjjxsq7 U6MMjer06Zkov0FmV/Ttzg1Kb9PahG7bc9lL5jxoEj+k85FbfxXcCd4igimU2PmSJp08gM zOTluPGMpWDus7NBLs+CGj67pRLTI9zFqBqUYFynir1Bur3lzy4JlP9TXC40sWpJFysnfR ONU+letZKjwYseJ/vIquBHfG7fW1IeP/9NlZJsLWGEVmZ5JtCpWqXwjEN7RCuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704936301; 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; bh=ncvc1W1H0e4qVKLPA+HNHci+LZqH0g/ihXRCmaF4R8I=; b=oFTSiBCK/v+JNEUAG9yhON3HTUcbkyNtKEyxofytvMNhptO97t6X/UoKvDrZtJYxxRIPUo +I+WYX9jtL+m47H/NghbNkpPTrkHlmXQhXnE5dvjWcH4DqmTnUYeh3VKYaW103wCfbE9iM z5nfaKLktLDpMNCy6LBnwUKGeOpmggyAMBNJLwuUnSDrxvvcTmePmcm8GfmbDC6eI/QXsE zbvjQA9VXCqId2SA4uRDEkFWwEBRdr0sqd7YIBb8b7XzGqqwjeqiXDGzvqapp9RVo87ywd pzoxdyrVaR0PAIM2XhdXTFactb8dq3P1hvPJT43oX3O1mJFSIGyOV6L/Mpf2FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704936301; a=rsa-sha256; cv=none; b=p+fz6A+mvwYvhKDkfqi0FgTbYxk4CTcS7vKfRgVZmPBkzOWwqjKvFXuMBv1yi4Zkhpi/RE tYA88jW4zhvjL6n4f07AgJPA+TewZeXQWa6khNsFw5AmZQwb7jtTQhKVyaQY45Dmq6jHOL 8+QSa7YHjoTmqW/KOADAaS0aP8LqOXf5UDj6M6m/kO+fIhG8XcT+b2y8P22D2dlR6Ohoyw 7/nb0Feskqh+TRxciQ0rHzG0NZfdq89gUvy+cJIZI/+z+oDkoEoVkl4rp4aT/hM/mEWUQ1 /nim6AYI06xhnYXkS/dR/U+69XJ/xgviM0XyKSXDkWt1YcxEMdBxqJV5uY3FPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4T9RmY1qx8zywR; Thu, 11 Jan 2024 01:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B1P1io089287; Thu, 11 Jan 2024 01:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B1P1KN089284; Thu, 11 Jan 2024 01:25:01 GMT (envelope-from git) Date: Thu, 11 Jan 2024 01:25:01 GMT Message-Id: <202401110125.40B1P1KN089284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b4d11915c73f - stable/14 - intrng: switch from MAXCPU to mp_ncpus 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b4d11915c73f199501672b278be86e1f63790036 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b4d11915c73f199501672b278be86e1f63790036 commit b4d11915c73f199501672b278be86e1f63790036 Author: Elliott Mitchell AuthorDate: 2023-09-26 17:06:04 +0000 Commit: Ed Maste CommitDate: 2024-01-11 01:23:56 +0000 intrng: switch from MAXCPU to mp_ncpus MAXCPU could be on the large side, while the hardware may not have many processors at all. As such only allocate counters for processors which actually exist, rather than always allocating for the maximum potentially allowed number. Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D41462 (cherry picked from commit 2f0b059eeafc545a4ab1835d6a5290e1e2ebb47f) --- 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 6535c42f2404..49fe20cdc890 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. - * - MAXCPU counters for each IPI counters for SMP. + * - mp_maxid + 1 counters for each IPI counters for SMP. */ nintrcnt = intr_nirq * 2; #ifdef SMP - nintrcnt += INTR_IPI_COUNT * MAXCPU; + nintrcnt += INTR_IPI_COUNT * (mp_maxid + 1); #endif intrcnt = 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 MAXCPU contiguous counters, - * in practice. Interrupts will be allocated sequentially during boot, - * so the array should fill from low to high index. Once 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 mp_maxid + 1 contiguous + * counters, in practice. Interrupts will be allocated sequentially + * during boot, so the array should fill from low to high index. Once + * reserved, the 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, MAXCPU, &index); + bit_ffc_area(intrcnt_bitmap, nintrcnt, mp_maxid + 1, &index); if (index == -1) panic("Failed to allocate %d counters. Array exhausted?", - MAXCPU); - bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); - for (i = 0; i < MAXCPU; i++) { + mp_maxid + 1); + bit_nset(intrcnt_bitmap, index, index + mp_maxid); + for (i = 0; i < mp_maxid + 1; i++) { snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); intrcnt_setname(str, index + i); }