Re: [PATCH v4] mm: prevent endless growth of anon_vma hierarchy

2014-12-17 Thread Rik van Riel
On 12/17/2014 02:57 AM, Konstantin Khlebnikov wrote: > @@ -236,6 +240,13 @@ static inline void unlock_anon_vma_root(struct anon_vma > *root) > /* > * Attach the anon_vmas from src to dst. > * Returns 0 on success, -ENOMEM on failure. > + * > + * If dst->anon_vma is NULL this function tries t

[PATCH v4] mm: prevent endless growth of anon_vma hierarchy

2014-12-17 Thread Konstantin Khlebnikov
Constantly forking task causes unlimited grow of anon_vma chain. Each next child allocates new level of anon_vmas and links vma to all previous levels because pages might be inherited from any level. This patch adds heuristic which decides to reuse existing anon_vma instead of forking new one. It