Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157AbdI3Tsw (ORCPT ); Sat, 30 Sep 2017 15:48:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38816 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbdI3Tsv (ORCPT ); Sat, 30 Sep 2017 15:48:51 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C40AA3680F Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Sat, 30 Sep 2017 21:48:44 +0200 From: Jiri Olsa To: kan.liang@intel.com Cc: acme@kernel.org, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, namhyung@kernel.org, adrian.hunter@intel.com, lukasz.odzioba@intel.com, wangnan0@huawei.com, hekuang@huawei.com, ast@kernel.org, ak@linux.intel.com Subject: Re: [PATCH RFC V4 5/6] perf top: switch to backward overwrite mode Message-ID: <20170930194844.GA7196@krava> References: <1506696477-146932-1-git-send-email-kan.liang@intel.com> <1506696477-146932-6-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506696477-146932-6-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 30 Sep 2017 19:48:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1352 Lines: 28 On Fri, Sep 29, 2017 at 07:47:56AM -0700, kan.liang@intel.com wrote: > From: Kan Liang > > perf_top__mmap_read has severe performance issue in > Knights Landing/Mill, when monitoring in heavy load system. It costs > several minutes to finish, which is unacceptable. > > perf top was overwrite mode. But it is changed to non overwrite mode > since commit 93fc64f14472 ("perf top: Switch to non overwrite mode"). > For non overwrite mode, it tries to read everything in the ring buffer > and does not check the messup. Once there are lots of samples delivered > shortly, the processing time could be very long. > Knights Landing/Mill as a manycore processor contains a large number of > small cores. Because of the huge core number, it will generated lots of > samples in a heavy load system. Also, since the huge sample#, the mmap > writer probably bite the tail and mess up the samples. > > Also, to avoid the problems which is described in > commit 9ecda41acb97 ("perf/core: Add ::write_backward attribute to perf > event"), switch to backward overwrite mode. > Pausing the ring-buffer during perf_top__mmap_read to ensure the > ring-buffer is stable. > There would be some records lost in backward overwrite mode. Removing > the lost events checking. I'm getting perf top hogging the cpu completely with this change jirka