Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2404718ybj; Mon, 23 Sep 2019 03:16:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyP0kYvM8b2tHizbAO2B+LnWYJrAi4t+gnq3qRklwOlk31bIQ51uzZE/oNgZ4PqSEksbjc X-Received: by 2002:a17:907:41db:: with SMTP id og19mr17453544ejb.307.1569233818463; Mon, 23 Sep 2019 03:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569233818; cv=none; d=google.com; s=arc-20160816; b=A6j2R75v1lWsuliHP6DypZr2dWxT61NkFdTxP9fqP4VMXm+BRvsskjlUToEhpjqheD FB1mStmVF6wmx4i3JPERyvxrkhVhZHZgXQ56AJj36OcQtydiIt3k1icsyu1ApKD7vwOL o5h7d/Yx0vyGZHOOaz9Kav50Fd3QC8ou/uQtNOhSlwGHnMzA3N1QM20AKW3DIUu60Trw 4htVaAE0R841CcTjuboiC3+4NMGPkuv/NUAq5WbGkfPTCAI9OUUadjE8eKQ7UoT2L3Lz Cj2B+EY8359Lit6A8J0PIEhSeBSioP4poLhjQiwLKrGFJnGC/jQsSw+48KE/DOZXxqC1 jo1w== 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=KdQeu9uby8K9acSveFBufSHiyApskEq7+4O+aISt4Y4ABXkC7/WhC7oCMGy5Ypp2zR UfEISJggYg+0Qre/m1mlYTnx3DSRsIAf+OiZgOdpPeQ2zQfFNFCIZoiuCi4QZYh9hUhd aA2tkHoi9GPyA34PYBccduAGYM44GzbUJd7pBFT94pBzATSQO6x7ZVcvBjz/rTwNxPBD zICwSnfbqrpY1dXSHrzuuf5AF32W1iaNb0ubq6Ymzoe+mlBb3HkhAlWy7h19ZB2U8QLa m0rxQNw8jh7WTwrLagbIHKuRAM0C6Nq+vUA3wPiABR+RV7a603OoODpMDjvTyhLbg7uV Nd1w== 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 m12si6149018edc.50.2019.09.23.03.16.35; Mon, 23 Sep 2019 03:16:58 -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 S2436813AbfITTwW (ORCPT + 99 others); Fri, 20 Sep 2019 15:52:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:9172 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726089AbfITTwS (ORCPT ); Fri, 20 Sep 2019 15:52:18 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8KJnpj4001321; Fri, 20 Sep 2019 15:51:46 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v53kckvf5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Sep 2019 15:51:45 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8KJov69004373; Fri, 20 Sep 2019 15:51:45 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v53kckveq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Sep 2019 15:51:45 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8KJoHU8025078; Fri, 20 Sep 2019 19:51:44 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01dal.us.ibm.com with ESMTP id 2v3vbucv68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Sep 2019 19:51:44 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8KJpgpe53870902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Sep 2019 19:51:42 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B7CD78060; Fri, 20 Sep 2019 19:51:42 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CFF547805F; Fri, 20 Sep 2019 19:51:37 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.184]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 20 Sep 2019 19:51:37 +0000 (GMT) From: Leonardo Bras To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.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 , Thomas Gleixner , Richard Fontana , Ganesh Goudar , Allison Randal , Greg Kroah-Hartman , Mike Rapoport , YueHaibing , Ira Weiny , Jason Gunthorpe , John Hubbard , Keith Busch Subject: [PATCH v2 05/11] powerpc/perf: Applies counting method to monitor lockless pgtbl walks Date: Fri, 20 Sep 2019 16:50:41 -0300 Message-Id: <20190920195047.7703-6-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190920195047.7703-1-leonardo@linux.ibm.com> References: <20190920195047.7703-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-20_07:,, 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-1908290000 definitions=main-1909200161 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