[OpenAFS-devel] Re: [OpenAFS] 2.6 kernel support anytime soon?Workarounds?

Douglas E. Engert deengert@anl.gov
Tue, 11 May 2004 16:37:15 -0500


Jeffrey Hutzelman wrote:
> 
> On Tuesday, May 11, 2004 15:32:20 -0500 "Douglas E. Engert"
> <deengert@anl.gov> wrote:
> 
> > If push comes to shove, (as it appears it has!) could the AFS
> > code in effect shadow the process table (or task_struct), so when a
> > request is needed if it has not seen this process before, it will look at
> > the parent  and on up the chain to find a process it has seen that has a
> > "PAG".
> 
> This is on the right track, but unfortunately, it's nowhere near that
> simple.  I have code lying around somewhere that does a pretty decent job
> at keeping track of PAGs without modifying setgroups.  Besides using the
> supplementary group list, it also uses a private per-process table, a magic
> open file descriptor, and will walk the chain from parent to parent looking
> for a pag.
> 
> Unfortunately, that's not enough.  Processes can fork. 

I am looking at Linux-2.6.6 and in the task_struct there is a
field called start_time. It appears to be set only once,
in the kernel.fork.c 

  p->start_time = get_jiffies_64(); 

I speculate that this can be used as a marker to see if the 
task is the same task as has seen before or one that has been 
reallocated at the same location. 

> They can become disconnected from their parents. 

That could be a problem if they then tried to access AFS the PAG 
could not be found. But is this only in some error situation?
How often do you see process A get a PAG, then start process B
then process A ends, and Process B then tries to access AFS?
Or A with a PAG starts B that starts C, B ends then C tries
to access AFS. 

A process has to have some parent.What is the parent of C 
at this time? Is it 1 or is it A. If its A then we mightr need
to require the proces that got the PAG to stay active. I know it ugly. 
   

> They can change their groups.  They can
> close files.  Worst, they can do all of these things at once.  The problem
> is not easy to solve if the OS does not give you the hooks you need to
> detect process creation and destruction.  Linux presently does not offer
> those hooks.

I beleve the start_time could be use to differentiate between 
a new task_struct allocated at the same locaiton as the previous location. 

> 
> > In Linux 2.6 the address of the task_struct and its start_time
> > might be all that needs to be shadowed along with some garbage
> > collection.
> 
> I have no interest in remembering the address of a data structure that does
> not know that I have a reference to it.

But the situation looks desperate, This calls for new thinking.  

An AFS routine may only have to look at its current task_structure, and the
shadow table. If the start_time does not match then it has been recreated. 

A GC might have to run the task list to see which shadow table entries are 
still active and cleanup the shadow table. 

-- 

 Douglas E. Engert  <DEEngert@anl.gov>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444