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 to find and reuse existing > + * anon_vma which has no vmas and only one child anon_vma. This prevents > + * degradation of anon_vma hierarchy to endless linear chain in case of > + * constantly forking task. In other hand anon_vma with more than one child > + * isn't reused even if was no alive vma, thus rmap walker has a good chance > + * to avoid scanning whole hieraryhy when it searches where page is mapped. ^^^^^^^^^ hierarchy Other than that: Reviewed-by: Rik van Riel <riel@xxxxxxxxxx> Thanks for fixing this long standing issue, Konstantin. -- 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/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>