From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 14 Mar 2017 11:29:03 +0100 (CET) Received: from smtp-out4.electric.net ([192.162.216.182]:50335 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23994822AbdCNKS2rdXNU convert rfc822-to-8bit (ORCPT ); Tue, 14 Mar 2017 11:18:28 +0100 Received: from 1cnjWn-0002zE-WE by out4b.electric.net with emc1-ok (Exim 4.87) (envelope-from ) id 1cnjWx-0003kL-W6; Tue, 14 Mar 2017 03:18:15 -0700 Received: by emcmailer; Tue, 14 Mar 2017 03:18:15 -0700 Received: from [213.249.233.130] (helo=AcuExch.aculab.com) by out4b.electric.net with esmtps (TLSv1:AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1cnjWn-0002zE-WE; Tue, 14 Mar 2017 03:18:06 -0700 Received: from ACUEXCH.Aculab.com ([::1]) by AcuExch.aculab.com ([::1]) with mapi id 14.03.0123.003; Tue, 14 Mar 2017 10:18:03 +0000 From: David Laight To: 'Till Smejkal' , 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@kernel.org" , "Andy Lutomirski" , 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 CC: "linux-mips@linux-mips.org" , "alsa-devel@alsa-project.org" , "linux-ia64@vger.kernel.org" , "linux-aio@kvack.org" , "linux-mm@kvack.org" , "linux-mtd@lists.infradead.org" , "sparclinux@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-s390@vger.kernel.org" , "linux-hexagon@vger.kernel.org" , "linux-sh@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , "linux-media@vger.kernel.org" , "linux-xtensa@linux-xtensa.org" , "adi-buildroot-devel@lists.sourceforge.net" , "linux-metag@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-parisc@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-alpha@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" Subject: RE: [RFC PATCH 07/13] kernel/fork: Split and export 'mm_alloc' and 'mm_init' Thread-Topic: [RFC PATCH 07/13] kernel/fork: Split and export 'mm_alloc' and 'mm_init' Thread-Index: AQHSnFlKbsEtMBhPwUWh6YpYbq3c0aGUH2sg Date: Tue, 14 Mar 2017 10:18:03 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFB03F4@AcuExch.aculab.com> References: <20170313221415.9375-1-till.smejkal@gmail.com> <20170313221415.9375-8-till.smejkal@gmail.com> In-Reply-To: <20170313221415.9375-8-till.smejkal@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (s) Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 57226 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: David.Laight@ACULAB.COM Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips From: Linuxppc-dev Till Smejkal > Sent: 13 March 2017 22:14 > The only way until now to create a new memory map was via the exported > function 'mm_alloc'. Unfortunately, this function not only allocates a new > memory map, but also completely initializes it. However, with the > introduction of first class virtual address spaces, some initialization > steps done in 'mm_alloc' are not applicable to the memory maps needed for > this feature and hence would lead to errors in the kernel code. > > Instead of introducing a new function that can allocate and initialize > memory maps for first class virtual address spaces and potentially > duplicate some code, I decided to split the mm_alloc function as well as > the 'mm_init' function that it uses. > > Now there are four functions exported instead of only one. The new > 'mm_alloc' function only allocates a new mm_struct and zeros it out. If one > want to have the old behavior of mm_alloc one can use the newly introduced > function 'mm_alloc_and_setup' which not only allocates a new mm_struct but > also fully initializes it. ... That looks like bugs waiting to happen. You need unchanged code to fail to compile. David From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out4.electric.net ([192.162.216.182]:50335 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23994822AbdCNKS2rdXNU convert rfc822-to-8bit (ORCPT ); Tue, 14 Mar 2017 11:18:28 +0100 From: David Laight Subject: RE: [RFC PATCH 07/13] kernel/fork: Split and export 'mm_alloc' and 'mm_init' Date: Tue, 14 Mar 2017 10:18:03 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFB03F4@AcuExch.aculab.com> References: <20170313221415.9375-1-till.smejkal@gmail.com> <20170313221415.9375-8-till.smejkal@gmail.com> In-Reply-To: <20170313221415.9375-8-till.smejkal@gmail.com> Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: 'Till Smejkal' , 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@kernel.org" , Andy Lutomirski , 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 Cc: "linux-mips@linux-mips.org" , "alsa-devel@alsa-project.org" , "linux-ia64@vger.kernel.org" , "linux-aio@kvack.org" , "linux-mm@kvack.org" , "linux-mtd@lists.infradead.org" , "sparclinux@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-s390@vger.kernel.org" , "linux-hexagon@vger.kernel.org" , "linux-sh@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , "linux-media@vger.kernel.org" , "linux-xtensa@linux-xtensa.org" , "adi-buildroot-devel@lists.sourceforge.net" , "linux-metag@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-parisc@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-alpha@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" Message-ID: <20170314101803.XpTsLYGOyNcssZA-LiN2XalWmAWHQSpjhQxz0V-YrS4@z> From: Linuxppc-dev Till Smejkal > Sent: 13 March 2017 22:14 > The only way until now to create a new memory map was via the exported > function 'mm_alloc'. Unfortunately, this function not only allocates a new > memory map, but also completely initializes it. However, with the > introduction of first class virtual address spaces, some initialization > steps done in 'mm_alloc' are not applicable to the memory maps needed for > this feature and hence would lead to errors in the kernel code. > > Instead of introducing a new function that can allocate and initialize > memory maps for first class virtual address spaces and potentially > duplicate some code, I decided to split the mm_alloc function as well as > the 'mm_init' function that it uses. > > Now there are four functions exported instead of only one. The new > 'mm_alloc' function only allocates a new mm_struct and zeros it out. If one > want to have the old behavior of mm_alloc one can use the newly introduced > function 'mm_alloc_and_setup' which not only allocates a new mm_struct but > also fully initializes it. ... That looks like bugs waiting to happen. You need unchanged code to fail to compile. David