From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx193.postini.com [74.125.245.193]) by kanga.kvack.org (Postfix) with SMTP id D04CF6B0036 for ; Fri, 12 Jul 2013 04:56:11 -0400 (EDT) Date: Fri, 12 Jul 2013 10:55:04 +0200 From: Peter Zijlstra Subject: Re: [PATCH 2/2] mm: add a field to store names for private anonymous memory Message-ID: <20130712085504.GO25631@dyad.programming.kicks-ass.net> References: <1373596462-27115-1-git-send-email-ccross@android.com> <1373596462-27115-2-git-send-email-ccross@android.com> <51DF9682.9040301@kernel.org> <20130712081348.GM25631@dyad.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Pekka Enberg Cc: Colin Cross , LKML , Kyungmin Park , Christoph Hellwig , John Stultz , "Eric W. Biederman" , Dave Hansen , Rob Landley , Andrew Morton , Cyrill Gorcunov , David Rientjes , Davidlohr Bueso , Kees Cook , Al Viro , Hugh Dickins , Mel Gorman , Michel Lespinasse , Rik van Riel , Konstantin Khlebnikov , "Paul E. McKenney" , David Howells , Arnd Bergmann , Dave Jones , "Rafael J. Wysocki" , Oleg Nesterov , Shaohua Li , Sasha Levin , KOSAKI Motohiro , Johannes Weiner , Ingo Molnar , "list@ebiederm.org:DOCUMENTATION , list@ebiederm.org:MEMORY MANAGEMENT ," "linux-mm@kvack.org" On Fri, Jul 12, 2013 at 11:21:55AM +0300, Pekka Enberg wrote: > On Fri, Jul 12, 2013 at 11:13 AM, Peter Zijlstra wrote: > > I also don't see it helping with the JIT stuff; you still need to write out a > > file with symbol information, we still need to find the file. A less hacky > > solution for the entire JIT thing is you writing a proper ELF-DSO and > > mmap()'ing that :-) > > > > Storing a JIT specific userspace pointer in the VMA doesn't help with any of > > that. > > I'm thinking about corner cases like 'perf top' here. I don't see how we can > write out a ELF-DSO because the JIT compiler can generate new symbols > at any given time. Mmap the file PROT_READ|PROT_WRITE|PROT_EXEC, map the _entire_ file, not just the text section; make the symbol table larger than you expect. Then write the symbol name after you've jit'ed the text but before you use it. IIRC you once told me you never overwrite text but always append new symbols. So you can basically fill the DSO with text/symbols use mmap memory writes. Once the DSO is full -- equal to your previous anon-exec region being full, you simply mmap a new DSO. Wouldn't that work? -- 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