All of lore.kernel.org
 help / color / mirror / Atom feed
* uids in task_struct-Further Explaining the Problem
@ 2004-01-05 15:20 sena
  2004-01-06 19:35 ` Robin Holt
  0 siblings, 1 reply; 3+ messages in thread
From: sena @ 2004-01-05 15:20 UTC (permalink / raw)
  To: Robin Holt; +Cc: linux-kernel

Hi Robin,

Thank you very much for the previous advice and for your valuable time.

I thought of further explaining the problem to you.


At this stage linux kernel is calculating Load Averages. The major input 
of the calculation is number of running exe and  Runnables in the 
runnable Queue.

This is happening In timer.c
static unsigned long count_active_tasks(void) and

static inline void calc_load(unsigned long ticks)

What I am Trying:

What I am tryiing to do is to seperate the running exe and  Runnables 
according to the owner of those processes (Say 5 people have login and 
they run diffrent processes)

And then seperately calculate the Load Averages for those respective 
login users.


The Problems:

The task_struct has a uid field. I have used that field to seperate 
them. But the problem is when a child process is created by its parent 
then the child inherits  the uid of the parents. As a result the correct 
uid which is related to the username does not contain in that uid.

Example:

Say a computer has 5 user logins name1(500), name2(501), 
name3(502).........name5(504) apart from root. If these 5 people 
remotely login and runs there jobs, then the user name of those jobs are 
name1,name2 and name3.

Say if they use telnet to remotely login then those Tasks will be 
started under telnet server as children.

As the children inherits uid, euid etc of the parents. That means telnet 
is run as root and it inherits uid<500.

task_struct has uid and it is updated accordingly.


I have built the kernel 2.4.19sena1 successfully but this is my problem. 
The problem because child process inherits uid etc if I start any 
process through telnet


Thanks
Sena Seneviratne
Computer Engineering Lab
Sydney University


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: uids in task_struct-Further Explaining the Problem
  2004-01-06 19:35 ` Robin Holt
@ 2004-01-06  1:28   ` auntvini
  0 siblings, 0 replies; 3+ messages in thread
From: auntvini @ 2004-01-06  1:28 UTC (permalink / raw)
  To: Robin Holt; +Cc: linux-kernel

Hi Robin,

Thanks  for your reply.

Soon I will write explaining more about why I am not concerned about CPU 
usage which top gives.

Indeed you are correct and what I am after would be ps like correct uids. 
What I need is to connect(relate) them during the sampling time.

Then I will rename the variables in my code as advised by you.

Thanks

Sena Seneviratne
Computer Engineering Lab
Sydney University.

At 01:35 PM 1/6/2004 -0600, you wrote:
>On Tue, Jan 06, 2004 at 02:20:39AM +1100, sena wrote:
>Again, you have described what the problem is with your code and not
>the problem you are trying to solve.
>
>There are a couple solutions to the "Who has used what resource?"
>question.  The most prominent in my mind is a system accounting.
>This could be used to say which user consumed how much cpu/IO, etc.
>If that is the sort of information your are looking for (after the
>fact summary), then I would look to that direction.
>
>If, on the other hand, you are trying to see which users are consuming
>cpu resources, you might want to look at some of the top sorting
>information.
>
>I personally don't see the benefit to calculating a per-user load
>average, but maybe there is.
>
>As to euid and uid.  If ps -ef or ps -ale shows the correct uids, you
>should have no problem calculating on a per-user basis.  I would
>happily look at your source and try to give you pointers if that is
>what you ask for.  I won't be able to touch anything until tonight
>at the earliest.
>
>Thanks,
>Robin
>
> > Hi Robin,
> >
> > Thank you very much for the previous advice and for your valuable time.
> >
> > I thought of further explaining the problem to you.
> >
> >
> > At this stage linux kernel is calculating Load Averages. The major input
> > of the calculation is number of running exe and  Runnables in the
> > runnable Queue.
> >
> > This is happening In timer.c
> > static unsigned long count_active_tasks(void) and
> >
> > static inline void calc_load(unsigned long ticks)
> >
> > What I am Trying:
> >
> > What I am tryiing to do is to seperate the running exe and  Runnables
> > according to the owner of those processes (Say 5 people have login and
> > they run diffrent processes)
> >
> > And then seperately calculate the Load Averages for those respective
> > login users.
> >
> >
> > The Problems:
> >
> > The task_struct has a uid field. I have used that field to seperate
> > them. But the problem is when a child process is created by its parent
> > then the child inherits  the uid of the parents. As a result the correct
> > uid which is related to the username does not contain in that uid.
> >
> > Example:
> >
> > Say a computer has 5 user logins name1(500), name2(501),
> > name3(502).........name5(504) apart from root. If these 5 people
> > remotely login and runs there jobs, then the user name of those jobs are
> > name1,name2 and name3.
> >
> > Say if they use telnet to remotely login then those Tasks will be
> > started under telnet server as children.
> >
> > As the children inherits uid, euid etc of the parents. That means telnet
> > is run as root and it inherits uid<500.
> >
> > task_struct has uid and it is updated accordingly.
> >
> >
> > I have built the kernel 2.4.19sena1 successfully but this is my problem.
> > The problem because child process inherits uid etc if I start any
> > process through telnet
> >
> >
> > Thanks
> > Sena Seneviratne
> > Computer Engineering Lab
> > Sydney University
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: uids in task_struct-Further Explaining the Problem
  2004-01-05 15:20 uids in task_struct-Further Explaining the Problem sena
@ 2004-01-06 19:35 ` Robin Holt
  2004-01-06  1:28   ` auntvini
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Holt @ 2004-01-06 19:35 UTC (permalink / raw)
  To: sena; +Cc: Robin Holt, linux-kernel

On Tue, Jan 06, 2004 at 02:20:39AM +1100, sena wrote:
Again, you have described what the problem is with your code and not
the problem you are trying to solve.

There are a couple solutions to the "Who has used what resource?"
question.  The most prominent in my mind is a system accounting.
This could be used to say which user consumed how much cpu/IO, etc.
If that is the sort of information your are looking for (after the
fact summary), then I would look to that direction.

If, on the other hand, you are trying to see which users are consuming
cpu resources, you might want to look at some of the top sorting
information.

I personally don't see the benefit to calculating a per-user load
average, but maybe there is.

As to euid and uid.  If ps -ef or ps -ale shows the correct uids, you
should have no problem calculating on a per-user basis.  I would
happily look at your source and try to give you pointers if that is
what you ask for.  I won't be able to touch anything until tonight
at the earliest.

Thanks,
Robin

> Hi Robin,
> 
> Thank you very much for the previous advice and for your valuable time.
> 
> I thought of further explaining the problem to you.
> 
> 
> At this stage linux kernel is calculating Load Averages. The major input 
> of the calculation is number of running exe and  Runnables in the 
> runnable Queue.
> 
> This is happening In timer.c
> static unsigned long count_active_tasks(void) and
> 
> static inline void calc_load(unsigned long ticks)
> 
> What I am Trying:
> 
> What I am tryiing to do is to seperate the running exe and  Runnables 
> according to the owner of those processes (Say 5 people have login and 
> they run diffrent processes)
> 
> And then seperately calculate the Load Averages for those respective 
> login users.
> 
> 
> The Problems:
> 
> The task_struct has a uid field. I have used that field to seperate 
> them. But the problem is when a child process is created by its parent 
> then the child inherits  the uid of the parents. As a result the correct 
> uid which is related to the username does not contain in that uid.
> 
> Example:
> 
> Say a computer has 5 user logins name1(500), name2(501), 
> name3(502).........name5(504) apart from root. If these 5 people 
> remotely login and runs there jobs, then the user name of those jobs are 
> name1,name2 and name3.
> 
> Say if they use telnet to remotely login then those Tasks will be 
> started under telnet server as children.
> 
> As the children inherits uid, euid etc of the parents. That means telnet 
> is run as root and it inherits uid<500.
> 
> task_struct has uid and it is updated accordingly.
> 
> 
> I have built the kernel 2.4.19sena1 successfully but this is my problem. 
> The problem because child process inherits uid etc if I start any 
> process through telnet
> 
> 
> Thanks
> Sena Seneviratne
> Computer Engineering Lab
> Sydney University

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-07  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-05 15:20 uids in task_struct-Further Explaining the Problem sena
2004-01-06 19:35 ` Robin Holt
2004-01-06  1:28   ` auntvini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.