From nobody Sun Jul 07 13:16:21 2024 X-Original-To: dev-commits-doc-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 4WH7794Pb2z5Pf1T for ; Sun, 07 Jul 2024 13:16:21 +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 4WH7793fMhz4jDR; Sun, 7 Jul 2024 13:16:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720358181; 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=bP8nPBbdiwZzplEWIjHhT+dqsweqr/M3O/zYMcYDpH0=; b=NcOJWPCRSlm0nwgWNys8/CZr0dz1Cpugrx+OTkOjUdIBqLaMhxGPhpBtFjaWpQ3aoba8A4 koSUGgwCmrKpn4hAUvA+p/ref3Iv3MPrdSlTASGHqUYpxHS8IuFn8268mHIbCxPNmALR+6 oCFCgMfdU1gcgA9pCfaN0+5pAps4FmLPpVJPEbxfZwcSsbMAMJb6wf3edvkJ0p3iEnCe8P /0rPSoviO5GciAgz7fLKvZd+gInKFacSKtq7qHc/id9KlxY9q0PZH4Ewh2TQ4hZAn37xNq ImZK3XhZYS7CQdKrfLe35P+TtJ/y6qgiLF+p9C8ML3HXFQoDHTsL5xOiAd/kow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720358181; a=rsa-sha256; cv=none; b=M1HcBR59DlltRri/iXfgUpUYPUAiAQEo24xS20SCiSSW2o3cNz/9BmDwnmuQllh4HvzEea 2nfv8RX2JrUrpTWXD5ArS4xwhs6lyRczYJ1PdAWcQntD4O7ztU+jjENrpBDGnCa3LMRrMo 62fhsZY+GcA1Eqc+NAZjQJk/Uv96x9LwXY3GqF8dYsvpxv5RjGSCJxqr+PZAdy6tgzzwLD 62D9POZSHfI6BfMHhLj77vHlLxj0e8Sd4eWt6jC90TxHtcT1RO46pWx2MU/HjDih539GIR fzsd6ErDd3epBnB/avUerqGschGPAzr4N71gK3zd13Zut+FzZyvqY3EJOBwQaw== 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=1720358181; 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=bP8nPBbdiwZzplEWIjHhT+dqsweqr/M3O/zYMcYDpH0=; b=Z5TKcV30HbEuIDahbogaGZJDh9to3h5jFzXWBCTVrl+OSKQzdz9tpI1q3EM+ZQIknN3Hjg 72sO0ClKkVwjcbfUK454AVlVn3BCYvnSQYbv/eDT0oaY9RjnwNMh77mnTdlVMeJBq3kyS1 gTARJvGPFYGanSv9DojItkf/hnrSZoxrSMmCbjA/599ndIopLMXYgOreDg/8xI3IZ2OJBK 5A5R9Tkqi8NfrRm9srBYbadcpcQ33Bc82aTvsdrjdJniAyd20uN7rMumKmOvazMwXQ75rw akgaASVGJAz27A+3hBEJOoizh2/gOQ6AqPYRgbmZAiEo0M2EGr6xCQ6Xyd+6mg== 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 4WH7793880z1P95; Sun, 7 Jul 2024 13:16:21 +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 467DGLOF010326; Sun, 7 Jul 2024 13:16:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467DGLi4010323; Sun, 7 Jul 2024 13:16:21 GMT (envelope-from git) Date: Sun, 7 Jul 2024 13:16:21 GMT Message-Id: <202407071316.467DGLi4010323@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Lorenzo Salvadore Subject: git: 76186d25a4 - main - Status/2024Q2/zcond.adoc: Add report List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: salvadore X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76186d25a4627438dae2403a108d7866d0c9b0ef Auto-Submitted: auto-generated The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/doc/commit/?id=76186d25a4627438dae2403a108d7866d0c9b0ef commit 76186d25a4627438dae2403a108d7866d0c9b0ef Author: Marko Vlaić AuthorDate: 2024-07-07 13:14:15 +0000 Commit: Lorenzo Salvadore CommitDate: 2024-07-07 13:16:05 +0000 Status/2024Q2/zcond.adoc: Add report --- website/content/en/status/zcond.adoc | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/website/content/en/status/zcond.adoc b/website/content/en/status/zcond.adoc new file mode 100644 index 0000000000..c9fefeb27a --- /dev/null +++ b/website/content/en/status/zcond.adoc @@ -0,0 +1,43 @@ +=== A low-cost conditional execution mechanism + +Links: + +link:https://wiki.freebsd.org/SummerOfCode2024Projects/ZeroCostConditionalExecutionMechanism[FreeBSD wiki] URL: https://wiki.freebsd.org/SummerOfCode2024Projects/ZeroCostConditionalExecutionMechanism[] + + +Contact: Marko Vlaić +Contact: Bojan Novković (mentor) + +This project aims to implement a low-cost conditional execution mechanism, similar to the `static_key` interface in Linux. +The current working name is `zcond`, as in zero-cost conditional. +The idea is to reduce the overhead of rarely used features in performance sensitive kernel code paths. +Specifically, code blocks of the following, simple structure, are targeted: + +[source, c] +---- +if(some_global_flag == true) { + do_some_additional_task(); +} +---- + +A block like this can cause performance overhead in a frequently executed piece of code. + +The motivating use case for the mechanism is tracing (as outlined here in the link:https://wiki.freebsd.org/SummerOfCodeIdeas#Unified_kernel_tracing_interface[wiki]), but the project will identify more areas where this mechanism could be applied. + +The backbone of the mechanism is runtime instruction hot patching, making it highly architecture dependent. +Great care has to be given to security, because kernel instructions are overwritten at runtime. +More details and some implementation ideas can be found in the project proposal on the link:https://wiki.freebsd.org/SummerOfCode2024Projects/ZeroCostConditionalExecutionMechanism[project wiki page]. +More documents describing the implementation and design decisions will be produced, as the project moves along. + +The goal of the project is to produce a working implementaion of the mechanism for the x86-64 architecture. +It will then be applied to an existing piece of kernel code and benchmarked. +If the benchmark results come out positive, it will be ported to other architectures. + +This project is a part of the link:https://summerofcode.withgoogle.com/[Google Summer of Code 2024.]. +The project is still in its early stages, but any feedback would be highly appreciated. + +==== Help wanted +* General feedback on the mechanism, API and implementation +* More use cases besides tracing are welcome +* Code review +* Name suggestions + +Sponsor: Google LLC (GSoC 2024)