Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-17 Thread Pavel Tatashin
Hi Dan, Thank you very much for your review, my comments below: On Mon, May 6, 2019 at 2:01 PM Dan Williams wrote: > > On Mon, May 6, 2019 at 10:57 AM Dave Hansen wrote: > > > > > -static inline void remove_memory(int nid, u64 start, u64 size) {} > > > +static inline bool remove_memory(int

Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-06 Thread Pavel Tatashin
On Mon, May 6, 2019 at 1:57 PM Dave Hansen wrote: > > > -static inline void remove_memory(int nid, u64 start, u64 size) {} > > +static inline bool remove_memory(int nid, u64 start, u64 size) > > +{ > > + return -EBUSY; > > +} > > This seems like an appropriate place for a WARN_ONCE(), if

Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-06 Thread Pavel Tatashin
On Mon, May 6, 2019 at 2:04 PM Dave Hansen wrote: > > On 5/6/19 11:01 AM, Dan Williams wrote: > >>> +void __remove_memory(int nid, u64 start, u64 size) > >>> { > >>> + > >>> + /* > >>> + * trigger BUG() is some memory is not offlined prior to calling > >>> this > >>> + * function

Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-06 Thread Dan Williams
On Mon, May 6, 2019 at 10:57 AM Dave Hansen wrote: > > > -static inline void remove_memory(int nid, u64 start, u64 size) {} > > +static inline bool remove_memory(int nid, u64 start, u64 size) > > +{ > > + return -EBUSY; > > +} > > This seems like an appropriate place for a WARN_ONCE(), if

Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-06 Thread Dave Hansen
On 5/6/19 11:01 AM, Dan Williams wrote: >>> +void __remove_memory(int nid, u64 start, u64 size) >>> { >>> + >>> + /* >>> + * trigger BUG() is some memory is not offlined prior to calling this >>> + * function >>> + */ >>> + if (try_remove_memory(nid, start, size)) >>> +

Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-06 Thread Dave Hansen
> -static inline void remove_memory(int nid, u64 start, u64 size) {} > +static inline bool remove_memory(int nid, u64 start, u64 size) > +{ > + return -EBUSY; > +} This seems like an appropriate place for a WARN_ONCE(), if someone manages to call remove_memory() with hotplug disabled. BTW, I

Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-03 Thread David Hildenbrand
On 02.05.19 20:43, Pavel Tatashin wrote: > As of right now remove_memory() interface is inherently broken. It tries > to remove memory but panics if some memory is not offline. The problem > is that it is impossible to ensure that all memory blocks are offline as > this function also takes

[v5 2/3] mm/hotplug: make remove_memory() interface useable

2019-05-02 Thread Pavel Tatashin
As of right now remove_memory() interface is inherently broken. It tries to remove memory but panics if some memory is not offline. The problem is that it is impossible to ensure that all memory blocks are offline as this function also takes lock_device_hotplug that is required to change memory