Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4917974pxj; Wed, 9 Jun 2021 05:13:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFq88l2+tPs9BbRQSrdDheWNx6HfmJjfbdjuhSoGwEOy6Tj09MmthXwoojJ+V91fJt4fTr X-Received: by 2002:aa7:d9d8:: with SMTP id v24mr29978074eds.15.1623240788821; Wed, 09 Jun 2021 05:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623240788; cv=none; d=google.com; s=arc-20160816; b=ionPzCFBZjEk0BDdntVJMlvsO6cb9FY6naWlsnt1jmBErl62lHjwCn7wlMT6B5DZTK WNeHCQt086Nh/+SGdgJ3uHtIb0hbwfGiFaGbS8XT/tyfVB4QmnZVhHk5ZX1fseNdgolh PRF0B9vjyVHyxEYLC/WZjkmhDi+VH+A5OkLdp+mUmwupb8uKEKWfWN4NJqPxextgC4bj cOwFOJYjhlJ2B9qwVzF/pTq9nyGKc7eoaomnQVxmqyHpRT5kPLOXVK+UEo2VZgmvT/zV AoxYrgmlj6+mUUrw3L0vT27NKJvQswp85f2eiqXBE2ATkrgWEYe1iA7lSITi10+ZD39m gMNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=ZRT8zrQ2N9SjTzmLEJcU4+KmU9ocAxkuy2bveBueYwo=; b=qVitOvtmS/8Gft+/vFDlvgvTYORq4h6KIMHcKWmi5coZ83MSb5PTV49auHE7cufny3 j0bEKfCvucP3RBpRBLXJJrWyyn5D0PP+N8lBLUfPRhf/amUMwBXyyAw4iPXhmCEB/QNC YrhtNAZRt5NYyCDELQi2uG48J5G6y8h3L2oRbVz2uzm+ZUhZ21jH9LntbyjjJxZMA4wI TP1CNsRSL64Fa0mY4a5MM82I2mDBR9Cm8dnGO3+Eg1T2/zd9fvOgCn0j/gQMpDVizp+8 poJYv0CEiMLauSgLXddrgze11tuwjCJcTjjJ4jNWQkdoaUsk5RHOwpg9UKHcXjPHNJCr 4VQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NYAGWBb4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si2044458ejr.626.2021.06.09.05.12.44; Wed, 09 Jun 2021 05:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NYAGWBb4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231610AbhFIAxe (ORCPT + 99 others); Tue, 8 Jun 2021 20:53:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231537AbhFIAxd (ORCPT ); Tue, 8 Jun 2021 20:53:33 -0400 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DF5BC061574 for ; Tue, 8 Jun 2021 17:51:40 -0700 (PDT) Received: by mail-qv1-xf31.google.com with SMTP id 5so1651862qvf.1 for ; Tue, 08 Jun 2021 17:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=ZRT8zrQ2N9SjTzmLEJcU4+KmU9ocAxkuy2bveBueYwo=; b=NYAGWBb4/K4c7eykm4A+8Rr2kdej77JpxU9svLenVqJEjU/93VhMDPF+MIcPnYv31E 4/l17VYX914tDAGbq52G/8GflBEBfS0uhf2aH4fjZQA1E3eNJWd1Yfe+Ldhqb0pZPZhW RNQvzdHdsIae8EWMxmEBl1BPJsi/4FlCts+FDcANdq5H7FszJo6SgZcs8+/Yqmkux6AZ /6xWX8lAcmQUerWPZ1diRnzTYqS4EYkKl8Y4/CUxMwxWo3ye8dch5AJ7b7O+0xO3vBWn K1SZNidDcISOj/ZBBhWte68Q6/PxQFmdytGMfGyN0lZ6ub03d82Ykx7GL9sfVxq/ixqK f9Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=ZRT8zrQ2N9SjTzmLEJcU4+KmU9ocAxkuy2bveBueYwo=; b=KgQnLu5omkzXJGgERb/6VBwI8ux0hqv67xgqsPLh+edHEdu03LVLvdOIZtDJ/YftAA b4o4VkqTGmVF1iOi3//u8Eqxnt6et7xs0ScSuoSHMpXmLtjP5j7hxk66FCDZFBJ2wb5c ZUGBycmMOhJx8wgjfQPFYcsW8I+370FZWbISHV2JkrUqnNve3g3F4gJPTg98NkbMsDvp 4c548nMqopmJwJXuwm6GVtJ4ZfJqWS0QxuIzm2tueAz6hPFv3j/TcXZk/G8HK5XPpgif JzyKKFQCy1E5X+0ex7HVbBU/aZfrMDriseVq/YPpbkhouJgRORwSAHF6jCN1+DX65b8t FjYg== X-Gm-Message-State: AOAM533O07XmqoVdiwEAonkWSBPvLno1qAvZCnV5o4W4QGfQ2hbzOWYS BnuEduUEj3Ftn562bHXjRnE= X-Received: by 2002:a0c:eda5:: with SMTP id h5mr3227067qvr.26.1623199899716; Tue, 08 Jun 2021 17:51:39 -0700 (PDT) Received: from ?IPv6:2804:14c:482:87bb::1002? ([2804:14c:482:87bb::1002]) by smtp.gmail.com with ESMTPSA id m199sm12011191qke.71.2021.06.08.17.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 17:51:39 -0700 (PDT) Message-ID: <648b382159009c5f4277d9b9c3f896142ea75d6c.camel@gmail.com> Subject: Re: [PATCH v2 1/3] powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug From: Leonardo =?ISO-8859-1?Q?Br=E1s?= To: David Gibson Cc: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Sandipan Das , Mike Rapoport , Andrew Morton , "Aneesh Kumar K.V" , Nicholas Piggin , Nathan Lynch , David Hildenbrand , Scott Cheloha , Laurent Dufour , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Tue, 08 Jun 2021 21:52:10 -0300 In-Reply-To: References: <20210430143607.135005-1-leobras.c@gmail.com> <20210430143607.135005-2-leobras.c@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-06-07 at 15:02 +1000, David Gibson wrote: > On Fri, Apr 30, 2021 at 11:36:06AM -0300, Leonardo Bras wrote: > > Because hypervisors may need to create HPTs without knowing the > > guest > > page size, the smallest used page-size (4k) may be chosen, > > resulting in > > a HPT that is possibly bigger than needed. > > > > On a guest with bigger page-sizes, the amount of entries for HTP > > may be > > too high, causing the guest to ask for a HPT resize-down on the > > first > > hotplug. > > > > This becomes a problem when HPT resize-down fails, and causes the > > HPT resize to be performed on every LMB added, until HPT size is > > compatible to guest memory size, causing a major slowdown. > > > > So, avoiding HPT resizing-down on hot-add significantly improves > > memory > > hotplug times. > > > > As an example, hotplugging 256GB on a 129GB guest took 710s without > > this > > patch, and 21s after applied. > > > > Signed-off-by: Leonardo Bras > > Sorry it's taken me so long to look at these > > I don't love the extra statefulness that the 'shrinking' parameter > adds, but I can't see an elegant way to avoid it, so: > > Reviewed-by: David Gibson np, thanks for reviewing! Best regards, Leonardo Bras