Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-08 Thread Will Deacon
On Fri, 5 Mar 2021 10:54:56 +0530, Anshuman Khandual wrote:
> This series fixes pfn_valid() for ZONE_DEVICE based memory and also improves
> its performance for normal hotplug memory. While here, it also reorganizes
> pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.12-rc1.
> 
> Cc: Catalin Marinas 
> Cc: Will Deacon 
> Cc: Ard Biesheuvel 
> Cc: Mark Rutland 
> Cc: James Morse 
> Cc: Robin Murphy 
> Cc: Jérôme Glisse 
> Cc: Dan Williams 
> Cc: David Hildenbrand 
> Cc: Mike Rapoport 
> Cc: Veronika Kabatova 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux...@kvack.org
> Cc: linux-kernel@vger.kernel.org
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory
  https://git.kernel.org/arm64/c/eeb0753ba27b
[2/2] arm64/mm: Reorganize pfn_valid()
  https://git.kernel.org/arm64/c/093bbe211ea5

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev


Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-05 Thread Catalin Marinas
On Fri, Mar 05, 2021 at 01:16:28PM -0500, Veronika Kabatova wrote:
> > > On 3/5/21 10:54 AM, Anshuman Khandual wrote:
> > > > This series fixes pfn_valid() for ZONE_DEVICE based memory and
> > > > also improves its performance for normal hotplug memory. While
> > > > here, it also reorganizes pfn_valid() on CONFIG_SPARSEMEM. This
> > > > series is based on v5.12-rc1.
[...]
> > > Could you please help recreate the earlier failure [1] but with this
> > > series applies on v5.12-rc1. Thank you.
> > 
> > the machine in question is currently loaned to a developer. I'll reach
> > out to them and will let you know once I have any results.
> 
> I'm happy to report the kernel boots with these new patches. I used the
> 5.12.0-rc1 kernel (commit 280d542f6ffac0) as a base. The full console log
> from the boot process is available at
> 
> https://gitlab.com/-/snippets/2086833

That's great Veronika. Thanks for confirming.

-- 
Catalin


Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-05 Thread Veronika Kabatova



- Original Message -
> From: "Veronika Kabatova" 
> To: "Anshuman Khandual" 
> Cc: linux-arm-ker...@lists.infradead.org, linux-kernel@vger.kernel.org, 
> linux...@kvack.org, "Catalin Marinas"
> , "Will Deacon" , "Ard Biesheuvel" 
> , "Mark Rutland"
> , "James Morse" , "Robin Murphy" 
> , "Jérôme Glisse"
> , "Dan Williams" , "David 
> Hildenbrand" , "Mike
> Rapoport" 
> Sent: Friday, March 5, 2021 1:28:40 PM
> Subject: Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based 
> memory
> 
> 
> 
> - Original Message -
> > From: "Anshuman Khandual" 
> > To: linux-arm-ker...@lists.infradead.org, linux-kernel@vger.kernel.org,
> > linux...@kvack.org
> > Cc: "Catalin Marinas" , "Will Deacon"
> > , "Ard Biesheuvel" ,
> > "Mark Rutland" , "James Morse" ,
> > "Robin Murphy" ,
> > "Jérôme Glisse" , "Dan Williams"
> > , "David Hildenbrand"
> > , "Mike Rapoport" , "Veronika
> > Kabatova" 
> > Sent: Friday, March 5, 2021 6:38:14 AM
> > Subject: Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based
> > memory
> > 
> > 
> > On 3/5/21 10:54 AM, Anshuman Khandual wrote:
> > > This series fixes pfn_valid() for ZONE_DEVICE based memory and also
> > > improves
> > > its performance for normal hotplug memory. While here, it also
> > > reorganizes
> > > pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.12-rc1.
> > > 
> > > Cc: Catalin Marinas 
> > > Cc: Will Deacon 
> > > Cc: Ard Biesheuvel 
> > > Cc: Mark Rutland 
> > > Cc: James Morse 
> > > Cc: Robin Murphy 
> > > Cc: Jérôme Glisse 
> > > Cc: Dan Williams 
> > > Cc: David Hildenbrand 
> > > Cc: Mike Rapoport 
> > > Cc: Veronika Kabatova 
> > > Cc: linux-arm-ker...@lists.infradead.org
> > > Cc: linux...@kvack.org
> > > Cc: linux-kernel@vger.kernel.org
> > > 
> > > Changes in V3:
> > > 
> > > - Validate the pfn before fetching mem_section with __pfn_to_section() in
> > > [PATCH 2/2]
> > 
> > Hello Veronica,
> > 
> > Could you please help recreate the earlier failure [1] but with this
> > series applies on v5.12-rc1. Thank you.
> > 
> 
> Hello Anshuman,
> 
> the machine in question is currently loaned to a developer. I'll reach
> out to them and will let you know once I have any results.
> 

Hi,

I'm happy to report the kernel boots with these new patches. I used the
5.12.0-rc1 kernel (commit 280d542f6ffac0) as a base. The full console log
from the boot process is available at

https://gitlab.com/-/snippets/2086833

in case you want to take a look. Note that there are some call traces
starting around line 3220, but they are NOT introduced by these two
patches and are also present with the base mainline kernel.


Veronika

> 
> Veronika
> 
> > [1]
> > https://lore.kernel.org/linux-arm-kernel/cki.8d1cb60fec.k6njmef...@redhat.com/
> > 
> > - Anshuman
> > 
> > 
> 



Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-05 Thread Veronika Kabatova



- Original Message -
> From: "Anshuman Khandual" 
> To: linux-arm-ker...@lists.infradead.org, linux-kernel@vger.kernel.org, 
> linux...@kvack.org
> Cc: "Catalin Marinas" , "Will Deacon" 
> , "Ard Biesheuvel" ,
> "Mark Rutland" , "James Morse" , 
> "Robin Murphy" ,
> "Jérôme Glisse" , "Dan Williams" 
> , "David Hildenbrand"
> , "Mike Rapoport" , "Veronika Kabatova" 
> 
> Sent: Friday, March 5, 2021 6:38:14 AM
> Subject: Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based 
> memory
> 
> 
> On 3/5/21 10:54 AM, Anshuman Khandual wrote:
> > This series fixes pfn_valid() for ZONE_DEVICE based memory and also
> > improves
> > its performance for normal hotplug memory. While here, it also reorganizes
> > pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.12-rc1.
> > 
> > Cc: Catalin Marinas 
> > Cc: Will Deacon 
> > Cc: Ard Biesheuvel 
> > Cc: Mark Rutland 
> > Cc: James Morse 
> > Cc: Robin Murphy 
> > Cc: Jérôme Glisse 
> > Cc: Dan Williams 
> > Cc: David Hildenbrand 
> > Cc: Mike Rapoport 
> > Cc: Veronika Kabatova 
> > Cc: linux-arm-ker...@lists.infradead.org
> > Cc: linux...@kvack.org
> > Cc: linux-kernel@vger.kernel.org
> > 
> > Changes in V3:
> > 
> > - Validate the pfn before fetching mem_section with __pfn_to_section() in
> > [PATCH 2/2]
> 
> Hello Veronica,
> 
> Could you please help recreate the earlier failure [1] but with this
> series applies on v5.12-rc1. Thank you.
> 

Hello Anshuman,

the machine in question is currently loaned to a developer. I'll reach
out to them and will let you know once I have any results.


Veronika

> [1]
> https://lore.kernel.org/linux-arm-kernel/cki.8d1cb60fec.k6njmef...@redhat.com/
> 
> - Anshuman
> 
> 



Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-04 Thread Anshuman Khandual


On 3/5/21 10:54 AM, Anshuman Khandual wrote:
> This series fixes pfn_valid() for ZONE_DEVICE based memory and also improves
> its performance for normal hotplug memory. While here, it also reorganizes
> pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.12-rc1.
> 
> Cc: Catalin Marinas 
> Cc: Will Deacon 
> Cc: Ard Biesheuvel 
> Cc: Mark Rutland 
> Cc: James Morse 
> Cc: Robin Murphy 
> Cc: Jérôme Glisse 
> Cc: Dan Williams 
> Cc: David Hildenbrand 
> Cc: Mike Rapoport 
> Cc: Veronika Kabatova 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux...@kvack.org
> Cc: linux-kernel@vger.kernel.org
> 
> Changes in V3:
> 
> - Validate the pfn before fetching mem_section with __pfn_to_section() in 
> [PATCH 2/2]

Hello Veronica,

Could you please help recreate the earlier failure [1] but with this
series applies on v5.12-rc1. Thank you.

[1] 
https://lore.kernel.org/linux-arm-kernel/cki.8d1cb60fec.k6njmef...@redhat.com/

- Anshuman


[PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-04 Thread Anshuman Khandual
This series fixes pfn_valid() for ZONE_DEVICE based memory and also improves
its performance for normal hotplug memory. While here, it also reorganizes
pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.12-rc1.

Cc: Catalin Marinas 
Cc: Will Deacon 
Cc: Ard Biesheuvel 
Cc: Mark Rutland 
Cc: James Morse 
Cc: Robin Murphy 
Cc: Jérôme Glisse 
Cc: Dan Williams 
Cc: David Hildenbrand 
Cc: Mike Rapoport 
Cc: Veronika Kabatova 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux...@kvack.org
Cc: linux-kernel@vger.kernel.org

Changes in V3:

- Validate the pfn before fetching mem_section with __pfn_to_section() in 
[PATCH 2/2]

Changes in V2:

https://lore.kernel.org/linux-mm/1612239114-28428-1-git-send-email-anshuman.khand...@arm.com/

- Dropped pfn_valid() bifurcation based on CONFIG_SPARSEMEM
- Used PFN_PHYS() and PHYS_PFN() instead of __pfn_to_phys() and __phys_to_pfn()
- Moved __pfn_to_section() inside #ifdef CONFIG_SPARSEMEM with a { } construct

Changes in V1:

https://lore.kernel.org/linux-mm/1611905986-20155-1-git-send-email-anshuman.khand...@arm.com/

- Test pfn_section_valid() for non boot memory

Changes in RFC:

https://lore.kernel.org/linux-arm-kernel/1608621144-4001-1-git-send-email-anshuman.khand...@arm.com/

Anshuman Khandual (2):
  arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory
  arm64/mm: Reorganize pfn_valid()

 arch/arm64/mm/init.c | 29 ++---
 1 file changed, 26 insertions(+), 3 deletions(-)

-- 
2.20.1