[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cac721ed-c404-19d1-71d1-37c66df9b2a8@intel.com>
Date: Mon, 6 May 2019 10:57:28 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Pavel Tatashin <pasha.tatashin@...een.com>, jmorris@...ei.org,
sashal@...nel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-nvdimm@...ts.01.org,
akpm@...ux-foundation.org, mhocko@...e.com,
dave.hansen@...ux.intel.com, dan.j.williams@...el.com,
keith.busch@...el.com, vishal.l.verma@...el.com,
dave.jiang@...el.com, zwisler@...nel.org, thomas.lendacky@....com,
ying.huang@...el.com, fengguang.wu@...el.com, bp@...e.de,
bhelgaas@...gle.com, baiyaowei@...s.chinamobile.com, tiwai@...e.de,
jglisse@...hat.com, david@...hat.com
Subject: Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable
> -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 looked and can't think of a better errno, but -EBUSY probably
isn't the best error code, right?
> -void remove_memory(int nid, u64 start, u64 size)
> +/**
> + * remove_memory
> + * @nid: the node ID
> + * @start: physical address of the region to remove
> + * @size: size of the region to remove
> + *
> + * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
> + * and online/offline operations before this call, as required by
> + * try_offline_node().
> + */
> +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))
> + BUG();
> +}
Could we call this remove_offline_memory()? That way, it makes _some_
sense why we would BUG() if the memory isn't offline.
Powered by blists - more mailing lists