Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Logan Gunthorpe <logang@xxxxxxxxxxxx>
- Subject: Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()
- From: Michal Hocko <mhocko@xxxxxxxxxx>
- Date: Wed, 11 Dec 2019 09:37:45 +0100
- Cc: David Hildenbrand <david@xxxxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, Linux-sh <linux-sh@xxxxxxxxxxxxxxx>, platform-driver-x86@xxxxxxxxxxxxxxx, Linux MM <linux-mm@xxxxxxxxx>, Christoph Hellwig <hch@xxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>
- In-reply-to: <297b7cc0-c5bc-a4c6-83eb-afc008395234@deltatee.com>
- References: <20191209191346.5197-1-logang@deltatee.com> <20191209191346.5197-6-logang@deltatee.com> <ce50d9da-c60e-05a1-a86b-3bb3629de502@redhat.com> <f34a4c52-cc95-15ed-8a72-c05ab4fd6d33@deltatee.com> <CAPcyv4hpXCZxV5p7WaeGgE7ceujBBa5NOz9Z8fepDHOt6zHO2A@mail.gmail.com> <20191210100432.GC10404@dhcp22.suse.cz> <6da2b279-6a6d-d89c-a34c-962ed021d91d@redhat.com> <20191210103452.GF10404@dhcp22.suse.cz> <a9d6cfe8-39fb-accf-acdc-7cce5578bf2f@redhat.com> <297b7cc0-c5bc-a4c6-83eb-afc008395234@deltatee.com>
- User-agent: Mutt/1.12.2 (2019-09-21)
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 difficult to spot.
My experience would disagree here. We have several examples in the MM
where an overly complex and versatile APIs led to suble bugs, a lot of
copy&pasting and cargo cult programing (just look at the page allocator
as a shiny example - e.g. gfp_flags). So I am always trying to be
carefull here.
> Though, we may be overthinking this: arch_add_memory() is a low level
> non-exported API that's currently used in exactly two places.
This is a fair argument. Most users are and should be using
add_memory().
> I don't
> think there's going to be many, if any, valid new use cases coming up
> for it in the future. That's more what memremap_pages() is for.
OK, fair enough. If this is indeed the simplest way forward then I will
not stand in the way.
--
Michal Hocko
SUSE Labs
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]