On 10/11/2011 05:24 AM, Bob Liu wrote:
Yes, mlock() can do it but it will require a lot of changes in every user application. If some of the applications are hugh and complicated(even not opensource), it's hard to modify them. Add this patch can make things simple and thp more flexible. For using swapoff -a, it will disable swap for 4k normal pages. A simple use case is like this: a lot of swap sensitive apps run on a machine, it will use thp so we need to disable swap. But this apps are hugh and complicated, it's hard to modify them by mlock(). In addition, there are also some normal and not swap sensitive apps which don't use thp run on the same machine, we can still reclaim their memory by swap when lack of memory.
The normal applications could end up getting transparent huge pages automatically, which would also disable swap for them. At that point, you could run out of memory, because you disabled swap for 2MB pages. How do you plan to avoid that? -- All rights reversed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>