Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-11 Thread Michal Hocko
On Tue 10-12-19 16:52:31, Logan Gunthorpe wrote: [...] > In my opinion, having a coder and reviewer see PAGE_KERNEL and ask if > that makes sense is a benefit. Having it hidden because we don't want > people to think about it is worse, harder to understand and results in > bugs that are more

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread Logan Gunthorpe
On 2019-12-10 4:25 a.m., David Hildenbrand wrote: > On 10.12.19 11:34, Michal Hocko wrote: >> On Tue 10-12-19 11:09:46, David Hildenbrand wrote: >>> On 10.12.19 11:04, Michal Hocko wrote: On Mon 09-12-19 12:43:40, Dan Williams wrote: > On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread David Hildenbrand
On 10.12.19 11:34, Michal Hocko wrote: > On Tue 10-12-19 11:09:46, David Hildenbrand wrote: >> On 10.12.19 11:04, Michal Hocko wrote: >>> On Mon 09-12-19 12:43:40, Dan Williams wrote: On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: > > > > On 2019-12-09 12:23

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread Michal Hocko
On Tue 10-12-19 11:09:46, David Hildenbrand wrote: > On 10.12.19 11:04, Michal Hocko wrote: > > On Mon 09-12-19 12:43:40, Dan Williams wrote: > >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe > >> wrote: > >>> > >>> > >>> > >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: > On

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread David Hildenbrand
On 10.12.19 11:04, Michal Hocko wrote: > On Mon 09-12-19 12:43:40, Dan Williams wrote: >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >>> >>> >>> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: On 09.12.19 20:13, Logan Gunthorpe wrote: > [...] > #ifdef

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread Michal Hocko
On Mon 09-12-19 12:43:40, Dan Williams wrote: > On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: > > > > > > > > On 2019-12-09 12:23 p.m., David Hildenbrand wrote: > > > On 09.12.19 20:13, Logan Gunthorpe wrote: [...] > > >> #ifdef CONFIG_MEMORY_HOTPLUG > > >> -int arch_add_memory(int nid,

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread Michal Hocko
On Mon 09-12-19 14:24:22, Logan Gunthorpe wrote: > > > On 2019-12-09 1:41 p.m., Michal Hocko wrote: > > On Mon 09-12-19 13:24:19, Logan Gunthorpe wrote: > >> > >> > >> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: > >>> On 09.12.19 20:13, Logan Gunthorpe wrote: > devm_memremap_pages()

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread Logan Gunthorpe
On 2019-12-09 2:00 p.m., Dan Williams wrote: Can we fiddle that into "struct mhp_restrictions" instead? >>> >>> Yes, if that's what people want, it's pretty trivial to do. I chose not >>> to do it that way because it doesn't get passed down to add_pages() and >>> it's not really a

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread Logan Gunthorpe
On 2019-12-09 1:41 p.m., Michal Hocko wrote: > On Mon 09-12-19 13:24:19, Logan Gunthorpe wrote: >> >> >> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>> On 09.12.19 20:13, Logan Gunthorpe wrote: devm_memremap_pages() is currently used by the PCI P2PDMA code to create struct

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread Dan Williams
On Mon, Dec 9, 2019 at 12:47 PM Michal Hocko wrote: > > On Mon 09-12-19 13:24:19, Logan Gunthorpe wrote: > > > > > > On 2019-12-09 12:23 p.m., David Hildenbrand wrote: > > > On 09.12.19 20:13, Logan Gunthorpe wrote: > > >> devm_memremap_pages() is currently used by the PCI P2PDMA code to create >

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread David Hildenbrand
> Am 09.12.2019 um 21:43 schrieb Dan Williams : > > On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >> >> >> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>> On 09.12.19 20:13, Logan Gunthorpe wrote: devm_memremap_pages() is currently used by the PCI P2PDMA code to

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread Dan Williams
On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: > > > > On 2019-12-09 12:23 p.m., David Hildenbrand wrote: > > On 09.12.19 20:13, Logan Gunthorpe wrote: > >> devm_memremap_pages() is currently used by the PCI P2PDMA code to create > >> struct page mappings for IO memory. At present, these

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread Logan Gunthorpe
On 2019-12-09 12:23 p.m., David Hildenbrand wrote: > On 09.12.19 20:13, Logan Gunthorpe wrote: >> devm_memremap_pages() is currently used by the PCI P2PDMA code to create >> struct page mappings for IO memory. At present, these mappings are created >> with PAGE_KERNEL which implies setting the

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread Michal Hocko
On Mon 09-12-19 13:24:19, Logan Gunthorpe wrote: > > > On 2019-12-09 12:23 p.m., David Hildenbrand wrote: > > On 09.12.19 20:13, Logan Gunthorpe wrote: > >> devm_memremap_pages() is currently used by the PCI P2PDMA code to create > >> struct page mappings for IO memory. At present, these

[PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread Logan Gunthorpe
devm_memremap_pages() is currently used by the PCI P2PDMA code to create struct page mappings for IO memory. At present, these mappings are created with PAGE_KERNEL which implies setting the PAT bits to be WB. However, on x86, an mtrr register will typically override this and force the cache type

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread David Hildenbrand
On 09.12.19 20:13, Logan Gunthorpe wrote: > devm_memremap_pages() is currently used by the PCI P2PDMA code to create > struct page mappings for IO memory. At present, these mappings are created > with PAGE_KERNEL which implies setting the PAT bits to be WB. However, on > x86, an mtrr register will