Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp474902pxa; Tue, 11 Aug 2020 07:38:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHTWUrGxjIVQ84Hv5HNbmIXT4M4OxRVXVLMmTV4uRQXO8gr0+DCXKXKM+1qsxa0Bl9smv2 X-Received: by 2002:a17:907:94ce:: with SMTP id dn14mr26025508ejc.351.1597156680010; Tue, 11 Aug 2020 07:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597156680; cv=none; d=google.com; s=arc-20160816; b=Au2FxnXu6uWkjPqrfFItCB997Qrknq2LVp1Ye1un6c6GxsF3sYdM7YsSAaL2RXEULS RdCENJNKKHUl2NGEeUfP1y+nV4TWQYhpE/2qSwd2jQv4mpHxAPGHh+yaLbCIaHDCDWAf sttuLVOkKUln1W7KhpOitXI+TqrW6gtuzpE7Oqt91EYfVmrqBzCFtx81MmOqWSYpKPUu v7cxIEyqgyIjS+pZigLXkO6QZtZCzmVFyFPb+r1PNpk5XyCPnEYPlqCvaPLgiQ4CoSmV +dCbAGZkwws8gMSJKMb9sNllxcnkZvkInaJ2fvU2fmf5qvrFHcrOspGr8iDnDJsCFTcy +QCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=1TQQmSh3qci87wMZC5M0dXK4CgiuLSQOSsTIYJAC+M0=; b=poa/LBWqK6me7EiuM36mbPT8DqTzhNBuwqgS/uD8iBXdAfzoT51+tjk5vYluznlp3B raYKehbYySJdocJRM7aoho60X+OcEpw/R1WhEfxjs+RCxYZxbkOi1RBhA03337DmaaMy 2f1YfkB49ixS/VZGSB0T0z/VUrcgHucgBlLLMtT3LrAyjJ9hX42KKChnvIJQeBTpU43u tAu/PzMYpPuvDHNi0blmWBWukmxHe9mM/Hiwa+dFRBjPPR76Wr7Klam9MYcDlT/JM1eK DrVuUTS7c+isjjCUhkuN9q84r8WWXAo8FAT/hnj0ym3Fw0xw9IaPSmtp8syMzyWAcE2m mA3A== 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 o8si12199270edq.435.2020.08.11.07.37.36; Tue, 11 Aug 2020 07:37:59 -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 S1728800AbgHKOe3 (ORCPT + 99 others); Tue, 11 Aug 2020 10:34:29 -0400 Received: from mga01.intel.com ([192.55.52.88]:59588 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728792AbgHKOe0 (ORCPT ); Tue, 11 Aug 2020 10:34:26 -0400 IronPort-SDR: 349InYtPa/uKYuws5mlnyVo2MAyIhC8XkCM17NTNFVSLUrI2RznCxqPMbDbzfgr4vffg4YEJHq YOn33luQX+Aw== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="171783532" X-IronPort-AV: E=Sophos;i="5.76,461,1592895600"; d="scan'208";a="171783532" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 07:34:25 -0700 IronPort-SDR: 30Q6wEZhMGlaEJBhaG8+jkm0kR2f/WkT6es1kzFJTzHSDqL+oeZcXFK4bTONZ26cjJRASoyDI7 2AasSOgc9ijA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,461,1592895600"; d="scan'208";a="324775517" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by orsmga008.jf.intel.com with ESMTP; 11 Aug 2020 07:34:25 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 07BBE301CB1; Tue, 11 Aug 2020 07:34:25 -0700 (PDT) Date: Tue, 11 Aug 2020 07:34:24 -0700 From: Andi Kleen To: Alexander Shishkin 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 Subject: Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87364t1plf.fsf@ashishki-desk.ger.corp.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 12:47:24PM +0300, Alexander Shishkin wrote: > Andi Kleen writes: > > >> It didn't. I can't figure out what to charge on the locked memory, as > >> all that memory is in kernel-side objects. It also needs to make sense > > > > I don't see how that makes a difference for the count. It just account > > bytes. Can you elaborate? > > 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. > > >> as iirc the default MLOCK_LIMIT is quite low, you'd hit it sooner than > >> the file descriptor limit. > > > > For a single process? > > 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. 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. -Andi