From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <528342E5.2030300@asianux.com> Date: Wed, 13 Nov 2013 17:14:13 +0800 From: Chen Gang MIME-Version: 1.0 References: <528308E8.8040203@asianux.com> <52834138.7050005@nod.at> In-Reply-To: <52834138.7050005@nod.at> 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: Richard Weinberger Cc: uml-devel , Jeff Dike , Hugh Dickins , linux-kernel@vger.kernel.org, linux-mm@kvack.org, uml-user , Andrew Morton On 11/13/2013 05:07 PM, Richard Weinberger wrote: > 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. ;-) > OK, thanks. > Thanks, > //richard > > -- Chen Gang ------------------------------------------------------------------------------ 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-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by kanga.kvack.org (Postfix) with ESMTP id 738CA6B00A7 for ; Wed, 13 Nov 2013 04:12:07 -0500 (EST) Received: by mail-pb0-f49.google.com with SMTP id um1so132580pbc.36 for ; Wed, 13 Nov 2013 01:12:07 -0800 (PST) Received: from psmtp.com ([74.125.245.180]) by mx.google.com with SMTP id hk1si22779969pbb.281.2013.11.13.01.12.04 for ; Wed, 13 Nov 2013 01:12:05 -0800 (PST) Message-ID: <528342E5.2030300@asianux.com> Date: Wed, 13 Nov 2013 17:14:13 +0800 From: Chen Gang 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> <52834138.7050005@nod.at> In-Reply-To: <52834138.7050005@nod.at> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Richard Weinberger Cc: Jeff Dike , Hugh Dickins , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, uml-devel , uml-user On 11/13/2013 05:07 PM, Richard Weinberger wrote: > 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. ;-) > OK, thanks. > Thanks, > //richard > > -- Chen Gang -- 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 S1758841Ab3KMJMN (ORCPT ); Wed, 13 Nov 2013 04:12:13 -0500 Received: from intranet.asianux.com ([58.214.24.6]:61767 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933195Ab3KMJMF (ORCPT ); Wed, 13 Nov 2013 04:12:05 -0500 X-Spam-Score: -100.8 Message-ID: <528342E5.2030300@asianux.com> Date: Wed, 13 Nov 2013 17:14:13 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Richard Weinberger CC: Jeff Dike , 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> <52834138.7050005@nod.at> In-Reply-To: <52834138.7050005@nod.at> 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 On 11/13/2013 05:07 PM, Richard Weinberger wrote: > 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. ;-) > OK, thanks. > Thanks, > //richard > > -- Chen Gang