Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4106221ybn; Fri, 27 Sep 2019 16:42:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw02aKGc7xiqcKVIGM8ob9+rmMfXXyZaW5OOjQtYNduryAC6YFCXI+E39Nq8CtboIdQp3+ X-Received: by 2002:a50:d903:: with SMTP id t3mr7271224edj.117.1569627726445; Fri, 27 Sep 2019 16:42:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569627726; cv=none; d=google.com; s=arc-20160816; b=wPxYSMeG/cICO6McAOJX9TuYa/9+PExFp6LWe4lchSBfyYzF/NE97+RF+6psCGsR1J WC/pDg8317R1Cgadxa6LNL7UWoC+qpcb2ZvgaupypSgd+HQSIAno4UgQa0kkOQ7YxROk 63BS1gQTStkRfDb+qOwVxAtBRgqCCaFLl7ONoz1y+Qytzxc2Ch+itpdyG2g4u4XpmiFF tXIRCdP4Hh5Z04k3MWl0kqgBwyYI0H88c2tEZfW0tNHbQc4A4VCDRYbGAREU81b0d219 cUrGxlwFz//X5eEQGFfTjXyr9auJrDeT7beYFHtzIBUeVO964/IGczRNJZNJnZq6vW9J XMxA== 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=B2+MzIdPc68D+rTGJz7hC/FMFt+h/+8j2U4tgaqbgAM=; b=Hsl3oFkpiclkzyAm+7S0mWbY1xzJM/i21ikNqLt8vcy1Dw9KF+8GsWd8N7IfzD6qD1 waQH3q0+mp3oxB6XIkj6+1dvqykSP6s8Rc1rNmYom1FkgXNrGMIU6B9KMdowcXn0da4y 9eAEFwFnaS1gtVa8vUimYupbTo3mJ9Mxo++YChePaciR8gYLOW2QWAMJDB6fuLcD5ofi DND0Fab/3A0sN5Hcz93KBzTbcCfFnHeHQfystk5mVakT4mvNXwfY7fIpCoTn+n1nmD11 ICt5l/is65zelMtF5zkGbN4AAywgiyhcZxVmocXGC0FCuPESNT2ZzoG16H/w3wmByHb3 m1Bg== 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 p9si2676010edc.96.2019.09.27.16.41.42; Fri, 27 Sep 2019 16:42:06 -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 S1728602AbfI0XlT (ORCPT + 99 others); Fri, 27 Sep 2019 19:41:19 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56558 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728558AbfI0XlS (ORCPT ); Fri, 27 Sep 2019 19:41:18 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8RNbUEF079996; Fri, 27 Sep 2019 19:40:46 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v9umg8vqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Sep 2019 19:40:46 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8RNejHa084360; Fri, 27 Sep 2019 19:40:45 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v9umg8vqb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Sep 2019 19:40:45 -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 x8RNeONe023855; Fri, 27 Sep 2019 23:40:44 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03dal.us.ibm.com with ESMTP id 2v5bg8b708-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Sep 2019 23:40:44 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8RNehoJ43581784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Sep 2019 23:40:44 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D43C0112063; Fri, 27 Sep 2019 23:40:43 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A0DC112062; Fri, 27 Sep 2019 23:40:40 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.58]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 27 Sep 2019 23:40:40 +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 , Allison Randal , Thomas Gleixner , Ganesh Goudar , Mike Rapoport , YueHaibing , Greg Kroah-Hartman , Ira Weiny , Jason Gunthorpe , John Hubbard , Keith Busch Subject: [PATCH v4 05/11] powerpc/perf: Applies counting method to monitor lockless pgtbl walks Date: Fri, 27 Sep 2019 20:40:02 -0300 Message-Id: <20190927234008.11513-6-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927234008.11513-1-leonardo@linux.ibm.com> References: <20190927234008.11513-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-27_09:,, 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=989 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909270205 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applies the counting-based method for monitoring lockless pgtable walks on read_user_stack_slow. Signed-off-by: Leonardo Bras --- arch/powerpc/perf/callchain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c index c84bbd4298a0..9d76194a2a8f 100644 --- a/arch/powerpc/perf/callchain.c +++ b/arch/powerpc/perf/callchain.c @@ -113,16 +113,18 @@ static int read_user_stack_slow(void __user *ptr, void *buf, int nb) int ret = -EFAULT; pgd_t *pgdir; pte_t *ptep, pte; + struct mm_struct *mm = current->mm; unsigned shift; unsigned long addr = (unsigned long) ptr; unsigned long offset; unsigned long pfn, flags; void *kaddr; - pgdir = current->mm->pgd; + pgdir = mm->pgd; if (!pgdir) return -EFAULT; + start_lockless_pgtbl_walk(mm); local_irq_save(flags); ptep = find_current_mm_pte(pgdir, addr, NULL, &shift); if (!ptep) @@ -146,6 +148,7 @@ static int read_user_stack_slow(void __user *ptr, void *buf, int nb) ret = 0; err_out: local_irq_restore(flags); + end_lockless_pgtbl_walk(mm); return ret; } -- 2.20.1