Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1183505img; Tue, 19 Mar 2019 02:10:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBaRoDYUffLTC/ZbU+qaEMoYDHiD1xdACazjtfm6g2iwJXma6nbrlwO2MiJe5CWTYL0yE9 X-Received: by 2002:a65:64cd:: with SMTP id t13mr836158pgv.326.1552986635187; Tue, 19 Mar 2019 02:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552986635; cv=none; d=google.com; s=arc-20160816; b=MAKGSAdICpLnEpesz3H935tz55S8lwf7lk15Zu3dV3xBrTrkvL0FKqHkbIeUDX39BJ tylKmNdG0FRVdUr7GpxyL7IqEm6uFQZ2mMYg9NZ9CjQkImCiecfC/fMoaxnZnxFbsoAN r7goaYM2tkTDuP/ppyCfXS83W2O8CgDwaUgVfGcIqpoI6ZiWvV65sYpnkY81RAZEa1rR yqcRb+AhdU8UGZIfWCD+yrK+fHVdQ+tUHSxp0/ab+O3hbtRPC2s9BD7DIjZNr82HJiUc xRUmsIoI065dESoUpOJBfuE2msLjm7NRW0fWOC9EAPOVEJGIFMli8zPNEsf+gZjzWklI ENBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=WmaX4bwpaSm3hvKXihqE2SFw6FuHnde5qJjGh+l+PAA=; b=UBX8OL51JEHJd7KDKeLg/X36G4CJEu+xKf88g3otybkeUMCFeN+dvuzQ6TMQaWVapm g21HrkglT6BvTQ0ET+Asx38/iR1qVvEb9q/T8xgzmKU37uWeRR3DIn92ySdupBlpcLPB fHSHWvmYJ38EJXvPGpxz4GLCEV+I/0xuJ7flBdreLVeBwf12CaH3rDiSuZBgDjIMy8Ml LQUkV+b1rzaoeOQtAd1FkJSIATtxwXBqj3zRQD4qo9k2YUdQXFivFdQSEAo6UuIxNltX 6t9WsIjw4v48QnaWpl9jvrIJij/UUNvkVxLBWk+rCyZ9aGrzJGMSZDHJ3QNvb/ZGzt9/ UaXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si10620010pgp.361.2019.03.19.02.10.19; Tue, 19 Mar 2019 02:10:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727408AbfCSJJB (ORCPT + 99 others); Tue, 19 Mar 2019 05:09:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45929 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfCSJJB (ORCPT ); Tue, 19 Mar 2019 05:09:01 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA9DC85546; Tue, 19 Mar 2019 09:09:00 +0000 (UTC) Received: from [10.36.116.217] (ovpn-116-217.ams2.redhat.com [10.36.116.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47A6E19C67; Tue, 19 Mar 2019 09:08:58 +0000 (UTC) Subject: Re: [PATCH v3] powerpc/mm: move warning from resize_hpt_for_hotplug() To: Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Christophe Leroy , David Gibson References: <20190313102528.4632-1-lvivier@redhat.com> From: Laurent Vivier Openpgp: preference=signencrypt Autocrypt: addr=lvivier@redhat.com; prefer-encrypt=mutual; keydata= mQINBFYFJhkBEAC2me7w2+RizYOKZM+vZCx69GTewOwqzHrrHSG07MUAxJ6AY29/+HYf6EY2 WoeuLWDmXE7A3oJoIsRecD6BXHTb0OYS20lS608anr3B0xn5g0BX7es9Mw+hV/pL+63EOCVm SUVTEQwbGQN62guOKnJJJfphbbv82glIC/Ei4Ky8BwZkUuXd7d5NFJKC9/GDrbWdj75cDNQx UZ9XXbXEKY9MHX83Uy7JFoiFDMOVHn55HnncflUncO0zDzY7CxFeQFwYRbsCXOUL9yBtqLer Ky8/yjBskIlNrp0uQSt9LMoMsdSjYLYhvk1StsNPg74+s4u0Q6z45+l8RAsgLw5OLtTa+ePM JyS7OIGNYxAX6eZk1+91a6tnqfyPcMbduxyBaYXn94HUG162BeuyBkbNoIDkB7pCByed1A7q q9/FbuTDwgVGVLYthYSfTtN0Y60OgNkWCMtFwKxRaXt1WFA5ceqinN/XkgA+vf2Ch72zBkJL RBIhfOPFv5f2Hkkj0MvsUXpOWaOjatiu0fpPo6Hw14UEpywke1zN4NKubApQOlNKZZC4hu6/ 8pv2t4HRi7s0K88jQYBRPObjrN5+owtI51xMaYzvPitHQ2053LmgsOdN9EKOqZeHAYG2SmRW LOxYWKX14YkZI5j/TXfKlTpwSMvXho+efN4kgFvFmP6WT+tPnwARAQABtCNMYXVyZW50IFZp dmllciA8bHZpdmllckByZWRoYXQuY29tPokCOAQTAQIAIgUCVgVQgAIbAwYLCQgHAwIGFQgC CQoLBBYCAwECHgECF4AACgkQ8ww4vT8vvjwpgg//fSGy0Rs/t8cPFuzoY1cex4limJQfReLr SJXCANg9NOWy/bFK5wunj+h/RCFxIFhZcyXveurkBwYikDPUrB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gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190313102528.4632-1-lvivier@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 19 Mar 2019 09:09:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, as it seems good now, could you pick up this patch for merging? Thanks, Laurent On 13/03/2019 11:25, Laurent Vivier wrote: > 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: David Gibson > Signed-off-by: Laurent Vivier > --- > > Notes: > v3: move "||" to above line and remove parenthesis > v2: add warning messages for H_PARAMETER and H_RESOURCE > > arch/powerpc/include/asm/sparsemem.h | 4 ++-- > arch/powerpc/mm/hash_utils_64.c | 19 +++++++------------ > arch/powerpc/mm/mem.c | 3 ++- > arch/powerpc/platforms/pseries/lpar.c | 3 ++- > 4 files changed, 13 insertions(+), 16 deletions(-) > > diff --git a/arch/powerpc/include/asm/sparsemem.h b/arch/powerpc/include/asm/sparsemem.h > index 68da49320592..3192d454a733 100644 > --- a/arch/powerpc/include/asm/sparsemem.h > +++ b/arch/powerpc/include/asm/sparsemem.h > @@ -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); > > #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 > -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 > > #ifdef CONFIG_NUMA > diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c > index 0cc7fbc3bd1c..5aa7594ee71b 100644 > --- a/arch/powerpc/mm/hash_utils_64.c > +++ b/arch/powerpc/mm/hash_utils_64.c > @@ -755,12 +755,12 @@ static unsigned long __init htab_get_table_size(void) > } > > #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; > > if (!mmu_hash_ops.resize_hpt) > - return; > + return 0; > > 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) > * reduce unless the target shift is at least 2 below the > * current shift > */ > - if ((target_hpt_shift > ppc64_pft_size) > - || (target_hpt_shift < (ppc64_pft_size - 1))) { > - int rc; > - > - rc = mmu_hash_ops.resize_hpt(target_hpt_shift); > - if (rc && (rc != -ENODEV)) > - printk(KERN_WARNING > - "Unable to resize hash page table to target order %d: %d\n", > - target_hpt_shift, rc); > - } > + if (target_hpt_shift > ppc64_pft_size || > + target_hpt_shift < ppc64_pft_size - 1) > + return mmu_hash_ops.resize_hpt(target_hpt_shift); > + > + return 0; > } > > int hash__create_section_mapping(unsigned long start, unsigned long end, int nid) > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > index 33cc6f676fa6..0d40d970cf4a 100644 > --- a/arch/powerpc/mm/mem.c > +++ b/arch/powerpc/mm/mem.c > @@ -169,7 +169,8 @@ int __meminit arch_remove_memory(int nid, u64 start, u64 size, > */ > 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; > } > diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c > index f2a9f0adc2d3..1034ef1fe2b4 100644 > --- a/arch/powerpc/platforms/pseries/lpar.c > +++ b/arch/powerpc/platforms/pseries/lpar.c > @@ -901,8 +901,10 @@ static int pseries_lpar_resize_hpt(unsigned long shift) > break; > > case H_PARAMETER: > + pr_warn("Invalid argument from H_RESIZE_HPT_PREPARE\n"); > return -EINVAL; > case H_RESOURCE: > + pr_warn("Operation not permitted from H_RESIZE_HPT_PREPARE\n"); > return -EPERM; > default: > 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) > if (rc != 0) { > switch (state.commit_rc) { > case H_PTEG_FULL: > - pr_warn("Hash collision while resizing HPT\n"); > return -ENOSPC; > > default: >