Received: by 10.213.65.68 with SMTP id h4csp312029imn; Fri, 6 Apr 2018 00:07:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/66qQglQ8dFai+GW5joMJGLB+/ihEFIh0o69a8ikS2yAmIMYZ+0fjOLYIN29o71m0Q60ML X-Received: by 10.101.97.163 with SMTP id i3mr17268073pgv.447.1522998428207; Fri, 06 Apr 2018 00:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522998428; cv=none; d=google.com; s=arc-20160816; b=ujCmKx44Lh2T2imi1GZKzFv89wPIgpVvItZJisFVbFCpgeDy6CPibv2wPrLH10UQO/ l8kD+fVAQvHJb0B0zRsCBt/bkd7Col9xRy5L+AsjNQRy9NQ0uqf+JEalG/1PzvvjDOWn GL908VGBM/OZXKTPkyVuQTW3IDfF5i1+CmGTyNlo+XC4KsgsHJ19KnWxLJvUpX7SQgN9 2FqkGakfMFhnWbEbcfy7kI5TkFdUUBxhoKXiewZ8UJppXm/gHoMOyCVkt2+G6KXH/CUw iM5vP7PHTT4qEwRi94bsMIEuNFvVbkor8dUZ2UMKr661k0kkj0zO288rU1J8J9CQlRUU e2Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=LSyPPQ/lwwHjJd8+o3XxQMUa/kJlbvraxkqgMl9SHNY=; b=haBNkLp1pTq9cPg9hfoBz6b6/2MXnlR6cC4lNxPsDDpAm+M0rpCOV7pvzD/7Kl7xSi dOaeeD8XwztpsKM915ZnWpVQ2OfHBOL0iY+51E4k4kEUbT/0Tv0vgzfqNhDj58ZClrOV /SJBaeRtEwAsW/blBNasJIH7iQ8eOHlnIrQQLG+M4Qq58LYFK7T7TiADhItnDUxZbfvT HMbmF77VUqQgf6JyuHCnwLtX9SUTWk2o0Y/RTLX/1ioZPVK6mOvh8DTFKXrMNSTRLpmP gx/Ga77LisRjYENkLToEXbJrNQNYGaQ8SzYJaqawTf9Xf33wrxTgxiaUMRo0rYLH+RYd eLRg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i84si7677606pfk.233.2018.04.06.00.06.24; Fri, 06 Apr 2018 00:07:08 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbeDFHDS (ORCPT + 99 others); Fri, 6 Apr 2018 03:03:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51498 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbeDFHDR (ORCPT ); Fri, 6 Apr 2018 03:03:17 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B8049E70; Fri, 6 Apr 2018 07:03:16 +0000 (UTC) Date: Fri, 6 Apr 2018 09:03:16 +0200 From: Greg Kroah-Hartman To: Ben Hutchings Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Stephane Eranian , Jiri Olsa , Andy Lutomirski , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: Re: [PATCH 4.4 014/134] perf tools: Make perf_event__synthesize_mmap_events() scale Message-ID: <20180406070316.GC8416@kroah.com> References: <20180319171849.024066323@linuxfoundation.org> <20180319171851.147448695@linuxfoundation.org> <1522340036.2654.20.camel@codethink.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1522340036.2654.20.camel@codethink.co.uk> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 29, 2018 at 05:13:56PM +0100, Ben Hutchings wrote: > On Mon, 2018-03-19 at 19:04 +0100, Greg Kroah-Hartman wrote: > > 4.4-stable review patch.??If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Stephane Eranian > > > > > > [ Upstream commit 88b897a30c525c2eee6e7f16e1e8d0f18830845e ] > > > > This patch significantly improves the execution time of > > perf_event__synthesize_mmap_events() when running perf record on systems > > where processes have lots of threads. > > > > It just happens that cat /proc/pid/maps support uses a O(N^2) algorithm to > > generate each map line in the maps file.??If you have 1000 threads, then you > > have necessarily 1000 stacks.??For each vma, you need to check if it > > corresponds to a thread's stack.??With a large number of threads, this can take > > a very long time. I have seen latencies >> 10mn. > > > > As of today, perf does not use the fact that a mapping is a stack, therefore we > > can work around the issue by using /proc/pid/tasks/pid/maps.??This entry does > > not try to map a vma to stack and is thus much faster with no loss of > > functonality. > > > > The proc-map-timeout logic is kept in case users still want some upper limit. > > > > In V2, we fix the file path from /proc/pid/tasks/pid/maps to actual > > /proc/pid/task/pid/maps, tasks -> task.??Thanks Arnaldo for catching this. > > > > Committer note: > > > > This problem seems to have been elliminated in the kernel since commit : > > b18cb64ead40 ("fs/proc: Stop trying to report thread stacks"). > [...] > > I don't think so. It looks like this was fixed by commit 65376df58217 > ("proc: revert /proc//maps [stack:TID] annotation") which we > already have in 4.4-stable. But older branches (3.16, 3.18, 4.1) don't > have that and probably should do. Now added to 3.18.y > It looks like commit b18cb64ead40 ("fs/proc: Stop trying to report > thread stacks") is also a candidate for stable. Now added to 3.18.y and 4.4.y, thanks! greg k-h