From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by kanga.kvack.org (Postfix) with ESMTP id DA0106B0035 for ; Wed, 16 Oct 2013 16:35:17 -0400 (EDT) Received: by mail-pa0-f46.google.com with SMTP id fa1so1622111pad.19 for ; Wed, 16 Oct 2013 13:35:17 -0700 (PDT) Message-ID: <525EF85A.6050302@intel.com> Date: Wed, 16 Oct 2013 13:34:34 -0700 From: Dave Hansen MIME-Version: 1.0 Subject: Re: [PATCH 2/2] mm: add a field to store names for private anonymous memory References: <1381800678-16515-1-git-send-email-ccross@android.com> <1381800678-16515-2-git-send-email-ccross@android.com> <20131016003347.GC13007@bbox> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Colin Cross , Minchan Kim Cc: lkml , Pekka Enberg , Peter Zijlstra , Ingo Molnar , Oleg Nesterov , "Eric W. Biederman" , Jan Glauber , John Stultz , Rob Landley , Andrew Morton , Cyrill Gorcunov , Kees Cook , "Serge E. Hallyn" , David Rientjes , Al Viro , Hugh Dickins , Rik van Riel , Mel Gorman , Michel Lespinasse , Tang Chen , Robin Holt , Shaohua Li , Sasha Levin , Johannes Weiner , Peter Zijlstra , open@kvack.org, list@kvack.org, DOCUMENTATION open@kvack.orglist@kvack.org, MEMORY MANAGEMENT On 10/16/2013 01:00 PM, Colin Cross wrote: >> > I guess this feature would be used with allocators tightly >> > so my concern of kernel approach like this that it needs mmap_sem >> > write-side lock to split/merge vmas which is really thing >> > allocators(ex, tcmalloc, jemalloc) want to avoid for performance win >> > that allocators have lots of complicated logic to avoid munmap which >> > needs mmap_sem write-side lock but this feature would make it invalid. > My expected use case is that the allocator will mmap a new large chunk > of anonymous memory, and then immediately name it, resulting in taking > the mmap_sem twice in a row. I guess the prctl (or a new one) _could_ just set a kernel-internal variable (per-thread?) that says "point any future anonymous areas at this name". That way, you at least have the _possibility_ of not having to do it for _every_ mmap(). -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org