LWN.net Logo

Advertisement

E-Commerce & credit card processing - the Open Source way!

Advertise here

Controlling memory use in containers

Controlling memory use in containers

Posted Aug 2, 2007 2:58 UTC (Thu) by Nick (subscriber, #15060)
Parent article: Controlling memory use in containers

struct meta_page is a horrible name! struct page is already "meta-page",
and meta_page isn't really metadata about the struct page, it is just more
metadata about the page which is broken out so as to minimise overhead.


(Log in to post comments)

Controlling memory use in containers

Posted Aug 2, 2007 6:12 UTC (Thu) by balbir_singh (subscriber, #34142) [Link]

Yes, I agree, that page is indeed metadata. But, the idea behind meta_page is that it metadata associated with page. Do you think a direct name like container or meta_container sounds better? I was hoping that we could use meta_page to extend struct page to things beyond just containers in the future. That would require some refactoring of-course.

Controlling memory use in containers

Posted Aug 2, 2007 8:14 UTC (Thu) by Nick (subscriber, #15060) [Link]

Heh, this is a very appropriate forum for discussing patches ;)

Some more direct name like struct page_container sounds nicer
to me, yes. I wouldn't worry about how to add different types
of extra page data yet. It is going to be yet more costly, so
I would just tackle that if/when it comes up:

eg. struct page_extra {
struct page_container *pc;
struct something_else *blah;
};

While you're here: do you think you could look at not using up a
page flag for locking, please? As you're adding a new pointer in
struct page, then you might be able to use the low bit or two of
that guy as flags. This even gives you the advantage that you can
use a non-atomic store to unlock, once I get my bitops patches in,
as long as the word it isn't subject to concurrent modifications
when it is locked.

Controlling memory use in containers

Posted Aug 2, 2007 9:48 UTC (Thu) by balbir_singh (subscriber, #34142) [Link]

I find this forum very interesting as well :-)

I am in agreement on the naming convention and using the low bit for locking sounds like a good idea! I hope no-one complains about readability. I'll explore your suggestions further.

Controlling memory use in containers

Posted Aug 2, 2007 16:22 UTC (Thu) by iabervon (subscriber, #722) [Link]

I think container_page is better than page_container, since it's information for the container subsystem about pages, and not a struct that contains pages.

Controlling memory use in containers

Posted Aug 3, 2007 6:01 UTC (Fri) by balbir_singh (subscriber, #34142) [Link]

That naming convention would make sense if were referring to the page from the container. Since we do it reverse (from page to container), page_container sounds better.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds