Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp109152imm; Tue, 22 May 2018 15:00:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/Myp0d4DwzAL+9bMl1rn3Eedr5ijCKNM/Dxi8qnnJT/EUvQXxXYVggb9/rz2tXxkrnz8U X-Received: by 2002:a17:902:ab93:: with SMTP id f19-v6mr227766plr.392.1527026425263; Tue, 22 May 2018 15:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527026425; cv=none; d=google.com; s=arc-20160816; b=hNJKsWoNsh4GEchyvAgH6vcp3rRwTVvGEvlhDjikcg0wg7XulEZMpKGy5xeR/5Gois xB4Ad/OyTmFSLa844/fdiHdRqzNW5yXjdoFLQIT8c5ym09/WqsEK5jN/sQnFbdwMLQLB l8OFT2IoCuxb3HEw7avtBwgstPDWgVFi4WHMxXmZek3LSUlxXqxysPfdKLlduy+LoC75 P9qNvhnuKxXJCitbXKAVSwcNkBczn23G/84s3duXauDl1Y/NmpCFAZKTJOmE0acUGOag 5jUvaRNmCooMWjfKsrW3Iu0YUL3ZrIw3GROXI6XaKKXT2yEvpM44N/o2gpW4NBCqPk9Y WirQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature:arc-authentication-results; bh=yWneJTuCBt6qKKvJXmbq3cJnpyDzWRwC29by5Vsn7tk=; b=HN1kt4AjMT84jIqNa4nuhtHh+9tkt8B0tlMMgOWmPY1jnQnu+I7765CPsAFFbFx5hm 4qTOJfwfXqCWa/XRapiLqkhgDb1Y51Ixfu3B4Eywar5NVpFCZj0tZOes0nl2b9lbdFjP ne6+CqGDRXVGumXPsqcGXv6Yv/GMwyL8anw7ZR9ZKuvwEcMuC7aDFx5BB1b+MzCUlnyT 2FdhdIhBDc8Ec8Qsx8h9mvhxC5/TDZAEgJNfQm/bi+HoWJ9Ar12drupXxOE8aDRd6F27 alzfX10yLiVzz+5hjEnVZY9gg/8sl3OKkr2H1KlNLV+/o85lPGqumNvVUwXL7kGzjbhL glKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=VwaevSJn; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=VgNXFnc6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si13458389pgv.246.2018.05.22.15.00.10; Tue, 22 May 2018 15:00:25 -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; dkim=pass header.i=@fb.com header.s=facebook header.b=VwaevSJn; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=VgNXFnc6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753387AbeEVV6s (ORCPT + 99 others); Tue, 22 May 2018 17:58:48 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:42808 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753141AbeEVV6p (ORCPT ); Tue, 22 May 2018 17:58:45 -0400 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.22/8.16.0.22) with SMTP id w4MLwN6o006863; Tue, 22 May 2018 14:58:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=yWneJTuCBt6qKKvJXmbq3cJnpyDzWRwC29by5Vsn7tk=; b=VwaevSJnTDLpFkbxwAf7cTRATshFl+b6IM++Fa99sbITgQDioi0gmmgK3tdIb5lurJjJ N+Z6vGh0NnQeU0iZqxEP0UBhvpvYzoWOSG/lxAsZ2UzpSoZkxubtChZFnBwPOYmNmUW5 MK03NaLbjK5GTRVZAFf+9xr7JPnynYW8TO8= Received: from mail.thefacebook.com ([199.201.64.23]) by m0001303.ppops.net with ESMTP id 2j4njjsbu6-3 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 22 May 2018 14:58:23 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.13) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 22 May 2018 14:56:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yWneJTuCBt6qKKvJXmbq3cJnpyDzWRwC29by5Vsn7tk=; b=VgNXFnc6gmCx6Cfp6fMxCy0rK/x8y8sr3c4QjJ/n8cl1Mg5uUJSxJ6pwWiEJRrsbrv+ET7cSLu0icv9PgUF6GYN7nD7M7a+CWa2TKY/KgIrPSrRWoz7xOxSfWCZvZ7RhK6JI29+uzsGN4qOU+t0AKYm/ZpuH8/xkoUKwTUTq7FE= Received: from DM5PR15MB1548.namprd15.prod.outlook.com (10.173.222.139) by DM5PR15MB1660.namprd15.prod.outlook.com (10.175.108.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Tue, 22 May 2018 21:56:18 +0000 Received: from DM5PR15MB1548.namprd15.prod.outlook.com ([fe80::ed04:3d18:1352:663c]) by DM5PR15MB1548.namprd15.prod.outlook.com ([fe80::ed04:3d18:1352:663c%17]) with mapi id 15.20.0776.015; Tue, 22 May 2018 21:56:18 +0000 From: Song Liu To: Alexander Shishkin CC: Linux Kernel Mailing List , Kernel Team , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH 2/2] perf/core: fix bad use of igrab in kernel/event/core.c Thread-Topic: [PATCH 2/2] perf/core: fix bad use of igrab in kernel/event/core.c Thread-Index: AQHT1t6nfeADCJH+rUmeeV0pDKTod6QHnlsAgDTjVAA= Date: Tue, 22 May 2018 21:56:18 +0000 Message-ID: <7815A35E-6506-477D-8E57-3960F7C1FE62@fb.com> References: <20180418062907.3210386-1-songliubraving@fb.com> <20180418062907.3210386-2-songliubraving@fb.com> <20180419061710.l6sdq3kvricpyjdu@um.fi.intel.com> In-Reply-To: <20180419061710.l6sdq3kvricpyjdu@um.fi.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3445.6.18) x-originating-ip: [199.201.64.131] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR15MB1660;7:FfLlOMpGQs/R2er53kQnm3KaA2A30Udz+mxn82L8oSRbmZDwRyYB+k8HnvsvYBdbd68itnm4XbVHEJzn4UFMJYJ3KcRvTRFUvDytRqPgjVI+v5Vqf7/r2A0ErsHYMt7Q6dEB2JyckSOf2p3jGVhpjV7fpwZoaR8zeY6T3inXfoGkOM3QfV7hdR3NAZ7pF074rPM7v8dasTVHrShoCZ+mUMq8Zm275b/8Rz406TifxLKRpkTc6bPKWavAOFUICofZ;20:Kt5C3RPsXdcXkkRjZUyAOZz2VedgDcM0MF6fHcvTfCx5j32E1pzg+Fa59k2bm4lps+N52NgzdsIWaWYtMTVI/SKERAJbhIoMshDQbpTVa1zG9so/llVCw4HxuILlCmnT28lJGDuE8heyo09lO1wguqn/TEhxhVb+Y5kLa0G6L08= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM5PR15MB1660; x-ms-traffictypediagnostic: DM5PR15MB1660: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(11241501184)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM5PR15MB1660;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1660; x-forefront-prvs: 0680FADD48 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(366004)(376002)(346002)(39380400002)(189003)(199004)(54906003)(14454004)(83716003)(186003)(5250100002)(102836004)(82746002)(2906002)(50226002)(36756003)(8936002)(6916009)(5660300001)(305945005)(7736002)(25786009)(26005)(6506007)(105586002)(3846002)(6116002)(86362001)(6512007)(53546011)(3660700001)(97736004)(33656002)(57306001)(53936002)(6436002)(316002)(81166006)(99286004)(81156014)(478600001)(229853002)(106356001)(76176011)(486006)(2900100001)(4326008)(11346002)(3280700002)(2616005)(476003)(68736007)(6486002)(6246003)(446003)(66066001)(8676002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1660;H:DM5PR15MB1548.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: SMyyFDRDg7+l+AmNxrnF372MBh/xruH2u8PxDPYnqvcYBrh62yL0wds4szDq4ytx4le8Ha4yW9gpkgqZ6FYXAUQUn0LAGF9pt85mBUt/LGw+R0Auz606tVq8qfNLCR40reblNZWW0KVI7CU7T02G3AtPhUpI6iZ8b4T70+km7lJFuEcmrUlQ8n/ifOKMN+Ky spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 65ad1c98-62ba-4e91-fecf-08d5c02ed942 X-MS-Exchange-CrossTenant-Network-Message-Id: 65ad1c98-62ba-4e91-fecf-08d5c02ed942 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2018 21:56:18.7930 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1660 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-22_07:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 18, 2018, at 11:17 PM, Alexander Shishkin wrote: >=20 > On Tue, Apr 17, 2018 at 11:29:07PM -0700, Song Liu wrote: >> As Miklos reported and suggested: >>=20 >> This pattern repeats two times in trace_uprobe.c and in >> kernel/events/core.c as well: >>=20 >> ret =3D kern_path(filename, LOOKUP_FOLLOW, &path); >> if (ret) >> goto fail_address_parse; >>=20 >> inode =3D igrab(d_inode(path.dentry)); >> path_put(&path); >>=20 >> And it's wrong. You can only hold a reference to the inode if you >> have an active ref to the superblock as well (which is normally >> through path.mnt) or holding s_umount. >=20 > Oops. I must have snatched it from the uprobe code without thinking. >=20 >> This way unmounting the containing filesystem while the tracepoint is >> active will give you the "VFS: Busy inodes after unmount..." message >> and a crash when the inode is finally put. >>=20 >> Solution: store path instead of inode. >>=20 >> This patch fixes the issue in kernel/event/core.c. >>=20 >> NOTE: Based on my understanding, perf_addr_filter only supports intel_pt= . >=20 > Coresight too, but that's probably even further away from what you have. >=20 >> However, my test system doesn't support address filtering (or I made a >> mistake?). Therefore, I have NOT tested this patch. >=20 > Check /sys/devices/intel_pt/caps/num_address_ranges, if it's non-zero, > it's supported. >=20 >> Could someone please help test it? >=20 > Yes: >=20 > Reviewed-and-tested-by: Alexander Shishkin >=20 > The subject line needs a little love to be more like other perf commits, = but > other than that, looks good. >=20 > Thanks! Did this patch ever make into tip/perf/XX trees? If not, what shall I do=20 to move it ahead? Thanks, Song