summaryrefslogtreecommitdiffstats
path: root/lib/dynamic_queue_limits.c
diff options
context:
space:
mode:
authorPavel Tatashin <pasha.tatashin@soleen.com>2019-07-16 16:30:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-06 19:08:13 +0200
commit71494c7b6f0c70b5a291e5ce5dd1d2cd77599b31 (patch)
tree410aa9e925577e0c392ac2595e729fc6069b60fe /lib/dynamic_queue_limits.c
parent0f15dd0543920e63a87f4639a721ffa83c3034f2 (diff)
downloadlinux-stable-71494c7b6f0c70b5a291e5ce5dd1d2cd77599b31.tar.gz
linux-stable-71494c7b6f0c70b5a291e5ce5dd1d2cd77599b31.tar.bz2
linux-stable-71494c7b6f0c70b5a291e5ce5dd1d2cd77599b31.zip
mm/hotplug: make remove_memory() interface usable
[ Upstream commit eca499ab3749a4537dee77ffead47a1a2c0dee19 ] Presently the 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 state via sysfs. So, between calling this function and offlining all memory blocks there is always a window when lock_device_hotplug is released, and therefore, there is always a chance for a panic during this window. Make this interface to return an error if memory removal fails. This way it is safe to call this function without panicking machine, and also makes it symmetric to add_memory() which already returns an error. Link: http://lkml.kernel.org/r/20190517215438.6487-3-pasha.tatashin@soleen.com Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com> Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Borislav Petkov <bp@suse.de> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Fengguang Wu <fengguang.wu@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: James Morris <jmorris@namei.org> Cc: Jérôme Glisse <jglisse@redhat.com> Cc: Keith Busch <keith.busch@intel.com> Cc: Ross Zwisler <zwisler@kernel.org> Cc: Sasha Levin <sashal@kernel.org> Cc: Takashi Iwai <tiwai@suse.de> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/dynamic_queue_limits.c')
0 files changed, 0 insertions, 0 deletions