Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1892530ybn; Thu, 26 Sep 2019 03:55:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXiQ3mT8NLmcSIllGTrG4GVGmcC1K0BYHrI+pOWhNrc+rNQtybBIUZm3F3+jQDi2+5lLZS X-Received: by 2002:a17:906:3746:: with SMTP id e6mr2398005ejc.238.1569495300042; Thu, 26 Sep 2019 03:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569495300; cv=none; d=google.com; s=arc-20160816; b=FYPneY11PyL6S2bkoXgTsobUuvI5i3AyYIfsJABpXefPV/BmM6GHYvcuJk6zIdvT4A 33P9aNIyx6gXVpA/BQWHKe9gcdZVAdmB1/Tqkjc++SqnhvfRgUem+kYKZ8A+ZRNpZL31 F+rweQhhOqqjAbwMqmhhdn3Yw3b/PbG0Twx7AAxCx+aW+ZWQU/5i5o3dUpeoZGw0cvDO oWK24T5kT5E0NZhD4iE5hddrrE2EGJbzAxIgdK1F5U/KQatUBzSra6dmXvWxxb9iszvR V92flraiT35wHftFKmYwMjEgwRaLQO3VkL2R76o0OYgHXasa3JUoUUdlwrOhrNd16qus kCXw== 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=vaenSpra2l8M6RJEDEf3oMnJBbJUCESLcv9POl8pfSn2mATr7Hx24Dw/qnV/YUeufg tH6Utx9lkaYNtixdtEQIwWYMMtgXRl8iTd4agqqv1F71Sa2/QT1FNBO6R5IDAJemI0y6 PATysSBnxvVQzP9vj4lCufcwf/1QeVnvx3SJapto+M/JDYd/T12Vc8CJMTosJQOWoJlZ QxM8zQiOZCMeKor1TgQHi7iCrq4Emny4MeROI32PV7WUQTRzOrI12o82j8GsRlpaDGsP T1Q0NE3bFWpKInY+RP89/zbYTxDkre2zuGpiqNalFTCx1QBtl9B/ahIJbYn/2ZF4TjEN xhuQ== 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 d15si1081024edb.7.2019.09.26.03.54.36; Thu, 26 Sep 2019 03:55:00 -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 S2633575AbfIXV0i (ORCPT + 99 others); Tue, 24 Sep 2019 17:26:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36202 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2633531AbfIXV0J (ORCPT ); Tue, 24 Sep 2019 17:26:09 -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 x8OLOH4N040050; Tue, 24 Sep 2019 17:25:13 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v7u1f00ux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 17:25:13 -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 x8OLPCLh041938; Tue, 24 Sep 2019 17:25:12 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v7u1f00ua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 17:25:12 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8OLJrLX003220; Tue, 24 Sep 2019 21:25:11 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04dal.us.ibm.com with ESMTP id 2v5bg7fya3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 21:25:11 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8OLP9OB59244886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Sep 2019 21:25:09 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 85516C605F; Tue, 24 Sep 2019 21:25:09 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ED123C605B; Tue, 24 Sep 2019 21:25:04 +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:25:04 +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 05/11] powerpc/perf: Applies counting method to monitor lockless pgtbl walks Date: Tue, 24 Sep 2019 18:24:22 -0300 Message-Id: <20190924212427.7734-6-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=999 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 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