On Thu, 2014-10-16 at 10:10 -0700, Alexander Duyck wrote: > So if a page is used twice we are double counting the page size for the > socket then, is that correct? I just want to make sure because prior to > this patch both flows did the same thing and counted the portion of the > page used in this pass, now with this change for PAGE_SIZE of 4K we > count the entire page, and for all other cases we count the portion of > the page used. When a page is split in 2 parts only, probability that a segment holds the 4K page is quite high (There is a single half page) When we split say 64KB in 42 segments, the probability a single segment hold the full 64KB block is very low, so we can almost be safe when we consider 'truesize = 1536' Of course there are pathological cases, but attacker has to be quite smart. I am just saying that counting 2048 might have a big impact on memory consumption if all these incoming segments are stored a long time in receive queues (TCP receive queues or out of order queues) : We might be off by a factor of 2 on the real memory usage, and delay the TCP collapsing too much. -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html