Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2703433ybe; Thu, 12 Sep 2019 13:34:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKbITK/Gnc1Cgd+LbLZh4JjBgDbHw9VmSTXjsaW5R1/CmiL1xymvto0mNZx/KQi7JEn3Gh X-Received: by 2002:a50:ad5a:: with SMTP id z26mr43344828edc.180.1568320450785; Thu, 12 Sep 2019 13:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568320450; cv=none; d=google.com; s=arc-20160816; b=RRyrrv4KfTjxo/12XROz4OaUcFvZw3VI95x8GEQBJUQmOYwtXqaKIetyFZpU8ugKz3 P2WeRAP4k9SggT7w97lFJT/C//xppekZD0PkWQsjzNlSQK8wHGDgUHXvpNHSrMSCvNp6 HII/SAp/SoW1TZLIpd6RnMhOwPQYJACdKQEW0a5GGgmXNVtMwT4qSiIlzzf05xjs1Bct SpIRJYixeuSygeYzk2XhtABD+rDnsiylZqWzAhF+ALnpYN5rf5xpINQdUx2kDeVuGwds wpOM9E1uSBzbfUmySCdpZ/HRDQEOrFqn9JNhks+OUCWeFmWa70lJtDoDauJJ6slonu0L zAgQ== 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:from:references:cc:to:subject; bh=D+M6nX9pZEdb1fkTPpVopXN/bnG/pLgaEzI0pLpRDyc=; b=nS6sp9EaKQ7Fl+metkOOuwcdnzt+zDUkLb5R/ZS6dmJ4uMyjAaF1cMdOehq0sl9RhA UITfsqVuui4ET1zin6KhlBdGZM0zOzn1LiFv8Ved/BhHqyRXQFvZQHC8UeMV0MiKpMSL WW+kqLIr9Vfaz/Y3CepKRLpXTzKR0lY0+0tq4+R+/QvIvUqSV32iDRWlaW2dOsjdFa39 9NeRsJTuO0m9KUGjOsIxR4jNfTpN6BB1fNMerzZyXTmfDQ6UuS6DLwRz65eY5KOEGFCX 7NwdKudfxr7QHR25hnHcGGx1QV4/WvsFJrS7ofE6sTtziOXljgakCdYyT/0XXpmGgKpj eI9A== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si13074414eju.47.2019.09.12.13.33.47; Thu, 12 Sep 2019 13:34:10 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732576AbfILOUw (ORCPT + 99 others); Thu, 12 Sep 2019 10:20:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47702 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732455AbfILOUw (ORCPT ); Thu, 12 Sep 2019 10:20:52 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8CE7djK042946; Thu, 12 Sep 2019 10:20:26 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uyp3fc98r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 10:20:26 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8CE7uG7043532; Thu, 12 Sep 2019 10:20:25 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uyp3fc97w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 10:20:25 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8CEKDHg003456; Thu, 12 Sep 2019 14:20:24 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma02dal.us.ibm.com with ESMTP id 2uv467y990-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 14:20:24 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8CEKIb855771578 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Sep 2019 14:20:18 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0D1C2136055; Thu, 12 Sep 2019 14:20:18 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77FC9136063; Thu, 12 Sep 2019 14:20:15 +0000 (GMT) Received: from [9.199.32.243] (unknown [9.199.32.243]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 12 Sep 2019 14:20:15 +0000 (GMT) Subject: Re: [PATCH 3/3] powerpc/mm: call H_BLOCK_REMOVE when supported To: Laurent Dufour , mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20190830120712.22971-1-ldufour@linux.ibm.com> <20190830120712.22971-4-ldufour@linux.ibm.com> From: "Aneesh Kumar K.V" Message-ID: <5bcd3da7-1bc2-f3f9-3ed2-e3aa0bb540bd@linux.ibm.com> Date: Thu, 12 Sep 2019 19:50:14 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190830120712.22971-4-ldufour@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-12_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909120149 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/19 5:37 PM, Laurent Dufour wrote: > Instead of calling H_BLOCK_REMOVE all the time when the feature is > exhibited, call this hcall only when the couple base page size, page size > is supported as reported by the TLB Invalidate Characteristics. > supported is not actually what we are checking here. We are checking whether the base page size actual page size remove can be done in chunks of 8 blocks. If we don't support 8 block you fallback to bulk invalidate. May be update the commit message accordingly? > For regular pages and hugetlb, the assumption is made that the page size is > equal to the base page size. For THP the page size is assumed to be 16M. > > Signed-off-by: Laurent Dufour > --- > arch/powerpc/platforms/pseries/lpar.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c > index 375e19b3cf53..ef3dbf108a65 100644 > --- a/arch/powerpc/platforms/pseries/lpar.c > +++ b/arch/powerpc/platforms/pseries/lpar.c > @@ -1143,7 +1143,11 @@ static inline void __pSeries_lpar_hugepage_invalidate(unsigned long *slot, > if (lock_tlbie) > spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags); > > - if (firmware_has_feature(FW_FEATURE_BLOCK_REMOVE)) > + /* > + * Assuming THP size is 16M, and we only support 8 bytes size buffer > + * for the momment. > + */ > + if (mmu_psize_defs[psize].hblk[MMU_PAGE_16M] == 8) > hugepage_block_invalidate(slot, vpn, count, psize, ssize); > else > hugepage_bulk_invalidate(slot, vpn, count, psize, ssize); So we don't use block invalidate if blocksize is != 8. > @@ -1437,7 +1441,10 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local) > if (lock_tlbie) > spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags); > > - if (firmware_has_feature(FW_FEATURE_BLOCK_REMOVE)) { > + /* > + * Currently, we only support 8 bytes size buffer in do_block_remove(). > + */ > + if (mmu_psize_defs[batch->psize].hblk[batch->psize] == 8) { > do_block_remove(number, batch, param); > goto out; > } > -aneesh