Messages in this thread | | | Date | Fri, 6 Apr 2018 17:07:23 -0500 | From | Josh Poimboeuf <> | Subject | Re: [PATCH 6/8] livepatch: Remove Nop structures when unused |
| |
On Fri, Mar 23, 2018 at 01:00:26PM +0100, Petr Mladek wrote: > Replaced patches are removed from the stack when the transition is > finished. It means that Nop structures will never be needed again > and can be removed. Why should we care?
Warning, grammar pedantry ahead.
"Nop" isn't a proper noun, so it shouldn't be capitalized (here and in the patch subject).
Also, "NOP", used elsewhere, might be confused with x86 NOP instructions. I would vote for "nop" everywhere.
> @@ -146,6 +155,21 @@ static void klp_complete_transition(void) > if (!klp_forced && klp_target_state == KLP_UNPATCHED) > module_put(klp_transition_patch->mod); > > + if (klp_transition_patch->replace && klp_target_state == KLP_PATCHED) { > + /* > + * We do not need to wait until the objects are really freed. > + * We will never need them again because the patch must be on > + * the bottom of the stack now. > + */ > + klp_free_objects_dynamic(klp_transition_patch); > + /* > + * Replace behavior will not longer be needed. Avoid the related > + * code when disabling and enabling again.
"not longer" -> "no longer"
-- Josh
| |