Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp356351ybx; Tue, 29 Oct 2019 20:12:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsTAudGOR5vmIAShlt/XBtaBgcIqa1ApjkB9oXcWYVIUsNUlHVIH0Zdq5LhnxRmr/Kss0S X-Received: by 2002:a17:906:6449:: with SMTP id l9mr6846456ejn.187.1572405149926; Tue, 29 Oct 2019 20:12:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1572405149; cv=pass; d=google.com; s=arc-20160816; b=u8U8TfvYjIAtj0lvNca1nNDyzZok6IfOakX9/blJYjb+1kXoO7dwOh73JePov+tWyV G4ZzP9Hm+X73ukobvSFWdVKzrjzUk09fBE4/Ku4UifiKWPYQLWLZjttzrEimjpdF/D5y FZmOyEdRzz20lkr+/8yqEEMkSukcJf6ArOZzucmuUm7UjKfsTVjpX8BUmvTWu0oSSM9X t0/J8eJ0GwHVppmstXy3k7UWQ3vvV7P35eR7k/YMzJgUxVyXCfnjy4Nu4QPH2AnnDNcL 2aD4INIXA29g43x997RWbGb2JqQsOPoF17nqQroLEdtEXfeE8omjycntf98r6GY64twq 0pTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=4OCst72IAltq51oAqdaRvFgX7tKcJ3FVSJdMU8zr4nk=; b=ltf8KGBgdRrRp9nEx2HWqPOU2MVhUxtJebiC6yUA7ub4HNbT6tktRv4bUptu9JNsFF NBKhqwhjPdpRj6q75XITfi+EkTbs1XRqfN8aCvOupIMXp3apfwLchTOnwiwopXUMKuqn kFKlpDdhGNVKBPYsiekuwnmiyaGP4A2/bYK3yDp4JoLTPfGV215Ql67bGCDjIG3itivS wrD9WKXJSSMaSWItOlkt6aXcTrmISdzLfXYgqNS3NkmVGDYDSmF1XcqaaPGd8cMpnxen NrD67QzX3ISUK6f5SWq4hPjeiuPHuGYUq8pnNs/Xrajn3mqoUkHdhvd1OiTZyMINca6j fMFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=AAEl3V1L; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u93si546553edc.184.2019.10.29.20.12.04; Tue, 29 Oct 2019 20:12:29 -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=@microsoft.com header.s=selector2 header.b=AAEl3V1L; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbfJ3DK1 (ORCPT + 99 others); Tue, 29 Oct 2019 23:10:27 -0400 Received: from mail-eopbgr820114.outbound.protection.outlook.com ([40.107.82.114]:61408 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726714AbfJ3DK0 (ORCPT ); Tue, 29 Oct 2019 23:10:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GdFRG1GRMpGGgxM8TgZL/6Ehaoi8RyygtC5mnD23sOACwdbEOLm/2bzsH3bF85DtZewNOuxlv05jmzUnNDZKPlEAx2XsqpYq7JREjE8YIjtaOzOUX7tXV4JUZ7939UAaOxQTVUj9DeOiEVkryDjDFtkJpRr4WSVbJK//4oykPONqTsrVk9cg68xtgoHni8pZ90xNGUAQtfZ2YyD9/WeKX0bi88TRjSgrjwW450e/d6zX15UmFxoy+YgnSJsxA0YTeh/oAQEdJgTNe/KpORKN7JO/MCD8eHV3VO5reBImRS2K7P7U835OCOTDs4wd2WWBxlOGu/fncMY5ZQYdaJzeag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4OCst72IAltq51oAqdaRvFgX7tKcJ3FVSJdMU8zr4nk=; b=D1WITrC5xznWFPaMxG4gOh2g2J3mVavliuMAQh2Nj9fziGjTAVTFwxoOC1CKUu9k1XmViZoA+yOlCVpI+MVKTNPF+Oeu0dhlsNg5iQPf+NUwbPuuisdPlqwcftCCgc7/rxOzst4iDeZRgC8gIjr4fck+RgQipP/hja056FrMQ43tkghvrZaBznMiElheJ+Z+rbOg8QtAk0MwRlbTJKJLMyn0f53hcSZIpiXUP3r+OqwwYHd8dqxRbCL7Y4xqxZ1FGrH3qMengz2Z4hw/T9fzC7ar4lhTVp32OFVeUhggR2iWo8Ml3PsLEP1v6fByY59AF/UNKe3RFGXL2WPf9IZzgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4OCst72IAltq51oAqdaRvFgX7tKcJ3FVSJdMU8zr4nk=; b=AAEl3V1L5rT5UDZOtYp3EDwEu7YeQbiS/t8Brm1iUR98nEY+hokK2E8Jugv0ojQkP4Y0DDrv3TB55IgSSVGSr9VFLyyGH/vzSDFOZTWFR2JmuZr96bIwWpAIZhjFY5IKKZJnQY5sqYWOrm8kSIU9BVSwL8XoaHXP0Wbq+HdXyD4= Received: from BN8PR21MB1362.namprd21.prod.outlook.com (20.179.76.155) by BN8PR21MB1219.namprd21.prod.outlook.com (20.179.73.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.8; Wed, 30 Oct 2019 03:10:24 +0000 Received: from BN8PR21MB1362.namprd21.prod.outlook.com ([fe80::61ce:42d2:1a58:7239]) by BN8PR21MB1362.namprd21.prod.outlook.com ([fe80::61ce:42d2:1a58:7239%7]) with mapi id 15.20.2408.016; Wed, 30 Oct 2019 03:10:24 +0000 From: Steve MacLean To: Jiri Olsa , Steve MacLean CC: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Stephane Eranian , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 3/4] perf inject --jit: Remove //anon mmap events Thread-Topic: [PATCH 3/4] perf inject --jit: Remove //anon mmap events Thread-Index: AQHVeWQ56mWbZMuS2UKJ/Lfd6rhxc6dIv9oAgCnrv5A= Date: Wed, 30 Oct 2019 03:10:23 +0000 Message-ID: References: <1570049901-115628-1-git-send-email-steve.maclean@linux.microsoft.com> <20191003105716.GB23291@krava> In-Reply-To: <20191003105716.GB23291@krava> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=stmaclea@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-10-30T03:10:22.2971541Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=4b46e905-6d17-4bd9-97a8-7e8e04a67f74; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic authentication-results: spf=none (sender IP is ) smtp.mailfrom=Steve.MacLean@microsoft.com; x-originating-ip: [24.163.126.65] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 25f7be97-89cc-4087-6135-08d75ce6b4c6 x-ms-traffictypediagnostic: BN8PR21MB1219:|BN8PR21MB1219: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02065A9E77 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(136003)(39860400002)(396003)(366004)(52314003)(54094003)(199004)(189003)(66066001)(229853002)(102836004)(8990500004)(7696005)(2906002)(446003)(54906003)(256004)(110136005)(11346002)(478600001)(10290500003)(74316002)(52536014)(14454004)(33656002)(5660300002)(6506007)(4744005)(10090500001)(486006)(76176011)(476003)(66946007)(316002)(3846002)(8936002)(99286004)(81156014)(55016002)(86362001)(81166006)(9686003)(8676002)(186003)(26005)(6246003)(22452003)(1511001)(71200400001)(66556008)(305945005)(71190400001)(7736002)(4326008)(76116006)(64756008)(66446008)(6116002)(66476007)(6436002)(25786009);DIR:OUT;SFP:1102;SCL:1;SRVR:BN8PR21MB1219;H:BN8PR21MB1362.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OLiEBTNeGAptcAIJIpBsGSf2iLDo9XpuUuxJGNejz/6dJnEQmPJnc0dNgvQaWLBY3k+kooEXwrG+MzZ8GP4glXro7rhYdQUbgX0XZVWSD9181ODm0ci6yW4sZvLG+jhYZObIcGDUI3bO7E0wmVAYFuURY0FaAUxqrzAeYDcMbrRFVnk2p+bofaLBqunkLX4pTQAAf/GCxn7MV0k0xqH42G/d9FPEumB2NVe8xl+kRiFJ+dNPtZo39il9yq77CX48ixv+QvxnBxcbt1se1WOCUGz538sI4h0xa8i4ffvKNhmnwZ/r6iWCO9GbPANBEOC6DmVsjWeQ3nlRZG4hnAvRd+cpGmNDB8u2x/o1z48jMnSjv9t3StylE3Xwrn68zB0j0RKQ91T3G/LDZt3OMbwxM2KWqtZGemgP/ZBgzKR0M52M1luJ3YTwL/b3RFBj5+sF Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25f7be97-89cc-4087-6135-08d75ce6b4c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2019 03:10:24.0158 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sNvkKYGqhmZVULJ0tNCxQB/1W9UX+G8SzCSGyGwCQ4gvISm3FLy4y0u6ZE1r082byslDj2Pp6UymC2WAomtpJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR21MB1219 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > anyway, I wonder if you could just use thread::priv flag for that, like: > > thread =3D machine__findnew_thread(machine, pid, pid); > if (!thread) > bad > > (int) thread->priv =3D 1; > > and check on thread->priv when ruling the pid out, should be faster then = maintain rb tree > > thanks, > jirka I agree reusing the existing data structure is a better approach. I have dr= afted a change reusing the void* priv field. It seems looks like it is curr= ently safe to use during perf inject. I will test it tomorrow then send the new patch