Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4512747pxa; Mon, 10 Aug 2020 10:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpgYh/PTf2Ec7ZeS1KqhejSiLzhcIaTjgC6K48Epfh0aAQGdf8+5z21OsGeYSXa9D07ICj X-Received: by 2002:a17:906:180b:: with SMTP id v11mr23597296eje.427.1597081921393; Mon, 10 Aug 2020 10:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597081921; cv=none; d=google.com; s=arc-20160816; b=yYBCwnkdwToAj6c8iJ61oqbI5kKwIjl9rRc2B/kejdYiRxnDXH7RUVMtvOC0xGkvMV E0Q7p8tsdRZZmXW4MNYzYiTuqqBXK1WFyVhb2KsjZnNk4hC2FBB+hQfXKfwWIXR/fAvX I2DsZLrsPFu0ojwbSAXrweyPOQAtZIdWA1AorhYqAHD4IxVUGfS6+RY6Q2S6J1Q5hf+A 6gnYoWRAtHwNBa9NbEsmvGjYlSOUS7v5N87xHm62i4owoOhKiFE32Bw4AzoVCwsFe0OB XYQPuMflF3cbUGtgz3IG0hYJyD9eLzxdT5f8uAWkfbqbXoGoEVlRqWf4AV0yMrOEo5zZ GTXg== 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=abO2KE7YQyrd7u1OKG4KlbNeRu7/0KbfoRfBJ78jJo8=; b=JGGpy/JeHIMKr8oB4dM2iVpFfTuel6/BHwGSwYHIU9kO6EsAS5oPpN787IUCxoiaz+ A++mwpEWSk171vSxu8JsM9kt9K3001dl0xQvgKnzTIJRF+609wmaJ4hEJnjKh5njDPLq hKxFNbF5lwhT2V0wZdXGRbWk2obsYZykSHaQmPc6WXhJk5xfeNOo6nz1cLYWMnNrS1RS EVAPZ1FAYM8NgN5vIpRwFUBikkiuHo6oCeD1GnlInWX8d6PQ1O8cZoNONYua22TE2i2P n+nBK31BmscOVngdZ1CR5Gl2gXxy8HDMWJZdeSs4h4py9+DSKSmysN30b3iULhiOxZIJ C3YQ== 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 s9si1867634edh.243.2020.08.10.10.51.38; Mon, 10 Aug 2020 10:52:01 -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 S1727963AbgHJRuo (ORCPT + 99 others); Mon, 10 Aug 2020 13:50:44 -0400 Received: from mga06.intel.com ([134.134.136.31]:51484 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgHJRun (ORCPT ); Mon, 10 Aug 2020 13:50:43 -0400 IronPort-SDR: eT9EWZ6McbmJyxUR46EEvuJf+wE83m/2qgJkKakHv6vf8j9vM9wZsLM83hwu+8azWAvoXdhNOz nsca1Nqq/iFw== X-IronPort-AV: E=McAfee;i="6000,8403,9709"; a="215101661" X-IronPort-AV: E=Sophos;i="5.75,458,1589266800"; d="scan'208";a="215101661" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 10:50:42 -0700 IronPort-SDR: vpzcQZYNsAW9jmuTF4kuBbii8AQLquvwRdeTooIXqtd8XQZ1yR4g0CDZCRIOZ1tG2wWtjlqdCU jErFZ0Bliw8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,458,1589266800"; d="scan'208";a="324514275" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by orsmga008.jf.intel.com with ESMTP; 10 Aug 2020 10:50:42 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 90B6C301CAF; Mon, 10 Aug 2020 07:45:18 -0700 (PDT) Date: Mon, 10 Aug 2020 07:45:18 -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: <20200810144518.GB1448395@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875z9q1u3g.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 > 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? > as iirc the default MLOCK_LIMIT is quite low, you'd hit it sooner than > the file descriptor limit. For a single process? > > > It has a minor issue that it might break some existing setups that rely > > on the mmap fitting exactly into the mmap allocation, but that could > > be solved by allowing a little slack, since the existing setups > > likely don't have that many events. > > I don't see how to make this work in a sane way. Besides, if we have to > have a limit anyway, sticking with the existing one is just easier and > 1:1 is kind of more logical. It's just a very wasteful way because we need an extra inode and file descriptor for each event*cgroup. And of course it's super user unfriendly because managing the fd limits is a pain, apart from them not really working that well anyways (since someone who really wants to do a memory DoS can still open RLIMIT_NPROC*RLIMIT_NFILE fds just by forking) Unfortunately we're kind of stuck with the old NFILE=1024 default even though it makes little sense on modern servers. Right now a lot of very reasonable perf stat command lines don't work out of the box on larger machines because of this (and since cores are growing all the time "larger machines" of today are the standard servers of tomorrow) Maybe an alternative would be to allow a multiplier. For each open fd you can have N perf events. With N being a little higher than the current cost of the inode + file descriptor together. But would really prefer to have some kind of limit per uid that is actually sane. -Andi