From nobody Fri Jul 26 16:52:29 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 4WVv1p0vvkz5Qwfm; Fri, 26 Jul 2024 16:52:30 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVv1p0SXHz4HPt; Fri, 26 Jul 2024 16:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722012750; 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=WB5iob5woWbwRGthnQPBzPv10P3Be7MMLGwM3q3SAQQ=; b=dUl0P3/wSpsucdRP0dL89H+yRZfF93izNTZI8ZUFoGKAFTEZ8H1Pvp/WE3NIjm1IsuV1K0 VIM/hECnyWVfMccyUmkS6KS64AV+p1hCTgp9ao5qBTrCJQiRdRe2C5/5Xkz0Zf/TQZMBOQ y7pb8hy5ileZKzLu0LvjvQkE3Cj9MZQ5Q8oAvfaXMxLYSw/w7NYi7cAAMn2dJX/wICwZaK FcYEi8sq0xGczU+h/hrXosASfHGxG5FBW43t4qEfAgkIPF0Boock0t+Dz86//EDTWk2d9u A8AHwnZVfZcPlATI47fQ4V0YTBu7lYJySvIKZoWCrAW6BcvA528TGRc9zV4wBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722012750; a=rsa-sha256; cv=none; b=ki+8JIuy+50dMVL3GJkgNo+SPmT9WAVP0ZFFIjl+qSzItxgObSGTa9xWiS00Foz3rR3DXi nW85sajhx04jIHe9kj6Sq4gwfAJi1oLMpjtHN5DBSQItP4BpbUJJkMSi8d/mmrDLE8g9QK 6ckKRI0JDAoxng8YI11OMBrIOoqu3dhSZ/yMsfCEIMHT3hu0zdx7MpSx9xIyDCCAYJhWlz xM+B2slRevV1FPJ9G3nIjI/eu1rAjG1bD1dIh7rh5c9i7PYjPHcrw68KDZEekj+rlNIVTJ WS0eDfwfqMyT1J1pHKLqioHAze4DFR5q34nkhLoYIL4UajbZl36foTNzQrdJNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722012750; 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=WB5iob5woWbwRGthnQPBzPv10P3Be7MMLGwM3q3SAQQ=; b=xNqV6OXMMsAWSjXmP9zuG6ep/5ZtsQHRw7vuvoKbR3/WjOW5Yr3FdtHNCaKWXVnjYjal5r CtOH0iZ/AUSY3JSej45ClnzLbdHe34D1RnR7/FJ4O/XroDv3XdP63uLyYywmY/0qTUPo03 nT+gNSRC0FH5nrichfYYGITAbLdNYocSVLcAXc5+rcFK+gJsh7vOQlh9/MnIRwmG6k91pe asCCWm/bF2ASKJWgKUX0CTgyw9wADrS/ZyJidupbR/0G4TJeDYjg1Ocon8HxIiEizaNDba J6sC1AhxnAjzu4+FGDp2dDZeafZOSG5S1MXvxQSSNamav+UaapJr7Za7iV2dgA== 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 4WVv1n72P8zXYb; Fri, 26 Jul 2024 16:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QGqToZ010130; Fri, 26 Jul 2024 16:52:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QGqTFI010127; Fri, 26 Jul 2024 16:52:29 GMT (envelope-from git) Date: Fri, 26 Jul 2024 16:52:29 GMT Message-Id: <202407261652.46QGqTFI010127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 1d897d19f31d - main - netisr: avoid ffs(0) 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; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d897d19f31dd6d0411eb01ac4695e1c6aa8836a Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=1d897d19f31dd6d0411eb01ac4695e1c6aa8836a commit 1d897d19f31dd6d0411eb01ac4695e1c6aa8836a Author: Doug Moore AuthorDate: 2024-07-26 16:51:17 +0000 Commit: Doug Moore CommitDate: 2024-07-26 16:51:17 +0000 netisr: avoid ffs(0) A rearrangement to avoid computing ffs(0) saves 128 bytes in resulting amd64 object code. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D41254 --- sys/net/netisr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/netisr.c b/sys/net/netisr.c index 8c44d112a4e3..4ae1aa9ab89d 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -968,8 +968,8 @@ swi_net(void *arg) nwsp->nws_flags |= NWS_RUNNING; nwsp->nws_flags &= ~NWS_SCHEDULED; while ((bits = nwsp->nws_pendingbits) != 0) { - while ((prot = ffs(bits)) != 0) { - prot--; + while (bits != 0) { + prot = ffs(bits) - 1; bits &= ~(1 << prot); (void)netisr_process_workstream_proto(nwsp, prot); }