From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VgWPw-0007CG-R3 for user-mode-linux-devel@lists.sourceforge.net; Wed, 13 Nov 2013 09:07:20 +0000 Received: from b.ns.miles-group.at ([95.130.255.144] helo=radon.swed.at) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1VgWPv-00046u-55 for user-mode-linux-devel@lists.sourceforge.net; Wed, 13 Nov 2013 09:07:20 +0000 Message-ID: <52834138.7050005@nod.at> Date: Wed, 13 Nov 2013 10:07:04 +0100 From: Richard Weinberger MIME-Version: 1.0 References: <528308E8.8040203@asianux.com> In-Reply-To: <528308E8.8040203@asianux.com> List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net Subject: Re: [uml-devel] [PATCH] arch: um: kernel: skas: mmu: remove pmd_free() and pud_free() for failure processing in init_stub_pte() To: Chen Gang , Jeff Dike Cc: uml-devel , Hugh Dickins , linux-kernel@vger.kernel.org, linux-mm@kvack.org, uml-user , Andrew Morton Am 13.11.2013 06:06, schrieb Chen Gang: > Unfortunately, p?d_alloc() and p?d_free() are not pair!! If p?d_alloc() > succeed, they may be used, so in the next failure, we have to skip them > to let exit_mmap() or do_munmap() to process it. > > According to "Documentation/vm/locking", 'mm->page_table_lock' is for > using vma list, so not need it when its related vmas are detached or > unmapped from using vma list. > > The related work flow: > > exit_mmap() -> > unmap_vmas(); /* so not need mm->page_table_lock */ > free_pgtables(); > > do_munmap()-> > detach_vmas_to_be_unmapped(); /* so not need mm->page_table_lock */ > unmap_region() -> > free_pgtables(); > > free_pgtables() -> > free_pgd_range() -> > free_pud_range() -> > free_pmd_range() -> > free_pte_range() -> > pmd_clear(); > pte_free_tlb(); > pud_clear(); > pmd_free_tlb(); > pgd_clear(); > pud_free_tlb(); > > > Signed-off-by: Chen Gang Sounds reasonable to me. *But* there are patches you from out there that tried to fix similar issues and got reverted later. Now I'm a bit nervous and want a ACK from mm folks to have this verified. It's not that I don't trust you, but I really don't trust you. ;-) Thanks, //richard ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by kanga.kvack.org (Postfix) with ESMTP id 463286B00A7 for ; Wed, 13 Nov 2013 04:07:18 -0500 (EST) Received: by mail-pa0-f52.google.com with SMTP id kl14so128298pab.39 for ; Wed, 13 Nov 2013 01:07:17 -0800 (PST) Received: from psmtp.com ([74.125.245.174]) by mx.google.com with SMTP id yk3si23139045pac.157.2013.11.13.01.07.14 for ; Wed, 13 Nov 2013 01:07:16 -0800 (PST) Message-ID: <52834138.7050005@nod.at> Date: Wed, 13 Nov 2013 10:07:04 +0100 From: Richard Weinberger MIME-Version: 1.0 Subject: Re: [PATCH] arch: um: kernel: skas: mmu: remove pmd_free() and pud_free() for failure processing in init_stub_pte() References: <528308E8.8040203@asianux.com> In-Reply-To: <528308E8.8040203@asianux.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Chen Gang , Jeff Dike Cc: Hugh Dickins , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, uml-devel , uml-user Am 13.11.2013 06:06, schrieb Chen Gang: > Unfortunately, p?d_alloc() and p?d_free() are not pair!! If p?d_alloc() > succeed, they may be used, so in the next failure, we have to skip them > to let exit_mmap() or do_munmap() to process it. > > According to "Documentation/vm/locking", 'mm->page_table_lock' is for > using vma list, so not need it when its related vmas are detached or > unmapped from using vma list. > > The related work flow: > > exit_mmap() -> > unmap_vmas(); /* so not need mm->page_table_lock */ > free_pgtables(); > > do_munmap()-> > detach_vmas_to_be_unmapped(); /* so not need mm->page_table_lock */ > unmap_region() -> > free_pgtables(); > > free_pgtables() -> > free_pgd_range() -> > free_pud_range() -> > free_pmd_range() -> > free_pte_range() -> > pmd_clear(); > pte_free_tlb(); > pud_clear(); > pmd_free_tlb(); > pgd_clear(); > pud_free_tlb(); > > > Signed-off-by: Chen Gang Sounds reasonable to me. *But* there are patches you from out there that tried to fix similar issues and got reverted later. Now I'm a bit nervous and want a ACK from mm folks to have this verified. It's not that I don't trust you, but I really don't trust you. ;-) Thanks, //richard -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933141Ab3KMJHa (ORCPT ); Wed, 13 Nov 2013 04:07:30 -0500 Received: from b.ns.miles-group.at ([95.130.255.144]:1660 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932421Ab3KMJHP (ORCPT ); Wed, 13 Nov 2013 04:07:15 -0500 Message-ID: <52834138.7050005@nod.at> Date: Wed, 13 Nov 2013 10:07:04 +0100 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Chen Gang , Jeff Dike CC: Hugh Dickins , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, uml-devel , uml-user Subject: Re: [PATCH] arch: um: kernel: skas: mmu: remove pmd_free() and pud_free() for failure processing in init_stub_pte() References: <528308E8.8040203@asianux.com> In-Reply-To: <528308E8.8040203@asianux.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 13.11.2013 06:06, schrieb Chen Gang: > Unfortunately, p?d_alloc() and p?d_free() are not pair!! If p?d_alloc() > succeed, they may be used, so in the next failure, we have to skip them > to let exit_mmap() or do_munmap() to process it. > > According to "Documentation/vm/locking", 'mm->page_table_lock' is for > using vma list, so not need it when its related vmas are detached or > unmapped from using vma list. > > The related work flow: > > exit_mmap() -> > unmap_vmas(); /* so not need mm->page_table_lock */ > free_pgtables(); > > do_munmap()-> > detach_vmas_to_be_unmapped(); /* so not need mm->page_table_lock */ > unmap_region() -> > free_pgtables(); > > free_pgtables() -> > free_pgd_range() -> > free_pud_range() -> > free_pmd_range() -> > free_pte_range() -> > pmd_clear(); > pte_free_tlb(); > pud_clear(); > pmd_free_tlb(); > pgd_clear(); > pud_free_tlb(); > > > Signed-off-by: Chen Gang Sounds reasonable to me. *But* there are patches you from out there that tried to fix similar issues and got reverted later. Now I'm a bit nervous and want a ACK from mm folks to have this verified. It's not that I don't trust you, but I really don't trust you. ;-) Thanks, //richard