Re: [PATCH 1/3] Fix coding style

2007-09-25 Thread Dhaval Giani
On Tue, Sep 25, 2007 at 09:16:20PM +0200, Ingo Oeser wrote:
> On Tuesday 25 September 2007, Srivatsa Vaddagiri wrote:
> > Index: current/kernel/sched_debug.c
> > ===
> > --- current.orig/kernel/sched_debug.c
> > +++ current/kernel/sched_debug.c
> > @@ -239,11 +239,7 @@ static int
> >  root_user_share_read_proc(char *page, char **start, off_t off, int count,
> >  int *eof, void *data)
> >  {
> > -   int len;
> > -
> > -   len = sprintf(page, "%d\n", init_task_grp_load);
> > -
> > -   return len;
> > +   return sprintf(page, "%d\n", init_task_grp_load);
> >  }
> >  
> >  static int
> > @@ -297,7 +293,7 @@ static int __init init_sched_debug_procf
> > pe->proc_fops = &sched_debug_fops;
> >  
> >  #ifdef CONFIG_FAIR_USER_SCHED
> > -   pe = create_proc_entry("root_user_share", 0644, NULL);
> > +   pe = create_proc_entry("root_user_cpu_share", 0644, NULL);
> > if (!pe)
> > return -ENOMEM;
> 
> What about moving this debug stuff under debugfs?
> Please consider using the functions in  .
> They compile into nothing, if DEBUGFS is not compiled in
> and have already useful functions for reading/writing integers
> and booleans.
> 
Hi Ingo,

This is not debug stuff. It is a tunable to give the root user more
weight with respect to the other users.

-- 
regards,
Dhaval
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] Fix coding style

2007-09-25 Thread Kyle Moffett

On Sep 25, 2007, at 15:16:20, Ingo Oeser wrote:

On Tuesday 25 September 2007, Srivatsa Vaddagiri wrote:

@@ -297,7 +293,7 @@ static int __init init_sched_debug_procf
pe->proc_fops = &sched_debug_fops;

 #ifdef CONFIG_FAIR_USER_SCHED
-   pe = create_proc_entry("root_user_share", 0644, NULL);
+   pe = create_proc_entry("root_user_cpu_share", 0644, NULL);
if (!pe)
return -ENOMEM;


What about moving this debug stuff under debugfs?  Please consider  
using the functions in .  They compile into  
nothing, if DEBUGFS is not compiled in and have already useful  
functions for reading/writing integers and booleans.


Umm, that's not a debugging thing.  It appears to be a tunable  
allowing you to configure what percentage of the total CPU that UID 0  
gets which is likely to be useful to configure on production systems;  
at least until better group-scheduling tools are produced.


Cheers,
Kyle Moffett

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] Fix coding style

2007-09-25 Thread Ingo Oeser
On Tuesday 25 September 2007, Srivatsa Vaddagiri wrote:
> Index: current/kernel/sched_debug.c
> ===
> --- current.orig/kernel/sched_debug.c
> +++ current/kernel/sched_debug.c
> @@ -239,11 +239,7 @@ static int
>  root_user_share_read_proc(char *page, char **start, off_t off, int count,
>int *eof, void *data)
>  {
> - int len;
> -
> - len = sprintf(page, "%d\n", init_task_grp_load);
> -
> - return len;
> + return sprintf(page, "%d\n", init_task_grp_load);
>  }
>  
>  static int
> @@ -297,7 +293,7 @@ static int __init init_sched_debug_procf
>   pe->proc_fops = &sched_debug_fops;
>  
>  #ifdef CONFIG_FAIR_USER_SCHED
> - pe = create_proc_entry("root_user_share", 0644, NULL);
> + pe = create_proc_entry("root_user_cpu_share", 0644, NULL);
>   if (!pe)
>   return -ENOMEM;

What about moving this debug stuff under debugfs?
Please consider using the functions in  .
They compile into nothing, if DEBUGFS is not compiled in
and have already useful functions for reading/writing integers
and booleans.

Best Regards

Ingo Oeser
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] Fix coding style

2007-09-25 Thread Srivatsa Vaddagiri
Fix coding style issues reported by Randy Dunlap and others

Signed-off-by : Dhaval Giani <[EMAIL PROTECTED]>
Signed-off-by : Srivatsa Vaddagiri <[EMAIL PROTECTED]>

---
 init/Kconfig |   14 +++---
 kernel/sched_debug.c |8 ++--
 2 files changed, 9 insertions(+), 13 deletions(-)

Index: current/init/Kconfig
===
--- current.orig/init/Kconfig
+++ current/init/Kconfig
@@ -282,11 +282,11 @@ config CPUSETS
  Say N if unsure.
 
 config FAIR_GROUP_SCHED
-   bool "Fair group cpu scheduler"
+   bool "Fair group CPU scheduler"
default y
depends on EXPERIMENTAL
help
- This feature lets cpu scheduler recognize task groups and control cpu
+ This feature lets CPU scheduler recognize task groups and control CPU
  bandwidth allocation to such task groups.
 
 choice
@@ -294,11 +294,11 @@ choice
prompt "Basis for grouping tasks"
default FAIR_USER_SCHED
 
-   config FAIR_USER_SCHED
-   bool "user id"
-   help
- This option will choose userid as the basis for grouping
- tasks, thus providing equal cpu bandwidth to each user.
+config FAIR_USER_SCHED
+   bool "user id"
+   help
+ This option will choose userid as the basis for grouping
+ tasks, thus providing equal CPU bandwidth to each user.
 
 endchoice
 
Index: current/kernel/sched_debug.c
===
--- current.orig/kernel/sched_debug.c
+++ current/kernel/sched_debug.c
@@ -239,11 +239,7 @@ static int
 root_user_share_read_proc(char *page, char **start, off_t off, int count,
 int *eof, void *data)
 {
-   int len;
-
-   len = sprintf(page, "%d\n", init_task_grp_load);
-
-   return len;
+   return sprintf(page, "%d\n", init_task_grp_load);
 }
 
 static int
@@ -297,7 +293,7 @@ static int __init init_sched_debug_procf
pe->proc_fops = &sched_debug_fops;
 
 #ifdef CONFIG_FAIR_USER_SCHED
-   pe = create_proc_entry("root_user_share", 0644, NULL);
+   pe = create_proc_entry("root_user_cpu_share", 0644, NULL);
if (!pe)
return -ENOMEM;
 


-- 
Regards,
vatsa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/