Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp75526lqr; Tue, 4 Jun 2024 22:05:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWllygLZQtEglVkOKBxPKoRp+lKhhGrAHWaYLTV96A6M6fMOhutDEqh8jQEm2P3uIZDX0wIe2lAMMeHJVlYjqg7zpc9bs32VHHD5LV9aw== X-Google-Smtp-Source: AGHT+IHkkHIMZJhM3jnSerWxTrkofw9A8wfwCVA4XdIor/NpzscWbdBQ6meASs7dBNA4UQnO7qyv X-Received: by 2002:a05:6214:498b:b0:6ad:5c79:b0e7 with SMTP id 6a1803df08f44-6b02bfa2c5emr16475386d6.40.1717563902349; Tue, 04 Jun 2024 22:05:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717563902; cv=pass; d=google.com; s=arc-20160816; b=YjElXCKEecK030iwlZofaGpl7yi3cTaBI5q6+V2VUVgW/3VVKttF/zH6E0jkZUGtZM yW7ntO4sDTrV8qcJiOAWfq/5oyx5+v2lT+9lLfF24YFKDLLMYdfWjsXcGaSsXVpzLKlB l+QoOIiYYi+2SLj4bO+NL4XB7kLZWnBZbkoYMLC8k5ymIUiEXQX7/kqXihokSUhqQ546 1V3VwOsJBEGnDkpPunk1O8/xazuFYeLZCZKgVMGBTWNMN+TsHrWA+WZIl0Uu8yH7FjJ4 S9vhAfV0PKuvGkkTIl7ZYGPX0AcmAEgKMakNFeM9L1DS5lAaAxnnPM/BCQm66lULcKik /T/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=wFfyOcCE4PH6+Tpl9K4iyZhL/W4v3eizo9MFSVLjCyw=; fh=XY0i3ItKT52z4p5gJ9WqXlOykUBvbmcT7FWZrW6kFpc=; b=NRb7TwtI83JFcOOd2LFVFqSuyb92idgFrrjdbualA352PFUbIJ4lefYAXyyWh5YlC6 zNYSASafLa80HGrbAuho57frmB8o/DuQ2RAefmiQ+4NhnITLI7As35MyNonq4MIcAKRA 30LnYJUXF/Dlv2ULZul1kMA26fqT6Bim09JYhKoq7NhrDtCQbExR80aAeuTkjPeIXPUm ltFjvbPqsii0cv/+R2fb2Fzlb7vCxIC6BgdqEh3FzchSNCS3piUcqx20FPcZRIENlCwm eOheo8E6Uj0gDIXSbz0N2bbiOOddT+pyjVD2/GrqviZEHLYNtM0HarZq8ZWrH0tke9kw WfVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BO4uEPH9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b43e688si118626866d6.601.2024.06.04.22.05.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 22:05:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BO4uEPH9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 092C71C21D0C for ; Wed, 5 Jun 2024 05:05:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E4D913AD05; Wed, 5 Jun 2024 05:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BO4uEPH9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9872D139D1A; Wed, 5 Jun 2024 05:04:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717563896; cv=none; b=H5zlKuN5bsm8GzztBeufreGfod2POOuE0lNNoT4k5ve2Pi2eG4aZCvnkov3j8YSrQuPhbjtha0/wUiYh2+7HAuSgW1t44d9RYzJaP9Nk1QRaLhe4x6qXB3bJ4/1Ph4Lx5YZ0zaJI3ACA+/50DS4WbhHhHGMNJQvYGnkCNSnm71A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717563896; c=relaxed/simple; bh=ugc2bykqt55t/VwJ9UCKNtxoLh62vpOWsbk3df+1xH8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=M1nUqoiTcXfHO1bPLEkHugfxmp2pnTjb+L51mWXfNNRafGFGgB80seCTdGm56jYmojVkqAZkFvl6pFeOKwe0GVh04+4ZPkjlrmZsQlTRTmotzfvnaiqJy+ctssIWAAmSaIwzatfhkE912rsgOG8Z0AbFmNxiOnHPqSIS3j24bWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BO4uEPH9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6FCEC4AF09; Wed, 5 Jun 2024 05:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717563895; bh=ugc2bykqt55t/VwJ9UCKNtxoLh62vpOWsbk3df+1xH8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BO4uEPH9S30Q36KtXilbFbS7FpqzfCeJ79caSMleuh8nfMIv6JUxQJd+gZ7VJYdIY laBjeK9YxSe7E15T7h8ECyGaurxGgpSmjlYjPX61L7kDrmikTK21GfsH/P/HqFSYXU 2Jl0MsENBgcqJa5f0QsFh6f7JzwF5V405WtixWokfk7HEgPzNmb264JZo7+nT9hDnl qZakvgykeL/Kx9nIoiH+BiwG9dWQdAy2M8ZgD4BF2N5l6qpWtUdA6kqX9pEe83JtNP oqt//3qVw5RB7jxiBr328wbHCGJ5NxD9ni5DzihtKGhqDqf4ll3+1MP7YRKVgeLWby f+7MCmZygiBJQ== Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-52b840cfecdso2203703e87.3; Tue, 04 Jun 2024 22:04:55 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUwpxo/1BD+5ej7Cb52Vio/btF9aY5fS+ovpu/fChhh95gdRwoQNQXdrRfPToWup9OPsLo0Aya3lgTItLyPvLvGVWd59RdUmUtCRMbljh3cxuzPKuDLxbwO6J4baaS8ftiU7JrBvv1gYSvSRQ== X-Gm-Message-State: AOJu0YwtSbsjsqHLxfoX4nRNIpj0JMnqG23R6UN5brD+X8hdqzKuctmS XpgXueqOFn6ppoVs/N3A8B3PRyqFC5jtiCAX81IXZg33Oaf+vfipD7RiGX/Fvz+udBvlwgQ8cfV bGd8QtK4NkyVEZfBpL2bAuPVyHWY= X-Received: by 2002:a05:6512:402a:b0:520:9df8:f245 with SMTP id 2adb3069b0e04-52bab4c8f5emr1090876e87.1.1717563894277; Tue, 04 Jun 2024 22:04:54 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240520005826.17281-1-zhangwarden@gmail.com> In-Reply-To: From: Song Liu Date: Tue, 4 Jun 2024 22:04:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] livepatch: introduce klp_func called interface To: Petr Mladek Cc: Miroslav Benes , zhang warden , Josh Poimboeuf , Jiri Kosina , Joe Lawrence , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 21, 2024 at 1:04=E2=80=AFAM Petr Mladek wrot= e: [...] > > > > Yes, but the information you get is limited compared to what is availab= le > > now. You would obtain the information that a patched function was calle= d > > but ftrace could also give you the context and more. > > Another motivation to use ftrace for testing is that it does not > affect the performance in production. > > We should keep klp_ftrace_handler() as fast as possible so that we > could livepatch also performance sensitive functions. At LPC last year, we discussed about adding a counter to each klp_func, like: struct klp_func { ... u64 __percpu counter; ... }; With some static_key (+ sysctl), this should give us a way to estimate the overhead of livepatch. If we have the counter, this patch is not needed any more. Does this (adding the counter) sound like something we still want to pursue? Thanks, Song