Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1395375

Re: [RFC PATCH] livepatch: allow removal of a disabled patch

From Jiri Kosina <jikos@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH] livepatch: allow removal of a disabled patch
Date 2016-05-05 23:10 +0200
Message-ID <rvyH0-7DX-7@gated-at.bofh.it> (permalink)
References (6 earlier) <rv7GN-7iY-7@gated-at.bofh.it> <rvmPE-4Dm-161@gated-at.bofh.it> <rvrvQ-MH-11@gated-at.bofh.it> <rvsrU-1xL-15@gated-at.bofh.it> <rvt4C-2cn-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 5 May 2016, Josh Poimboeuf wrote:

> I would disagree with the statement that the dynamic kobject doesn't
> scale.  We would just need a helper function to get from a kobject to
> its klp_patch.
>
> In fact, to me it seems like the right way to do it.  It doesn't make
> sense for the code which creates the kobject to be different from the
> code which initializes it.  It's slightly out of context, but
> kobject.txt does say:
> 
>   "Code which creates a kobject must, of course, initialize that object."
> 
> I view the completion as a hack to compensate for the fact that we're
> abusing the kobject interface.  And so it makes sense to me that
> CONFIG_DEBUG_KOBJECT_RELEASE would cause problems, because we're using
> kobjects in the wrong way.
> 
> So in my view, the two options are:
> 
> 1. Convert the kobject to dynamic as I described.
> 
> 2. Change the klp_register() interface so that klp_patch gets allocated
>    in livepatch code.
> 
> I'd be curious to hear what others think.

My understanding is that the concern here is that walking through the 
complete linked list every time sysfs node is accessed, just to figure out 
whether we're able to find a klp_patch entry that points back to the 
particular kobject that's being passed to the sysfs callback, isn't really 
super-efficient.

I personally wouldn't worry *that* much about that particular aspect 
(sysfs operations are hardly considered time critical anyway), but I'd 
have to think a bit more whether this is really safe wrt. deadlocks 
between kernfs locks and klp_mutex; but so far it seems to me that 
klp_mutex always nests below kernfs, so it should be OK.

Unfortunately, this still feels like a non-negligible (mis|ab)use of 
kobjects that could bite us later wrt. maintainability and general clarity 
of the code, and therefore tying klp_patch lifetime to (de)allocations 
from within livepatch code itself seems like much better idea to me.

Thanks,

-- 
Jiri Kosina
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-05-02 14:00 +0200
  Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-02 17:10 +0200
    Re: [RFC PATCH] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-05-03 10:20 +0200
  Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-03 23:40 +0200
    Re: [RFC PATCH] livepatch: allow removal of a disabled patch Jiri Kosina <jikos@kernel.org> - 2016-05-04 00:40 +0200
      Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-04 04:40 +0200
        Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-04 05:40 +0200
          Re: [RFC PATCH] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-05-04 14:00 +0200
            Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-04 15:20 +0200
              Re: [RFC PATCH] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-05-04 16:40 +0200
                Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-04 18:20 +0200
                Re: [RFC PATCH] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-05-05 10:30 +0200
                Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-05 15:30 +0200
                Re: [RFC PATCH] livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-05-05 16:30 +0200
                Re: [RFC PATCH] livepatch: allow removal of a disabled patch Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-05 17:10 +0200
                Re: [RFC PATCH] livepatch: allow removal of a disabled patch Jiri Kosina <jikos@kernel.org> - 2016-05-05 23:10 +0200
                Re: livepatch: allow removal of a disabled patch Jessica Yu <jeyu@redhat.com> - 2016-05-06 02:50 +0200
                Re: livepatch: allow removal of a disabled patch Miroslav Benes <mbenes@suse.cz> - 2016-05-06 10:00 +0200

csiph-web