Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1491928pxv; Fri, 2 Jul 2021 05:16:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7TMzMDtkDEtYEfzx1bUpLHNzZqwgdklLdFgImTkaRgBPvXv9lIbLaz2ehgC+UFno802oy X-Received: by 2002:a17:907:6fd:: with SMTP id yh29mr5080318ejb.432.1625228164229; Fri, 02 Jul 2021 05:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625228164; cv=none; d=google.com; s=arc-20160816; b=NiEJYMDNJ+ejjLqXoUeCPKBr33h+LmbATE6mvd1NwVK9TFE1zz2z3COM8xCcDxSulS kxR5DN9bAfz2T4JFRLs9kKNSST/mdfTK4VdeB0oLq1YsAJR0ZHQ3Fgn8cmLGvkPNhLY+ Lksumv4QLQ978D3nDN5cr1dc75biDaOwK7GU10jCa4J14gjD8maC7kE6YNwHrLHVnqCh S1VW+Lk0O/lU5X5bsYT5COrK6NtR2sd6M/XScDXKHbEgDXlJK11Am0NhBdnZg7qk13fH +NCMBXsjouQxlxQwrniiRf6/9HKepKW4N5YB7pWoaLrl92DGLvV4T5yjCjh/QQtUfa5b C6TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject; bh=DNXfFfjItBD4rfC6u3TQH6IQpIJeeIMEsKcrfjeIfag=; b=t7B03GhFS1BgZ25MhMMQuTwgBooDCuQxdDEmoocvYEzG38K5OmJ0nzu4rwMPTQYQA3 08/98zkLerJC6H7wivtDI/uHQfYYbaJGzMNRQN7dyxRxnM8MU65ksR0W1Ocl3FxFslAH FbMp5zKzYiZt9rASdki7j7cuCR9/VJORsw21kigk8qA6TcTMrIIU+6MBiSLDBeZCT28O vwHssHiMLBz9tRDsL3lugxHUp1jsFefM8GsKv8FrcrrKqa0A/qJGAHV6bv7OkhN7zSOI Z8jQhzbYHxTtZkh3Shl1WPqAi/ApWvkDJ56hgb5RJdKYQkvTArJQz+CtysVGtfaUJCnK 9sKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si2990151ejc.745.2021.07.02.05.15.02; Fri, 02 Jul 2021 05:16:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231974AbhGBMIk (ORCPT + 99 others); Fri, 2 Jul 2021 08:08:40 -0400 Received: from mga01.intel.com ([192.55.52.88]:1621 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbhGBMHU (ORCPT ); Fri, 2 Jul 2021 08:07:20 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10032"; a="230394038" X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="230394038" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 05:04:30 -0700 X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="482420148" Received: from abaydur-mobl1.ccr.corp.intel.com (HELO [10.249.228.32]) ([10.249.228.32]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 05:04:27 -0700 Subject: Re: [PATCH v8 20/22] perf session: Load data directory files for analysis To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel , Andi Kleen , Adrian Hunter , Alexander Antonov , Alexei Budankov , Riccardo Mancini References: From: "Bayduraev, Alexey V" Organization: Intel Corporation Message-ID: <7dfdebb5-c10b-7f2a-ba93-70106d9fd909@linux.intel.com> Date: Fri, 2 Jul 2021 15:04:24 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.07.2021 13:30, Jiri Olsa wrote: > On Wed, Jun 30, 2021 at 06:54:59PM +0300, Alexey Bayduraev wrote: > > SNIP > >> + while ((ret >= 0) && readers) { >> + if (session_done()) >> + return 0; >> + >> + if (rd[i].state.eof) { >> + i = (i + 1) % session->nr_readers; >> + continue; >> + } >> + >> + ret = reader__read_event(&rd[i], session, &prog); >> + if (ret < 0) >> + break; >> + if (ret == READER_EOF) { >> + ret = reader__mmap(&rd[i], session); >> + if (ret < 0) >> + goto out_err; >> + if (ret == READER_EOF) >> + readers--; >> + } >> + >> + /* >> + * Processing 10MBs of data from each reader in sequence, >> + * because that's the way the ordered events sorting works >> + * most efficiently. >> + */ >> + if (rd[i].state.size >= 10*1024*1024) { >> + rd[i].state.size = 0; >> + i = (i + 1) % session->nr_readers; >> + } > > hi, > so this was sort of hack to make this faster.. we need some > justification for this and make that configurable as well, > if we keep it Hi, I am currently thinking of another round-robin read algorithm, based on timestamps with periodical ordered_queue flushing after each round, this might be better, but I'm not sure if this should be included in this patchset. Probably introduction of new constant will be enough for current implementation. Regards, Alexey > > jirka >