From nobody Tue May 16 04:11:00 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 4QL2pr4QpZz4BVTj; Tue, 16 May 2023 04:11:00 +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 4QL2pr3qvGz3v9T; Tue, 16 May 2023 04:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684210260; 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=Ctq3J7rPx9pR08C2uBPBmJQi3DsaHoFEXVV7zv/XawM=; b=lH9ikkJpqGjL21V9BeVl6TsZArt4FeaiAYJ0cMveQVkKr1fSOs9YXdwmZeo0q6c5+GdVwB jC0SBG1mSl5su0kwj9KyIPzKoIGiEmjrIbM8kM0+vD6ogM0C23YZMwL//T2Vni69F6MxpX i+sfEQ7EsouzNvHgC6X4R4osrOCJGMwOu4jsnIHQP1q3r/nC9LcDVh5Vrp6d//rIaWFPAX GeL0Brwk+LRNLQmEgsv69+FVC67CjtW3q7sUkX37yxqE6uXIXGhuWJi+DPAjdLrqlRo+3o BP5XYRlDNtVfWdUDn+N25jJylEb/ZyF4cQGYmrfx9mDgVqq4WoJphTg0aVDQOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684210260; 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=Ctq3J7rPx9pR08C2uBPBmJQi3DsaHoFEXVV7zv/XawM=; b=YS33IA7WAWdwdqFhtRNbRjXZpBE33GivCof+urGSZ2Ei6ip+/IMq6f60RGu+lfr5IknJcD Qafm3d0bkOs7rNiJwbkD4b3OzANAFEfFFd3lFyX0SsNHJiC3z9eoPU/L1h/sLCK7PFgx8L oQ7yEasBM0+VxXfhd2jeJcLYZHNCXVFcpCH7ygfTCqRZPMD4eArC4GJwAgA/ygRneq1vLy FtsCmsl922YEM3ITBu3etj7IJCcjJK/hFPsixBsdMcxtb7j+Cr/pE1zEiB2XsZ0LBqSIoD AZYSUhwoL6+49vsEagCf/u1zR7c02r+3p81CtWZMxryeIcH8of0Tq9fHcRYthg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684210260; a=rsa-sha256; cv=none; b=Rfu3HnhIrN9OtMaJ7pjSqquKbmExxkmAjbxBPYRN6A/f8SfOiugO4HgErOc6tMMNCN9C3Q +BglqI4lC2POxoe6oW0I2uZEhHSSmPCwKlnC7ft/IhyPzPX4a0Rm6gu1L58xx+jtqaJiMp U2Ge7xm4tvOEcFpd8ewxaByuD7CFiMv5+kUaQAW8t8alXllpPocaQmXpoYZONEC/iAl2K/ vaF0ozOiwxoIiW11sj0CBJYThlPrOhLvi8BmlB4M1QkyPKa4cXjHpVDcasekfxDXkBApzI +IZeVpIaI3tJSOC417urGNlpGPYY1BwMt0p/6CXpZZQOw/WhGgjm/wN5aFntTQ== 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 4QL2pr2thwz16qv; Tue, 16 May 2023 04:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34G4B0IE001932; Tue, 16 May 2023 04:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34G4B04U001931; Tue, 16 May 2023 04:11:00 GMT (envelope-from git) Date: Tue, 16 May 2023 04:11:00 GMT Message-Id: <202305160411.34G4B04U001931@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b9ca790637fc - stable/13 - quiesce_cpus(): do not overallocate generation array 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b9ca790637fc25b2d2a190cd925ec2e6cb0db683 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b9ca790637fc25b2d2a190cd925ec2e6cb0db683 commit b9ca790637fc25b2d2a190cd925ec2e6cb0db683 Author: Konstantin Belousov AuthorDate: 2023-05-05 20:21:38 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-16 04:03:37 +0000 quiesce_cpus(): do not overallocate generation array (cherry picked from commit ccc6b87b3825a235991d978e43d29431e012461f) --- sys/kern/subr_smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 7b250aeccc56..401d54277669 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -975,7 +975,8 @@ quiesce_cpus(cpuset_t map, const char *wmesg, int prio) error = 0; if ((prio & PDROP) == 0) { - gen = malloc(sizeof(u_int) * MAXCPU, M_TEMP, M_WAITOK); + gen = mallocarray(sizeof(u_int), mp_maxid + 1, M_TEMP, + M_WAITOK); for (cpu = 0; cpu <= mp_maxid; cpu++) { if (!CPU_ISSET(cpu, &map) || CPU_ABSENT(cpu)) continue;