From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756003AbaD1NfB (ORCPT ); Mon, 28 Apr 2014 09:35:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbaD1NfA (ORCPT ); Mon, 28 Apr 2014 09:35:00 -0400 Date: Mon, 28 Apr 2014 15:34:43 +0200 From: Jiri Olsa To: Namhyung Kim Cc: linux-kernel@vger.kernel.org, Corey Ashford , David Ahern , Frederic Weisbecker , Ingo Molnar , Paul Mackerras , Peter Zijlstra , Arnaldo Carvalho de Melo , Jean Pihet Subject: Re: [PATCH 2/3] perf tools: Cache dso data file descriptor Message-ID: <20140428133443.GE18628@krava.brq.redhat.com> References: <1397756352-26694-1-git-send-email-jolsa@redhat.com> <1397756352-26694-3-git-send-email-jolsa@redhat.com> <1398609395.1689.17.camel@leonhard> <20140428100133.GE1109@krava.brq.redhat.com> <1398690994.1724.13.camel@leonhard> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1398690994.1724.13.camel@leonhard> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 28, 2014 at 10:16:34PM +0900, Namhyung Kim wrote: > 2014-04-28 (월), 12:01 +0200, Jiri Olsa: > > On Sun, Apr 27, 2014 at 11:36:35PM +0900, Namhyung Kim wrote: > > > 2014-04-17 (목), 19:39 +0200, Jiri Olsa: > > > > Keeping the data file description open for the whole life > > > > of the dso object. > > > > > > I suspect there might be an issue for reporting very large data file > > > with this approach - like open file limit? > > > > I've got as high as ~200 openned file descriptors for > > ~2GB data of system wide monitoring > > > > but right that could be an issue.. I wonder we could > > workaround this somehow, because the speed up is quite > > noticable > > > > how about we monitor number of openned dso file descriptor > > and once we cross this we close some portion of them > > > > or something along those lines ;-) > > Yeah, we'll need some way to control those eventually. > > > > > > > > > > > > [SNIP] > > > > @@ -168,8 +174,8 @@ int dso__data_fd(struct dso *dso, struct machine *machine) > > > > }; > > > > int i = 0; > > > > > > > > - if (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND) > > > > - return open_dso(dso, machine); > > > > > > Why did you remove this line? > > > > that code reopens already openned (and closed) file.. > > instead I return (not closed) descriptor from previous open > > But it'll overwrite the dso->binary_type then. What about this? > > if (dso->data_fd >= 0) > return dso->data_fd; > > if (dso->binary_type != DSO_BINARY_TYPE__NOT_FOUND) { > dso->data_fd = open_dso(dso, machine); > return dso->data_fd; > } right, makes sense.. I'll add it with the control code for the number of openned descriptors thanks, jirka