Commit f172acbf authored by Laurent Vivier's avatar Laurent Vivier Committed by Michael Ellerman

powerpc/mm: move warning from resize_hpt_for_hotplug()

resize_hpt_for_hotplug() reports a warning when it cannot
resize the hash page table ("Unable to resize hash page
table to target order") but in some cases it's not a problem
and can make user thinks something has not worked properly.

This patch moves the warning to arch_remove_memory() to
only report the problem when it is needed.
Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
Reviewed-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent f89bd8ba
...@@ -17,9 +17,9 @@ extern int create_section_mapping(unsigned long start, unsigned long end, int ni ...@@ -17,9 +17,9 @@ extern int create_section_mapping(unsigned long start, unsigned long end, int ni
extern int remove_section_mapping(unsigned long start, unsigned long end); extern int remove_section_mapping(unsigned long start, unsigned long end);
#ifdef CONFIG_PPC_BOOK3S_64 #ifdef CONFIG_PPC_BOOK3S_64
extern void resize_hpt_for_hotplug(unsigned long new_mem_size); extern int resize_hpt_for_hotplug(unsigned long new_mem_size);
#else #else
static inline void resize_hpt_for_hotplug(unsigned long new_mem_size) { } static inline int resize_hpt_for_hotplug(unsigned long new_mem_size) { return 0; }
#endif #endif
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
......
...@@ -755,12 +755,12 @@ static unsigned long __init htab_get_table_size(void) ...@@ -755,12 +755,12 @@ static unsigned long __init htab_get_table_size(void)
} }
#ifdef CONFIG_MEMORY_HOTPLUG #ifdef CONFIG_MEMORY_HOTPLUG
void resize_hpt_for_hotplug(unsigned long new_mem_size) int resize_hpt_for_hotplug(unsigned long new_mem_size)
{ {
unsigned target_hpt_shift; unsigned target_hpt_shift;
if (!mmu_hash_ops.resize_hpt) if (!mmu_hash_ops.resize_hpt)
return; return 0;
target_hpt_shift = htab_shift_for_mem_size(new_mem_size); target_hpt_shift = htab_shift_for_mem_size(new_mem_size);
...@@ -772,16 +772,11 @@ void resize_hpt_for_hotplug(unsigned long new_mem_size) ...@@ -772,16 +772,11 @@ void resize_hpt_for_hotplug(unsigned long new_mem_size)
* reduce unless the target shift is at least 2 below the * reduce unless the target shift is at least 2 below the
* current shift * current shift
*/ */
if ((target_hpt_shift > ppc64_pft_size) if (target_hpt_shift > ppc64_pft_size ||
|| (target_hpt_shift < (ppc64_pft_size - 1))) { target_hpt_shift < ppc64_pft_size - 1)
int rc; return mmu_hash_ops.resize_hpt(target_hpt_shift);
rc = mmu_hash_ops.resize_hpt(target_hpt_shift); return 0;
if (rc && (rc != -ENODEV))
printk(KERN_WARNING
"Unable to resize hash page table to target order %d: %d\n",
target_hpt_shift, rc);
}
} }
int hash__create_section_mapping(unsigned long start, unsigned long end, int nid) int hash__create_section_mapping(unsigned long start, unsigned long end, int nid)
......
...@@ -161,7 +161,8 @@ int __meminit arch_remove_memory(int nid, u64 start, u64 size, ...@@ -161,7 +161,8 @@ int __meminit arch_remove_memory(int nid, u64 start, u64 size,
*/ */
vm_unmap_aliases(); vm_unmap_aliases();
resize_hpt_for_hotplug(memblock_phys_mem_size()); if (resize_hpt_for_hotplug(memblock_phys_mem_size()) == -ENOSPC)
pr_warn("Hash collision while resizing HPT\n");
return ret; return ret;
} }
......
...@@ -901,8 +901,10 @@ static int pseries_lpar_resize_hpt(unsigned long shift) ...@@ -901,8 +901,10 @@ static int pseries_lpar_resize_hpt(unsigned long shift)
break; break;
case H_PARAMETER: case H_PARAMETER:
pr_warn("Invalid argument from H_RESIZE_HPT_PREPARE\n");
return -EINVAL; return -EINVAL;
case H_RESOURCE: case H_RESOURCE:
pr_warn("Operation not permitted from H_RESIZE_HPT_PREPARE\n");
return -EPERM; return -EPERM;
default: default:
pr_warn("Unexpected error %d from H_RESIZE_HPT_PREPARE\n", rc); pr_warn("Unexpected error %d from H_RESIZE_HPT_PREPARE\n", rc);
...@@ -918,7 +920,6 @@ static int pseries_lpar_resize_hpt(unsigned long shift) ...@@ -918,7 +920,6 @@ static int pseries_lpar_resize_hpt(unsigned long shift)
if (rc != 0) { if (rc != 0) {
switch (state.commit_rc) { switch (state.commit_rc) {
case H_PTEG_FULL: case H_PTEG_FULL:
pr_warn("Hash collision while resizing HPT\n");
return -ENOSPC; return -ENOSPC;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment