diff mbox

Tunables for 2.23?

Message ID 20160108022037.GC4698@two.firstfloor.org
State New
Headers show

Commit Message

Andi Kleen Jan. 8, 2016, 2:20 a.m. UTC
I finally tracked down now why the tunables patchkit disabled elision
on x86. The register function always calls the set function with
an empty string, and atoi returns 0 for that.

That results in all the elision configuration variables being
zeroed.

With this patch -- avoiding calling set_func for empty strings --
the tunables work as expected for me on x86.

-Andi

Comments

Siddhesh Poyarekar Jan. 8, 2016, 5:45 a.m. UTC | #1
On Fri, Jan 08, 2016 at 03:20:37AM +0100, Andi Kleen wrote:
> diff --git a/tunables/tunables.c b/tunables/tunables.c
> index 6e5aaa9..e8a5690 100644
> --- a/tunables/tunables.c
> +++ b/tunables/tunables.c
> @@ -182,7 +182,7 @@ tunable_register (tunable_id_t id, tunable_setter_t set_func, char **envp)
>    tunable_t *cur = &tunable_list[id];
>  
>    cur->set = set_func;
> -  if (cur->val != NULL)
> +  if (cur->val != NULL && *cur->val)
>      {
>        set_func (cur->val);
>        cur->initialized = true;
> 
> 

Thanks, someone (Dmitry Levine, or was it Aureliene Jarno?) had
pointed this out to me at the Cauldron last year and I had fixed it in
my local copy.  I'll push my updated patches today, which should have
this change.

Siddhesh
diff mbox

Patch

diff --git a/tunables/tunables.c b/tunables/tunables.c
index 6e5aaa9..e8a5690 100644
--- a/tunables/tunables.c
+++ b/tunables/tunables.c
@@ -182,7 +182,7 @@  tunable_register (tunable_id_t id, tunable_setter_t set_func, char **envp)
   tunable_t *cur = &tunable_list[id];
 
   cur->set = set_func;
-  if (cur->val != NULL)
+  if (cur->val != NULL && *cur->val)
     {
       set_func (cur->val);
       cur->initialized = true;