[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181214100232.elyqlnjyhp55acxf@pathway.suse.cz>
Date: Fri, 14 Dec 2018 11:02:32 +0100
From: Petr Mladek <pmladek@...e.com>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Jiri Kosina <jikos@...nel.org>, Miroslav Benes <mbenes@...e.cz>,
Jason Baron <jbaron@...mai.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Evgenii Shatokhin <eshatokhin@...tuozzo.com>,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v14 05/11] livepatch: Simplify API by removing
registration step
On Thu 2018-12-13 16:46:25, Josh Poimboeuf wrote:
> Now that we can't re-enable a patch, I wonder if we really need both the
> 'patch->enabled' and 'klp_target_state' variables?
>
> A patch is now always enabled, unless it's in transition, in which case
> its 'enabled' state is the same as 'klp_target_state'.
>
> For example I wonder if we could get rid of 'klp_target_state', since it
> should be the same as 'klp_transition_patch->enabled'.
There are some catches:
1. klp_update_patch_state() can be called anywhere and anytime. We
would add yet another race-sensitive code if we access the flag
via a pointer.
2. patch->enabled is bool while klp_target_state is triple state.
The argument is that KLP_UNDEFINED helps to catch bugs.
> Or alternatively we could get rid of 'patch->enabled', since it should
> be the same as
>
> patch == klp_transition_patch ? klp_target_state : true
This might solve the first catch but not the 2nd one. Not to say
that it is much harder to read.
> Of course this could be a follow-on cleanup patch, which could be done
> in the future, so as not to hold up the merging of these patches
> anymore.
Yes, please. This is controversial, non-trivial, and can wait.
Best Regards,
Petr
Powered by blists - more mailing lists