Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container interface to nsproxy subsystem

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Srivatsa Vaddagiri
Date: Thursday, April 5, 2007 - 5:43 am

On Thu, Apr 05, 2007 at 02:29:32AM -0700, Paul Menage wrote:

Yep.


Yep, that would be abnormal too. I think the issues are similar here wrt
shared pages too? So whatever is the consensus on shared page
accounting (is there one?), should apply here maybe ..


/me looks at his current patch stack and doesnt find that anymore.


No it should be 1.

	mkdir H1/foo
		rcfs_create()
		   ns = dup_namespaces(parent);

		    ....
		   dentry->d_fsdata = ns;

ns should have a refcount of 1 to begin with.


it should push the recount to 2.


It should bring the refcount back to 1 and hence put_nsproxy() shouldnt
be called.


Yes, dup_namespaces returns with a refcount of 1 (which should cover
dentry reference to it).



	- refcount of a nsproxy attached to a directory dentry can never
	  fall to zero because of tasks coming in and out. The only
	  way for the refcount of such nsproxies to fall to zero and
	  hence trigger their destruction is thr' the rmdir i/f.

	- New nsproxies derived from the base directory nsproxy
	  can have their's refcount go to zero as tasks exit or move
	  around and hence they will be destroyed.

Does that sound like correct behavior?


Lets go back to the f_bc example here for a moment. Lets say T1 was in C1 and 
opened file f1. f1->f_bc points to C1->beancounter.

T1 moves from C1 -> C2, but f1 is not migrated. 
C1->beancounter.count stays at 1 (to account for f1->f_bc).

File f1 is closed. C1->beancounter.count becomes zero.

Now user issues rmdir C1. If rmdir finds (after taking manage_mutex that
is)

	- zero tasks in C1
	- zero refcount in C1->beancounter

why is it not safe to assume that C1->beancounter.count will continue to
stay zero?

Basically I am struggling to answer "How can a zero refcount (beancounter) 
object go non-zero when zero tasks are attached to it" ..

If that is the case, ->can_destroy can simply return 0 if it finds
->beancounter.count == 0 else returns -EBUSY. Provided we had checked
for zero tasks prior to calling ->can_destroy, it should be safe to
assume no new ref counts will take place on ->beancounter.count ??


Precisely. This is what I outlined above in the example. I personally
prefer ->can_destroy because it is simpler and only those subsystems
that have this problem need to support it. On a hierarchy where all
subsystems attached don't have a can_destroy callback, then rmdir just
collapses to a "zero task count check" ..

-- 
Regards,
vatsa
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Fri Mar 23, 10:05 pm)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Sat Mar 24, 9:23 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Wed Mar 28, 7:55 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Fri Mar 30, 7:47 pm)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Mon Apr 2, 7:27 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Eric W. Biederman, (Mon Apr 2, 11:02 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 7:16 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 9:10 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 9:16 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 9:46 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 10:11 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 10:30 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 10:34 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 10:51 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 8:07 pm)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Tue Apr 3, 10:15 pm)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Wed Apr 4, 10:26 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Wed Apr 4, 10:42 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Wed Apr 4, 11:39 pm)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Wed Apr 4, 11:46 pm)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Thu Apr 5, 1:49 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Thu Apr 5, 5:43 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Thu Apr 5, 7:13 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Thu Apr 5, 7:46 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Thu Apr 5, 9:57 am)
Re: [ckrm-tech] [PATCH 7/7] containers (V7): Container int ..., Srivatsa Vaddagiri, (Thu Apr 5, 10:14 am)