Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1770615ybn; Thu, 26 Sep 2019 01:51:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTfaqB3J+eCVu2w7GfImUCeKvsY0VF5bS5k0cjO2zqWJ/G7gub2bGczwrCvMi9+ApCrCbl X-Received: by 2002:a17:906:fad6:: with SMTP id lu22mr1991481ejb.98.1569487915288; Thu, 26 Sep 2019 01:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569487915; cv=none; d=google.com; s=arc-20160816; b=U+o2p3Ek5SNEJOAfHE/L7czcP0okgGM3Y1KDCfpV6U9r6ChHA/TIb7ThSFAVlsr30a N7o+m5Us6KnCK8Zwplz1owQvEJgxDyv54PesZ29UKuCeW5F34Y/ExMaOPe3NgJKnRM5f 5VZ5d6P2L5XNih+jrmZRxg8fknzQqxCFbUTjEFkolHEJnaOKZ8VcK9zBy3cVAXlA4gpf QU89bsbxSSfKiCcnLC24ecGHYhJtt+MjfZhT4OtXpo0H6QOkWZV+0fhoUMmLaiY1hoYS aUiJd79C94aBuSCV5jgKxGdFRGPweE5JSen3GwU7jmk/QhYRPtRXiiObvXNc7InM7dq4 DMxw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jZ6+SvMTRKusTpzWQVOJ+TbDSwUAx2y1QdDBVBu34pc=; b=c6oqSzglkNDYvTJCVzECoTlhC/uR7+cSBaZ3D/AMZG8AjV9Oaoi/z3utn8YhiVqhrA JJWPaI9NKbB7XRl81Um4bipKhcRI22JaM0nlEJpQv0vTNKcn+PqzLqlHi2/pkjLAJjgl HdS0tkt6fZ+/ocQK0CDpQ30wcLA14AtVAFYC4/pxXDPRxsWcJi1w1LuuO8YopsCLV/wl JYp4nwhXa/ep37ZD8wFyW3o0w5ZX834v39IzoH55wzhQ7twoMzS+grr06GPFZkUCzxPR +hSxiJb+NQJr5J3nybQSwfe+d7Jp9F9+kfsNdv4+2dJtpAeSEucWCV5qSSPBwd76W0dV JdqQ== 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 nl6si626053ejb.207.2019.09.26.01.51.31; Thu, 26 Sep 2019 01:51:55 -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 S2411040AbfIXVZy (ORCPT + 99 others); Tue, 24 Sep 2019 17:25:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47152 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2410730AbfIXVZx (ORCPT ); Tue, 24 Sep 2019 17:25:53 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8OLMOGx115972; Tue, 24 Sep 2019 17:24:59 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v7s8pku8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 17:24:59 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8OLOwBd121383; Tue, 24 Sep 2019 17:24:58 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v7s8pku7a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 17:24:58 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8OLJruo032757; Tue, 24 Sep 2019 21:24:56 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma03dal.us.ibm.com with ESMTP id 2v5bg780sv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 21:24:56 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8OLOsT648169450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Sep 2019 21:24:54 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A5E3AC6057; Tue, 24 Sep 2019 21:24:54 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B6B9C6055; Tue, 24 Sep 2019 21:24:49 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.184]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 24 Sep 2019 21:24:49 +0000 (GMT) From: Leonardo Bras To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Cc: Leonardo Bras , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , "Aneesh Kumar K.V" , Christophe Leroy , Andrew Morton , Dan Williams , Nicholas Piggin , Mahesh Salgaonkar , Greg Kroah-Hartman , Thomas Gleixner , Ganesh Goudar , Allison Randal , Mike Rapoport , YueHaibing , Ira Weiny , Jason Gunthorpe , John Hubbard , Keith Busch Subject: [PATCH v3 02/11] asm-generic/pgtable: Adds dummy functions to monitor lockless pgtable walks Date: Tue, 24 Sep 2019 18:24:19 -0300 Message-Id: <20190924212427.7734-3-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190924212427.7734-1-leonardo@linux.ibm.com> References: <20190924212427.7734-1-leonardo@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-24_10:,, 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=992 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909240173 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a need to monitor lockless pagetable walks, in order to avoid doing THP splitting/collapsing during them. Some methods rely on local_irq_{save,restore}, but that can be slow on cases with a lot of cpus are used for the process. In order to speedup these cases, I propose a refcount-based approach, that counts the number of lockless pagetable walks happening on the process. Given that there are lockless pagetable walks on generic code, it's necessary to create dummy functions for archs that won't use the approach. Signed-off-by: Leonardo Bras --- include/asm-generic/pgtable.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 75d9d68a6de7..0831475e72d3 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1172,6 +1172,21 @@ static inline bool arch_has_pfn_modify_check(void) #endif #endif +#ifndef __HAVE_ARCH_LOCKLESS_PGTBL_WALK_COUNTER +static inline void start_lockless_pgtbl_walk(struct mm_struct *mm) +{ +} + +static inline void end_lockless_pgtbl_walk(struct mm_struct *mm) +{ +} + +static inline int running_lockless_pgtbl_walk(struct mm_struct *mm) +{ + return 0; +} +#endif + /* * On some architectures it depends on the mm if the p4d/pud or pmd * layer of the page table hierarchy is folded or not. -- 2.20.1