From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 1E81A6B0388 for ; Mon, 13 Mar 2017 20:58:43 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id 190so259351300pgg.3 for ; Mon, 13 Mar 2017 17:58:43 -0700 (PDT) Received: from mail.kernel.org (mail.kernel.org. [198.145.29.136]) by mx.google.com with ESMTPS id n3si12992321pfn.108.2017.03.13.17.58.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2017 17:58:40 -0700 (PDT) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 44FC2204AF for ; Tue, 14 Mar 2017 00:58:39 +0000 (UTC) Received: from mail-ua0-f173.google.com (mail-ua0-f173.google.com [209.85.217.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 665742044B for ; Tue, 14 Mar 2017 00:58:36 +0000 (UTC) Received: by mail-ua0-f173.google.com with SMTP id f54so157314528uaa.1 for ; Mon, 13 Mar 2017 17:58:36 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20170313221415.9375-1-till.smejkal@gmail.com> References: <20170313221415.9375-1-till.smejkal@gmail.com> From: Andy Lutomirski Date: Mon, 13 Mar 2017 17:58:01 -0700 Message-ID: Subject: Re: [RFC PATCH 00/13] Introduce first class virtual address spaces Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Till Smejkal Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Steven Miao , Richard Kuo , Tony Luck , Fenghua Yu , James Hogan , Ralf Baechle , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , Rich Felker , "David S. Miller" , Chris Metcalf , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Chris Zankel , Max Filippov , Arnd Bergmann , Greg Kroah-Hartman , Laurent Pinchart , Mauro Carvalho Chehab , Pawel Osciak , Marek Szyprowski , Kyungmin Park , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , Felipe Balbi , Alexander Viro , Benjamin LaHaise , Nadia Yvette Chambers , Jeff Layton , "J. Bruce Fields" , Peter Zijlstra , Hugh Dickins , Arnaldo Carvalho de Melo , Alexander Shishkin , Jaroslav Kysela , Takashi Iwai , "linux-kernel@vger.kernel.org" , linux-alpha@vger.kernel.org, arcml , "linux-arm-kernel@lists.infradead.org" , adi-buildroot-devel@lists.sourceforge.net, linux-hexagon@vger.kernel.org, "linux-ia64@vger.kernel.org" , linux-metag@vger.kernel.org, Linux MIPS Mailing List , linux-parisc@vger.kernel.org, linuxppc-dev , "linux-s390@vger.kernel.org" , "linux-sh@vger.kernel.org" , sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, Linux Media Mailing List , linux-mtd@lists.infradead.org, USB list , Linux FS Devel , linux-aio@kvack.org, "linux-mm@kvack.org" , Linux API , linux-arch , ALSA development On Mon, Mar 13, 2017 at 3:14 PM, Till Smejkal wrote: > This patchset extends the kernel memory management subsystem with a new > type of address spaces (called VAS) which can be created and destroyed > independently of processes by a user in the system. During its lifetime > such a VAS can be attached to processes by the user which allows a process > to have multiple address spaces and thereby multiple, potentially > different, views on the system's main memory. During its execution the > threads belonging to the process are able to switch freely between the > different attached VAS and the process' original AS enabling them to > utilize the different available views on the memory. Sounds like the old SKAS feature for UML. > In addition to the concept of first class virtual address spaces, this > patchset introduces yet another feature called VAS segments. VAS segments > are memory regions which have a fixed size and position in the virtual > address space and can be shared between multiple first class virtual > address spaces. Such shareable memory regions are especially useful for > in-memory pointer-based data structures or other pure in-memory data. This sounds rather complicated. Getting TLB flushing right seems tricky. Why not just map the same thing into multiple mms? > > | VAS | processes | > ------------------------------------- > switch | 468ns | 1944ns | The solution here is IMO to fix the scheduler. Also, FWIW, I have patches (that need a little work) that will make switch_mm() waaaay faster on x86. > At the current state of the development, first class virtual address spaces > have one limitation, that we haven't been able to solve so far. The feature > allows, that different threads of the same process can execute in different > AS at the same time. This is possible, because the VAS-switch operation > only changes the active mm_struct for the task_struct of the calling > thread. However, when a thread switches into a first class virtual address > space, some parts of its original AS are duplicated into the new one to > allow the thread to continue its execution at its current state. Ick. Please don't do this. Can we please keep an mm as just an mm and not make it look magically different depending on which process maps it? If you need a trampoline (which you do, of course), just write a trampoline in regular user code and map it manually. --Andy -- 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