Skip to contentSkip to conversation

SMP skas requirements

uml-devel Jeff Dike 3 participants 5 messages Mar 29, 2006 – Mar 31, 2006 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw
Quoted 2 lines · Blaisorblade

Since you've now split out delete-hostfs, why don't you merge the new hostfs, possibly labeling it as "EXPERIMENTAL"?

My two main gripes right now are
there are three filesystems (or one framework and two
filesystems) in one directory
it depends on filehandle, which has aspects that neither of us likes

Quoted 3 lines

Btw, there's a ton of other patches which I don't see reasons for not merging like Al Viro's cleanups (I've given a look to them and they seem safe).

Just sent in today.

Quoted 1 line

And is punctuaction_fixes likely to cause instability?

No, but I recall that you didn't really like it.

Quoted 2 lines

Finally, I'd like to get devshm merged if there aren't problems with the code.

That one needs to check if /dev/shm is present, and fall back to /tmp if not.

Quoted 3 lines

Don't know how do you implemented it this time, but since we had special read/write functions for filehandles, the get_fh() and put_fh() could be simply put in their body. Has this changed?

No, but you didn't like those (and I agree) because of the extra layering they added.

Quoted 7 lines
Quoted 6 lines

In this case, get_fh should just increment a count, put_fh should decrement it, and the only list operation should be to move it to the end of the list so it's last to be reclaimed. The reclaimer would not reclaim filehandles with non-zero counts. I see no point in removing it from the list and adding it back, as that seems not to protect against anything.

Quoted 7 lines

You need a spinlock on the list. With the non-reference-counted approach, removing that from the list allowed dropping the spinlock over the I/O call on the host. That's not needed with the refcount.

With the refcount, likely you don't need to move it off-list, but that could maybe be useful to avoid looping on unused fd; however, this requires taking the spinlock when reinserting the element on the list.

I think you're agreeing with me, but I'm missing why we want to move things on and off the list.

Quoted 3 lines

Instead, with the refcount, if you decrease to 0 the refcount of FH_1 while a reclaim loop is iterating over FH_1, you only risk that FH_1 is missed on that reclaim pass, which isn't a race.

Yup.

Quoted 16 lines

Note: testing that a fd has refcount 0 must be done atomically with freeing it; i.e. even with an atomic_t refcount, it must be incremented only while you have a lock on the list; and while freeing it, you must use atomic_dec_and_lock() so you get a lock on the list if the refcount goes to 0 (atomic_dec_and_lock() is equivalent to taking the lock, doing dec and test, and releasing it, but is faster).

get_fh() {
	spin_lock(&list_lock);
	<iterate on list>
	atomic_inc(fd->count); //while still holding the lock!!
	if (atomic_read(fd->count) <= 0)
		BUG();
	spin_unlock(&list_lock);
}
Quoted 6 lines

put_fh(pointer to fd on list "fd") {

	if(atomic_dec_and_lock(fd->count, &list_lock)) {
		//Here we have the lock!
		//Remove the thing from list and free it
	}
}

Yes, this looks reasonable.

Quoted 5 lines
Quoted 2 lines

You're envisioning the os_* interfaces calling back into filehandle.c to get a descriptor if needed?

To cause fd reclaim, that's what I mean (not sure if you meant the same).

Yes.

Quoted 3 lines

I suggested last time to rename this as "make_reclaimable" (or set_reclaimable), is_reclaimable() sounds as an interrogation method.

Fine by me.

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw

Quoting Jeff Dike <[email protected]>:

Quoted 6 lines · Blaisorblade
Quoted 2 lines

Finally, I'd like to get devshm merged if there aren't problems with the code.

That one needs to check if /dev/shm is present, and fall back to /tmp if not.

Are you proposing that virtual servers automatically using /dev/shm if available and only falling back to the $TMP variable and /tmp directory if not? Or would this keep the use of $TMP if present and fall back to /dev/shm followed by /tmp?

I'm asking because I've optimized multiple host machines to offer a ramfs for virtual servers. This gives me locked memory (which still provides a significant performance improvement over time) for each instance. I would prefer to avoid using tmpfs if possible.

Alternatively, some means for preventing the host from swapping out instances would be appreciated.

Tony

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw
Quoted 5 lines · Anthony Brock

Quoting Jeff Dike <[email protected]>:

Quoted 3 lines · Blaisorblade
Quoted 2 lines

Finally, I'd like to get devshm merged if there aren't problems with the code.

Quoted 7 lines
Quoted 2 lines

That one needs to check if /dev/shm is present, and fall back to /tmp if not.

Are you proposing that virtual servers automatically using /dev/shm if available and only falling back to the $TMP variable and /tmp directory if not? Or would this keep the use of $TMP if present and fall back to /dev/shm followed by /tmp?

By looking at:
http://user-mode-linux.sourceforge.net/work/current/2.6/2.6.16/patches/devshm

Quoted 7 lines

I'm asking because I've optimized multiple host machines to offer a ramfs for virtual servers. This gives me locked memory (which still provides a significant performance improvement over time) for each instance. I would prefer to avoid using tmpfs if possible.

Alternatively, some means for preventing the host from swapping out instances would be appreciated.

ramfs is the better way IMHO.

Signature · 20 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive 
http://it.messenger.yahoo.com



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#3 lore raw
Quoted 5 lines · Blaisorblade
Quoted 4 lines · Anthony Brock

Quoting Jeff Dike <[email protected]>:

Quoted 3 lines · Blaisorblade
Quoted 2 lines

Finally, I'd like to get devshm merged if there aren't problems with the code.

(Jeff wrote):

Quoted 2 lines
Quoted 2 lines

That one needs to check if /dev/shm is present, and fall back to /tmp if not.

I'd add that it needs to retry even if the PROT_EXEC test fails:

*) if TMP, TEMP or TMPDIR are set, use that and fail if the check fails, abort, because the user wanted to use that but forgot to change permissions.

*) if instead we pick /dev/shm but it has not PROT_EXEC, we should switch to /tmp and fail only then.

Quoted 8 lines
Quoted 4 lines

Are you proposing that virtual servers automatically using /dev/shm if available and only falling back to the $TMP variable and /tmp directory if not? Or would this keep the use of $TMP if present and fall back to /dev/shm followed by /tmp?

By looking at:
http://user-mode-linux.sourceforge.net/work/current/2.6/2.6.16/patches/devs
hm

Sorry, forgot to finish. That patch keeps checking TMP,TMPDIR and TEMP (don't remember the order), but if none is set, it switches the default from /tmp to /dev/shm.

Signature · 23 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#4 lore raw
Quoted 6 lines · Blaisorblade

Sorry, forgot to finish. That patch keeps checking TMP,TMPDIR and TEMP (don't
remember the order), but if none is set, it switches the default from /tmp
to /dev/shm.

This makes sense. It does appear that the patch first checks the environmental variable before using the defaults. While I would like to take advantage of the neat feature Jeff is working on (hot plug memory), I have a greater need for consistent and reliable speed.

Thanks!

Tony

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel