lkml.org 
[lkml]   [2021]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] mm,memory_hotplug: print the min alignment in check_pfn_span
From
Date
On 02.06.21 10:47, Max Gurtovoy wrote:
> The warning only prints the start and end pfns. Add min_align to the
> warning print to add more info regarding the failure.
>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> ---
> mm/memory_hotplug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 8c3b423c1141..9e86e9ee0a10 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -289,8 +289,8 @@ static int check_pfn_span(unsigned long pfn, unsigned long nr_pages,
> else
> min_align = PAGES_PER_SECTION;
> if (!IS_ALIGNED(pfn, min_align) || !IS_ALIGNED(nr_pages, min_align)) {
> - WARN(1, "Misaligned __%s_pages start: %#lx end: %#lx\n",
> - reason, pfn, pfn + nr_pages - 1);
> + WARN(1, "Misaligned __%s_pages min_align: %#lx start: %#lx end: %#lx\n",
> + reason, min_align, pfn, pfn + nr_pages - 1);
> return -EINVAL;
> }
> return 0;
>

Not sure if we really care. I expect only developers will run into that
hacking on something new, and they will have to dig deeper either way.

While at it, I'd suggest converting this to pr_warn(), as WARN() is
frowned upon as it can crash the kernel with panic_on_warn as set by
some distros.

Reviewed-by: David Hildenbrand <david@redhat.com>

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2021-06-02 11:02    [W:0.049 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site