From nobody Sat Sep 10 19:51:36 2022 X-Original-To: dev-commits-src-main@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 4MQ3Qc2pJGz4brjr; Sat, 10 Sep 2022 19:51:36 +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 4MQ3Qc2NqRz3mhJ; Sat, 10 Sep 2022 19:51:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662839496; 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=JkzNI+RZ9FC6DSpwrAusFhlgiRnQWMrO4FMF3QBVRW0=; b=NYpreZ7nicncxwx0mNDvyV/Zijes0LGwZ/GMHr9rrDRaSlD2DVkdinKYCniwwzyRbZ0ZdE 1S7KjZIzhP3M5o7mW5sW/6FieUWHc65JYO6zHG0xy7FGxN49+XMKhLTKrZTr3RhrqU0pd9 Kulxr/dRKo3U6W5esD6lmnbUhe9mXFZnFazFf6IQm+S11BUhOCk8uRDZwSY49kyEvjB844 2lZbVhjla1jSOjFBQXTE/crDFHfn9lC8iK7tGeOvMALIWIVc1qZtw7gzFV7t6t7EXaOf9E ZlzfGr32afMeCmNT7KByOrcERlpGlfqp2RtJ5UDbERo5B3TyV4YIT/dhZKOIbQ== 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 4MQ3Qc1RbNzPjl; Sat, 10 Sep 2022 19:51:36 +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 28AJpal9043732; Sat, 10 Sep 2022 19:51:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28AJpaho043731; Sat, 10 Sep 2022 19:51:36 GMT (envelope-from git) Date: Sat, 10 Sep 2022 19:51:36 GMT Message-Id: <202209101951.28AJpaho043731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: a2ad70923f59 - main - Add branch prediction hints to getsock_cap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2ad70923f591a2e6f1ca7766ae7d1aa14e70d11 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662839496; 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=JkzNI+RZ9FC6DSpwrAusFhlgiRnQWMrO4FMF3QBVRW0=; b=JkEyhhofDZmFSSIaBDHb9VWo1tbLUQop3BUSNlmYlCgABnqR38eYiy8V3nQTkFflNpYZ6I l/iT5dYRtjxTh9JuQuYzVWM2CM6nM2r19dH5RVVv1SVDvtxTyErz82LvMe4697tbgzVRCM 93rlzJ7LV3+Rhn7mJ/agU0Y0aV2opr27x3/0bJlY7LT7f2vMPZpknT2VexHjYflRzcLn1I zELZh0g2B7HXhd3vaFxWbYnWUnHgq9uout52NHrE3zeySq+jKJ+N8qQWOa7APTBHdlYzp0 iKIMmX8g7s32B2zhvHfC0Eb0w0X6EiF06RfLmjWR6lOjz4JtmNy4Z829dF7yRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662839496; a=rsa-sha256; cv=none; b=KWwuaMBTaZuEySzgYxd4wVxugXKY1V/457oaKWutk5QlAwuialXiOxNWgKoqaTRvCJzqf5 3Nqa6fm0hyLMLH+gECyWpjyDLtqj1RMxHWA68Mk2abE3aQJGmYEMlkTulcfts+Oj2akVkn kWXP2kmMbMrhEi9WyaZ4oL+uOCKXZcFeJq/Drea/EH98f7LdxXer622W6YrznWTUFqxGr/ AJ2hRAQBJX10cQqH84G+wtnrxiAkQrBRmAo3GgG/NV4pA16E6cT4EiQOn8MN2wkseeIINi NJfYOd5WYy1oOqJoXH7cwY9mV3WqXVlkCPY0KaPsL7OP5xm5NvutXdB0JcdVQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a2ad70923f591a2e6f1ca7766ae7d1aa14e70d11 commit a2ad70923f591a2e6f1ca7766ae7d1aa14e70d11 Author: Mateusz Guzik AuthorDate: 2022-09-10 19:41:34 +0000 Commit: Mateusz Guzik CommitDate: 2022-09-10 19:41:52 +0000 Add branch prediction hints to getsock_cap --- sys/kern/uipc_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 4be1c9aa6a59..e77475992d0b 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -96,9 +96,9 @@ getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, int error; error = fget_cap(td, fd, rightsp, &fp, havecapsp); - if (error != 0) + if (__predict_false(error != 0)) return (error); - if (fp->f_type != DTYPE_SOCKET) { + if (__predict_false(fp->f_type != DTYPE_SOCKET)) { fdrop(fp, td); if (havecapsp != NULL) filecaps_free(havecapsp);