Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp558879pxa; Tue, 11 Aug 2020 09:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypb1bMwSuHNG+V5+XA0Goe+4fiHoFT/2+uYhsQ3hBgHp/UYL1DKlIO1iu+xjVKzt1e7ICK X-Received: by 2002:a17:907:402b:: with SMTP id nr19mr26988066ejb.123.1597163033980; Tue, 11 Aug 2020 09:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597163033; cv=none; d=google.com; s=arc-20160816; b=aTF8u+ASsFBomWuMStROcWtfCqeFGvj3ykVakBfz2kWNPnUTX+oOhJwvHvD0duPX1f esKvSGDgECYGmf/SmBx6yBVnWMv2SG0iuJKHHxJ0en2rm3a4fKuBZqUbckasVuuJhBqR zvhzcF3vsIgd8HUgEcc22mGtpaahILrMJ7tJ/4wXbXQs1cxpNS1xFJEkuEhDOhdsPQMY 7iApJv8LpvRkNOnFkgx5xHq82v7Yacyl8SZQqh8BvcctptbuhhYHL3RSC0GMRu3GQlfK 4ILMvl9+h1XF3CnsJwiD34WhjFtuJxM7sjJ9JrhqBWWC2XebKoG/5RtyDYHxAi2gNykQ dK2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=vtN9cDjcNYPWcPJmKa1ERjSE9uERmPOIwSDu0RItWEg=; b=cvGk+yhTTSAmtZm9G9EV7rSB10rem/ho8idJ/hL9srxvT5+VPlpacJkryu4t1+HgFm y1Fuo+oYT+oh/nK33tTKJQ0HrCmc57qjncae/vCPsOYE5Mk6yV18I2U7cJIW+535Qxc7 AOj9antOuO4ekv7XYNQYbRsODKuGIPL1J16IsojtB5P2/3hxJ9KmA/GzqPCICcaOkRUE WpPNcz3ryYnB0mYJyv1hiadZf9+gbhee0dPWUvlBUx4e6UkeTgsLj9myBdX/gwqr2OJq fqeEPCiuGD4s7XSdfaNj8kSecHylpFbnT1MGTx7C3bLpwO8nGnG26qMSmmutEBy1KQGs 6U4g== 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 q22si12454118eds.346.2020.08.11.09.23.30; Tue, 11 Aug 2020 09:23:53 -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 S1729001AbgHKQVq (ORCPT + 99 others); Tue, 11 Aug 2020 12:21:46 -0400 Received: from mga12.intel.com ([192.55.52.136]:22263 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729163AbgHKQVV (ORCPT ); Tue, 11 Aug 2020 12:21:21 -0400 IronPort-SDR: RFW5IfSotSWxPfYyjDkkvwq+HDdmMXQruAiAL2K6kQbTvoRQggLubbgIZrt7Q7QXbyMa6FWOAu TwHL0jKwNO8A== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="133296949" X-IronPort-AV: E=Sophos;i="5.76,301,1592895600"; d="scan'208";a="133296949" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 09:21:19 -0700 IronPort-SDR: Jngo1nM1PaJVtTZF0MZwoseVnCZ8p07/QT30nt3kiJ+Z5K4zg1W4XU60xCCeYAbO7mmZAezNZi m7elcXCMPsKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,301,1592895600"; d="scan'208";a="334634181" Received: from um.fi.intel.com (HELO um) ([10.237.72.57]) by orsmga007.jf.intel.com with ESMTP; 11 Aug 2020 09:21:14 -0700 From: Alexander Shishkin To: Andi Kleen Cc: peterz@infradead.org, Arnaldo Carvalho de Melo , Ingo Molnar , linux-kernel@vger.kernel.org, Jiri Olsa , alexey.budankov@linux.intel.com, adrian.hunter@intel.com, alexander.shishkin@linux.intel.com Subject: Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors In-Reply-To: <20200811143424.GD1448395@tassilo.jf.intel.com> References: <20200708151635.81239-1-alexander.shishkin@linux.intel.com> <20200708151635.81239-2-alexander.shishkin@linux.intel.com> <20200806083530.GV2674@hirez.programming.kicks-ass.net> <20200806153205.GA1448395@tassilo.jf.intel.com> <875z9q1u3g.fsf@ashishki-desk.ger.corp.intel.com> <20200810144518.GB1448395@tassilo.jf.intel.com> <87364t1plf.fsf@ashishki-desk.ger.corp.intel.com> <20200811143424.GD1448395@tassilo.jf.intel.com> Date: Tue, 11 Aug 2020 19:21:13 +0300 Message-ID: <87zh71ywzq.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andi Kleen writes: > On Tue, Aug 11, 2020 at 12:47:24PM +0300, Alexander Shishkin wrote: >> >> Right, but which bytes? One byte per event? That's >> arbitrary. sizeof(struct perf_event)? Then, probably also sizeof(struct >> perf_event_context). > > Yes the sum of all the sizeofs needed for a perf_event. Well, *all* of them will be tedious to collect, seeing as there is ctx->task_ctx_data, there is ring_buffer, scheduling trees, there is stuff that pmus allocate under the hood, like AUX SG tables. >> The above two structs add up to 2288 bytes on my local build. Given the >> default RLIMIT_MEMLOCK of 64k, that's 28 events. As opposed to ~1k >> events if we keep using the RLIMIT_NOFILE. Unless I'm missing your >> point. > > Yes that's true. We would probably need to increase the limit to a few > MB at least. Ok, but if we have to increase a limit anyway, we might as well increase the NOFILE. > Or maybe use some combination with the old rlimit for compatibility. > The old rlimit would give an implicit extra RLIMIT_NFILE * 2288 limit > for RLIMIT_MEMLOCK. This would only give full compatibility for a single > perf process, but I suspect that's good enough for most users. We'd need to settle on charging a fixed set of structures per event, then. And, without increasing the file limit, this would still total at 1052 events. We could also involve perf_event_mlock_kb *and* increase it too, but I suspect distros don't just leave it at kernel's default either. Regards, -- Alex