Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-08 Thread Kani, Toshi
On Thu, 2018-03-08 at 14:07 -0800, Matthew Wilcox wrote: > On Thu, Mar 08, 2018 at 03:56:30PM +, Kani, Toshi wrote: > > On Wed, 2018-03-07 at 20:00 -0800, Matthew Wilcox wrote: > > > On Wed, Mar 07, 2018 at 11:32:26AM -0700, Toshi Kani wrote: > > > > +/** > > > > + * pud_free_pmd_page - clear p

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-08 Thread Matthew Wilcox
On Thu, Mar 08, 2018 at 03:56:30PM +, Kani, Toshi wrote: > On Wed, 2018-03-07 at 20:00 -0800, Matthew Wilcox wrote: > > On Wed, Mar 07, 2018 at 11:32:26AM -0700, Toshi Kani wrote: > > > +/** > > > + * pud_free_pmd_page - clear pud entry and free pmd page > > > + * > > > + * Returns 1 on success

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-08 Thread Kani, Toshi
On Thu, 2018-03-08 at 18:04 +, Will Deacon wrote: : > > diff --git a/lib/ioremap.c b/lib/ioremap.c > > index b808a390e4c3..54e5bbaa3200 100644 > > --- a/lib/ioremap.c > > +++ b/lib/ioremap.c > > @@ -91,7 +91,8 @@ static inline int ioremap_pmd_range(pud_t *pud, unsigned > > long addr, > > >

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-08 Thread Will Deacon
Hi Toshi, Thanks for the patches! On Wed, Mar 07, 2018 at 11:32:26AM -0700, Toshi Kani wrote: > On architectures with CONFIG_HAVE_ARCH_HUGE_VMAP set, ioremap() > may create pud/pmd mappings. Kernel panic was observed on arm64 > systems with Cortex-A75 in the following steps as described by > Han

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-08 Thread Kani, Toshi
On Wed, 2018-03-07 at 20:00 -0800, Matthew Wilcox wrote: > On Wed, Mar 07, 2018 at 11:32:26AM -0700, Toshi Kani wrote: > > +/** > > + * pud_free_pmd_page - clear pud entry and free pmd page > > + * > > + * Returns 1 on success and 0 on failure (pud not cleared). > > + */ > > +int pud_free_pmd_page(

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-08 Thread Ingo Molnar
* Toshi Kani wrote: > On architectures with CONFIG_HAVE_ARCH_HUGE_VMAP set, ioremap() > may create pud/pmd mappings. Kernel panic was observed on arm64 > systems with Cortex-A75 in the following steps as described by > Hanjun Guo. > > 1. ioremap a 4K size, valid page table will build, > 2. iou

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-07 Thread Matthew Wilcox
On Wed, Mar 07, 2018 at 11:32:26AM -0700, Toshi Kani wrote: > +/** > + * pud_free_pmd_page - clear pud entry and free pmd page > + * > + * Returns 1 on success and 0 on failure (pud not cleared). > + */ > +int pud_free_pmd_page(pud_t *pud) > +{ > + return pud_none(*pud); > +} Wouldn't it be cl

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-07 Thread Kani, Toshi
On Wed, 2018-03-07 at 14:54 -0800, Andrew Morton wrote: > On Wed, 7 Mar 2018 11:32:26 -0700 Toshi Kani wrote: > > > On architectures with CONFIG_HAVE_ARCH_HUGE_VMAP set, ioremap() > > may create pud/pmd mappings. Kernel panic was observed on arm64 > > systems with Cortex-A75 in the following st

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-07 Thread Andrew Morton
On Wed, 7 Mar 2018 11:32:26 -0700 Toshi Kani wrote: > On architectures with CONFIG_HAVE_ARCH_HUGE_VMAP set, ioremap() > may create pud/pmd mappings. Kernel panic was observed on arm64 > systems with Cortex-A75 in the following steps as described by > Hanjun Guo. > > 1. ioremap a 4K size, valid

Re: [PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-07 Thread Andrew Morton
On Wed, 7 Mar 2018 11:32:26 -0700 Toshi Kani wrote: > On architectures with CONFIG_HAVE_ARCH_HUGE_VMAP set, ioremap() > may create pud/pmd mappings. Kernel panic was observed on arm64 > systems with Cortex-A75 in the following steps as described by > Hanjun Guo. > > 1. ioremap a 4K size, valid

[PATCH 1/2] mm/vmalloc: Add interfaces to free unused page table

2018-03-07 Thread Toshi Kani
On architectures with CONFIG_HAVE_ARCH_HUGE_VMAP set, ioremap() may create pud/pmd mappings. Kernel panic was observed on arm64 systems with Cortex-A75 in the following steps as described by Hanjun Guo. 1. ioremap a 4K size, valid page table will build, 2. iounmap it, pte0 will set to 0; 3. iorem