From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx102.postini.com [74.125.245.102]) by kanga.kvack.org (Postfix) with SMTP id 057B86B0002 for ; Fri, 26 Apr 2013 05:55:48 -0400 (EDT) Received: by mail-oa0-f48.google.com with SMTP id f4so3773341oah.35 for ; Fri, 26 Apr 2013 02:55:48 -0700 (PDT) Message-ID: <517A4F1E.9070803@gmail.com> Date: Fri, 26 Apr 2013 17:55:42 +0800 From: Simon Jeons MIME-Version: 1.0 Subject: vmalloc fault Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Linux Memory Management List Cc: Rik van Riel , Dave Hansen , Johannes Weiner , Michal Hocko , Mel Gorman Hi all, 1. Why vmalloc fault need sync user process page table with kernel page table instead of using kernel page table directly? 2. Why do_swap_page doesn't set present flag? 3. When enable DEBUG_PAGEALLOC(catch use-after-free bug), if user process alloc pages from zone_normal(which is direct mapping) when fallback, this page which allocated for user process will set present flag in related pte, correct? but why also set present flag for kernel direct mapping? Does kernel have any requirement to access it? -- 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: from psmtp.com (na3sys010amx186.postini.com [74.125.245.186]) by kanga.kvack.org (Postfix) with SMTP id 7D2B26B0002 for ; Fri, 26 Apr 2013 06:04:48 -0400 (EDT) Message-ID: <517A5138.9040902@redhat.com> Date: Fri, 26 Apr 2013 06:04:40 -0400 From: Rik van Riel MIME-Version: 1.0 Subject: Re: vmalloc fault References: <517A4F1E.9070803@gmail.com> In-Reply-To: <517A4F1E.9070803@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Simon Jeons Cc: Linux Memory Management List , Dave Hansen , Johannes Weiner , Michal Hocko , Mel Gorman On 04/26/2013 05:55 AM, Simon Jeons wrote: > Hi all, > > 1. Why vmalloc fault need sync user process page table with kernel page > table instead of using kernel page table directly? Each process has its own PGD, into which both kernel and user PMDs (or PUDs) are mapped. It is possible the PGD is missing some pointers, that need to be filled in at fault time. > 2. Why do_swap_page doesn't set present flag? It does. Look at how vm_get_page_prot works. > 3. When enable DEBUG_PAGEALLOC(catch use-after-free bug), if user > process alloc pages from zone_normal(which is direct mapping) when > fallback, this page which allocated for user process will set present > flag in related pte, correct? but why also set present flag for kernel > direct mapping? Does kernel have any requirement to access it? -- All rights reversed -- 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: from psmtp.com (na3sys010amx144.postini.com [74.125.245.144]) by kanga.kvack.org (Postfix) with SMTP id F02D06B0002 for ; Fri, 26 Apr 2013 06:17:16 -0400 (EDT) Received: by mail-ob0-f174.google.com with SMTP id wc20so3397857obb.33 for ; Fri, 26 Apr 2013 03:17:16 -0700 (PDT) Message-ID: <517A5426.8050901@gmail.com> Date: Fri, 26 Apr 2013 18:17:10 +0800 From: Simon Jeons MIME-Version: 1.0 Subject: Re: vmalloc fault References: <517A4F1E.9070803@gmail.com> <517A5138.9040902@redhat.com> In-Reply-To: <517A5138.9040902@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Rik van Riel Cc: Linux Memory Management List , Dave Hansen , Johannes Weiner , Michal Hocko , Mel Gorman Morning Rik, so early. On 04/26/2013 06:04 PM, Rik van Riel wrote: > On 04/26/2013 05:55 AM, Simon Jeons wrote: >> Hi all, >> >> 1. Why vmalloc fault need sync user process page table with kernel page >> table instead of using kernel page table directly? > > Each process has its own PGD, into which both kernel and user > PMDs (or PUDs) are mapped. It is possible the PGD is missing > some pointers, that need to be filled in at fault time. It seems that you miss my question. I mean why sync page table between user process and init_mm.pgd, can user process use init_mm.pgd page table directly when access vmalloc memory? ;-) > >> 2. Why do_swap_page doesn't set present flag? > > It does. Look at how vm_get_page_prot works. Got it. > >> 3. When enable DEBUG_PAGEALLOC(catch use-after-free bug), if user >> process alloc pages from zone_normal(which is direct mapping) when >> fallback, this page which allocated for user process will set present >> flag in related pte, correct? but why also set present flag for kernel >> direct mapping? Does kernel have any requirement to access it? > > -- 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: from psmtp.com (na3sys010amx156.postini.com [74.125.245.156]) by kanga.kvack.org (Postfix) with SMTP id C213E6B0002 for ; Fri, 26 Apr 2013 06:19:55 -0400 (EDT) Message-ID: <517A54C3.9020403@redhat.com> Date: Fri, 26 Apr 2013 06:19:47 -0400 From: Rik van Riel MIME-Version: 1.0 Subject: Re: vmalloc fault References: <517A4F1E.9070803@gmail.com> <517A5138.9040902@redhat.com> <517A5426.8050901@gmail.com> In-Reply-To: <517A5426.8050901@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Simon Jeons Cc: Linux Memory Management List , Dave Hansen , Johannes Weiner , Michal Hocko , Mel Gorman On 04/26/2013 06:17 AM, Simon Jeons wrote: > Morning Rik, so early. > On 04/26/2013 06:04 PM, Rik van Riel wrote: >> On 04/26/2013 05:55 AM, Simon Jeons wrote: >>> Hi all, >>> >>> 1. Why vmalloc fault need sync user process page table with kernel page >>> table instead of using kernel page table directly? >> >> Each process has its own PGD, into which both kernel and user >> PMDs (or PUDs) are mapped. It is possible the PGD is missing >> some pointers, that need to be filled in at fault time. > > It seems that you miss my question. I mean why sync page table between > user process and init_mm.pgd, can user process use init_mm.pgd page > table directly when access vmalloc memory? ;-) init_mm.pgd is never used as an actual mmu context after bootup. >> >>> 2. Why do_swap_page doesn't set present flag? >> >> It does. Look at how vm_get_page_prot works. > > Got it. > >> >>> 3. When enable DEBUG_PAGEALLOC(catch use-after-free bug), if user >>> process alloc pages from zone_normal(which is direct mapping) when >>> fallback, this page which allocated for user process will set present >>> flag in related pte, correct? but why also set present flag for kernel >>> direct mapping? Does kernel have any requirement to access it? >> >> > -- All rights reversed -- 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: from psmtp.com (na3sys010amx175.postini.com [74.125.245.175]) by kanga.kvack.org (Postfix) with SMTP id EF8706B0002 for ; Fri, 26 Apr 2013 06:27:16 -0400 (EDT) Received: by mail-ie0-f177.google.com with SMTP id 9so4718526iec.22 for ; Fri, 26 Apr 2013 03:27:16 -0700 (PDT) Message-ID: <517A567F.1070906@gmail.com> Date: Fri, 26 Apr 2013 18:27:11 +0800 From: Simon Jeons MIME-Version: 1.0 Subject: Re: vmalloc fault References: <517A4F1E.9070803@gmail.com> <517A5138.9040902@redhat.com> <517A5426.8050901@gmail.com> <517A54C3.9020403@redhat.com> In-Reply-To: <517A54C3.9020403@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Rik van Riel Cc: Linux Memory Management List , Dave Hansen , Johannes Weiner , Michal Hocko , Mel Gorman On 04/26/2013 06:19 PM, Rik van Riel wrote: > On 04/26/2013 06:17 AM, Simon Jeons wrote: >> Morning Rik, so early. >> On 04/26/2013 06:04 PM, Rik van Riel wrote: >>> On 04/26/2013 05:55 AM, Simon Jeons wrote: >>>> Hi all, >>>> >>>> 1. Why vmalloc fault need sync user process page table with kernel >>>> page >>>> table instead of using kernel page table directly? >>> >>> Each process has its own PGD, into which both kernel and user >>> PMDs (or PUDs) are mapped. It is possible the PGD is missing >>> some pointers, that need to be filled in at fault time. >> >> It seems that you miss my question. I mean why sync page table between >> user process and init_mm.pgd, can user process use init_mm.pgd page >> table directly when access vmalloc memory? ;-) > > init_mm.pgd is never used as an actual mmu context after bootup. > >>> >>>> 2. Why do_swap_page doesn't set present flag? >>> >>> It does. Look at how vm_get_page_prot works. >> >> Got it. >> >>> >>>> 3. When enable DEBUG_PAGEALLOC(catch use-after-free bug), if user >>>> process alloc pages from zone_normal(which is direct mapping) when >>>> fallback, this page which allocated for user process will set present >>>> flag in related pte, correct? but why also set present flag for kernel >>>> direct mapping? Does kernel have any requirement to access it? >>> >>> Could you also answer this question? Thanks in advance. ;-) Is there something confuse you in my question? >> > > -- 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