Live-Patching Archive mirror
 help / color / mirror / Atom feed
From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Song Liu <song@kernel.org>, Petr Mladek <pmladek@suse.com>
Cc: Song Liu <songliubraving@meta.com>,
	"live-patching@vger.kernel.org" <live-patching@vger.kernel.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Kernel Team <kernel-team@meta.com>
Subject: Re: [PATCH] livepatch: match symbols exactly in klp_find_object_symbol()
Date: Fri, 16 Jun 2023 09:23:59 +0800	[thread overview]
Message-ID: <3307943c-c842-ea52-d7b8-2f704139e645@huawei.com> (raw)
In-Reply-To: <CAPhsuW5TZPzzFefZ=d1OjVY7yBqge0XBnS9UE2xCWnoLmwj_Og@mail.gmail.com>



On 2023/6/16 0:58, Song Liu wrote:
> On Tue, Jun 13, 2023 at 8:16 AM Petr Mladek <pmladek@suse.com> wrote:
>>
> 
> [...]
> 
>>
>> I agree that it is a slow path.
>>
>> Well, Zhen put a lot of effort into the optimization. I am not sure
>> what was the primary motivation. But it would be harsh to remove it
>> without asking.
>>
>> Zhen, what was the motivation for the speedup of kallsyms, please?
>>

If a large number of functions are modified, livepatch may fail. In some
actual scenarios(business), the patch needs to be activated within a limited time.

> 
> I took a closer look at the code. kallsyms_on_each_match_symbol()
> is only used by livepatch. So indeed it doesn't make sense to drop
> all the optimizations by Zhen.

Yes, if CLANG has special requirements, it can be specially addressed.
I was thinking about CLANG, and I'll take a closer look at the current problem.

> 
> I got another solution for this. Will send it shortly.
> 
> Thanks,
> Song
> 
>>
>>> OTOH, this version is simpler and should work just as
>>> well.
>>
>> Sure. But we should double check Zhen's motivation.
>>
>> Anyway, iterating over all symbols costs a lot. See also
>> the commit f5bdb34bf0c9314548f2d ("livepatch: Avoid CPU hogging
>> with cond_resched").
> .
> 

-- 
Regards,
  Zhen Lei

      reply	other threads:[~2023-06-16  1:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 23:24 [PATCH] livepatch: match symbols exactly in klp_find_object_symbol() Song Liu
2023-06-05 16:39 ` Josh Poimboeuf
2023-06-09  7:09 ` Petr Mladek
2023-06-09 16:35   ` Song Liu
2023-06-13 15:16     ` Petr Mladek
2023-06-15 16:58       ` Song Liu
2023-06-16  1:23         ` Leizhen (ThunderTown) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3307943c-c842-ea52-d7b8-2f704139e645@huawei.com \
    --to=thunder.leizhen@huawei.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=song@kernel.org \
    --cc=songliubraving@meta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).