LWN.net Logo

Controlling memory use in containers

Controlling memory use in containers

Posted Aug 2, 2007 8:14 UTC (Thu) by Nick (subscriber, #15060)
In reply to: Controlling memory use in containers by balbir_singh
Parent article: Controlling memory use in containers

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.


(Log in to post comments)

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