[PATCH] temporarily disable swap token on memory pressure
Some users (hi Zwane) have seen a problem when running a workload that eats nearly all of physical memory - th system does an OOM kill, even when there is still a lot of swap free. The problem appears to be a very big task that is holding the swap token, and the VM has a very hard time finding any other page in the system that is swappable. Instead of ignoring the swap token when sc->priority reaches 0, we could simply take the swap token away from the memory hog and make sure we don't give it back to the memory hog for a few seconds. This patch resolves the problem Zwane ran into. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
a93a117eaa
commit
f7b7fd8f3e
@@ -239,6 +239,11 @@ static inline void put_swap_token(struct mm_struct *mm)
|
||||
__put_swap_token(mm);
|
||||
}
|
||||
|
||||
static inline void disable_swap_token(void)
|
||||
{
|
||||
put_swap_token(swap_token_mm);
|
||||
}
|
||||
|
||||
#else /* CONFIG_SWAP */
|
||||
|
||||
#define total_swap_pages 0
|
||||
@@ -283,6 +288,7 @@ static inline swp_entry_t get_swap_page(void)
|
||||
#define put_swap_token(x) do { } while(0)
|
||||
#define grab_swap_token() do { } while(0)
|
||||
#define has_swap_token(x) 0
|
||||
#define disable_swap_token() do { } while(0)
|
||||
|
||||
#endif /* CONFIG_SWAP */
|
||||
#endif /* __KERNEL__*/
|
||||
|
Reference in New Issue
Block a user