[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140618152209.GA14818@redhat.com>
Date: Wed, 18 Jun 2014 17:22:09 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Vladimir Davydov <vdavydov@...allels.com>
Cc: akpm@...ux-foundation.org, rientjes@...gle.com, cl@...ux.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fork: dup_mm: init vm stat counters under mmap_sem
On 06/18, Vladimir Davydov wrote:
>
> @@ -365,7 +365,12 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
> */
> down_write_nested(&mm->mmap_sem, SINGLE_DEPTH_NESTING);
>
> + mm->total_vm = oldmm->total_vm;
> mm->locked_vm = 0;
> + mm->pinned_vm = 0;
> + mm->shared_vm = oldmm->shared_vm;
> + mm->exec_vm = oldmm->exec_vm;
> + mm->stack_vm = oldmm->stack_vm;
> mm->mmap = NULL;
> mm->vmacache_seqnum = 0;
> mm->map_count = 0;
I think the patch is fine.
But perhaps this deserves more cleanups, with or without this patch
the initialization does not look consistent. dup_mmap() nullifies
locked_vm/pinned_vm/mmap/map_count while mm_init() clears core_state/
nr_ptes/rss_stat.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists