Hey all, This is my second attempt at adding the initial simple memcg/ttm integration.
This varies from the first attempt in two major ways: 1. Instead of using __GFP_ACCOUNT and direct calling kmem charges for pool memory, and directly hitting the GPU statistic, Waiman suggested I just do what the network socket stuff did, which looks simpler. So this adds two new memcg apis that wrap accounting. The pages no longer get assigned the memcg, it's owned by the larger BO object which makes more sense. 2. Christian suggested moving it up a layer to avoid the pool business, this was a bit tricky, since I want the gfp flags, but I think it only needs some of them and it should work. One other big difference is that I aligned it with the dmem interaction, where it tries to get space in the memcg before it has even allocated any pages, I'm not 100% sure this is how things should be done, but it was easier, so please let me know if it is wrong. This still doesn't do anything with evictions except ignore them, and I've some follows up on the old thread to discuss more on them. Dave.