July 2008 Archives

I now have some working code for my dirhash dynamic memory allocation Google Summer of Code project. It is currently being reviewed and needs further testing, but if you're feeling brave you can grab a patch against HEAD from my project page on the FreeBSD wiki.

What the new code does is add an event handler for vm_lowmem events. When one of these events happens, the kernel will try to delete dirhashes that have not been used for DH_RECLAIMAGE seconds. This is currently set to five seconds, but I have no idea if this will be an optimal time. A bit of benchmarking and testing will be necessary to sort that out. If all dirhashes have been used more recently than DH_RECLAIMAGE, instead the first unlocked dirhash on the TAILQ list used to keep track of them all will be deleted. Due to how the existing dirhash code organizes this list based on a scoring system, the first hash on the list should be a mix of the the least recently used and least frequently used.

If my code turns out to work as it should, then the default maximum memory for dirhash can be safely increased quite a bit. If the system has plenty of spare memory, then lots will be available for dirhashes. Then if the system becomes low on memory, some of this dirhash memory will automatically be freed up for use by whatever else needs it. Hopefully we'll see some performance improvements overall on systems with lots of memory that need to deal with large directories, but I haven't done the benchmarks yet.

Back Home in Stockholm

|

I returned home to Stockholm nearly two weeks ago, but haven't managed to find time to post anything since then. It's good to be home. I missed Emma a great deal and it has been wonderful to get to spend time with her again. The weather is quite nice, though we've had some humid and rainy days. I don't mind those so much though. The amount of sunlight is amazing! In the middle of the night the sky is still bright if you look north, and it's pretty much fully daylight here by around three in the morning.

I have a new apartment in Lappkärrsberget, or Lappis, a big student neighborhood north of Stockholm University. Yesterday was my second trip to Ikea to finish getting furniture for the new place. The room is a little smaller than the one I had previously, but much cheaper and quite cute. Emma and my good friend Heydar also live in Lappis so I can visit them or they me with just a couple of minutes walk instead of a 30-45 minute trip by bike or Tunnelbana. I have a road right out my window but it is usually fairly quiet, and there are lots of trees to look at. A bunch of cows have been brought in to a nearby field, so I get to listen to them mooing too! I'll take some pictures of the new apartment soon.

My sister and her husband came to visit from Washington DC shortly after I returned from SF. They spent a couple of days with me in Stockholm and that was pretty fun. They then went on to Helsinki, St. Petersburg, and Tallinn before they come back here in a sort of loop around the Baltic Sea. Emma and I are getting on the ferry to Tallinn tonight to meet up with them and we'll all come back to Stockholm together in a couple of days. I am excited for the trip. I love the big Baltic ferries/party boats. And I've never been to Estonia, nor did I ever even think about it before I came to Sweden.

Oh, yesterday I bought an iPhone, now that they are finally available legitimately in Sweden. It's quite cool, though it was annoying how I couldn't get iTunes to connect to Apple's servers for several hours yesterday to finish setting the thing up. I love new toys. I'm now locked into a two year abonnemang with Telia, so I guess I will be staying in Sweden for awhile!

Archives