Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4339590pxa; Mon, 10 Aug 2020 06:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHSmqZauiLvOBbUw1BkStm0y6rR7ECX0IyXJtYjmx0idd6MadNXHASMqPk1jvhK2Y7ijVO X-Received: by 2002:a17:906:3e95:: with SMTP id a21mr21651412ejj.388.1597067949622; Mon, 10 Aug 2020 06:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597067949; cv=none; d=google.com; s=arc-20160816; b=AOsl3CWbr1Pc3CWZkp3hmoZ2MFH5ypem9dcIb/CGS1j+AGWZV5nTpaN8UYAPHRzPlS iwb34st6R4baj32m0+qMk4SdQSav9YHSm8hv/lv/kXjyEECDiQTpG2DVpkp3+c8zYevP 7RdQR1jGtiin386NyUu9R0WWEsfvkBnMv2MkuELqe6TmdZwTwiSaRL86JmJK9Zqs/NnR s4Mf3uKDsztLjaCuy3qqncakR1eZOeoZv9qpmR7vR42Vt9ZqBs739dXTXgy1B9AJaoIG 13E//p5crp/ItFF0jCp9mLR38dTQfeQhpAJt6S7eTLbXgdgiGi2YvWqGUYo8UDZe7Ple BLeQ== 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=19EodJLR2IzqdyGovEkZI3OPDxerhSQYfeNj+4isWzU=; b=ogxLoPQ5LwZ2jSBb1A/Ts4Rp/uxDTc+W8RDyZ24UrQMqW+9Gy7WYJKvkUXCsOCGm6K ijb4AoE/dIw4CL4ISoTVauxHOUCovF0mQ2RWMvCT41RKhxnxLqz6ymSPRP+P4NBcNNTX s4zN8sA/oQn6L3s5/iviYyS3mVKGHWtDqFfuxDsScNagPbFb7xpQfwkYFTUefxj98N5S fTE4vgYE5gLl1QntmT0gXaMBmPi5a9c/fiu7fj9KtJ+qnqpmMqd+Sn8ZmMnra1e9ps+F b/n+11OpJs9kuIz8yrvTmSw+k6vCEV9qmzJC5D+UHXwQdnYCNRLhH4xI0niAM28LX23B LjpQ== 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 g11si10558583edp.245.2020.08.10.06.58.46; Mon, 10 Aug 2020 06:59:09 -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 S1726930AbgHJN57 (ORCPT + 99 others); Mon, 10 Aug 2020 09:57:59 -0400 Received: from mga04.intel.com ([192.55.52.120]:25445 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbgHJN56 (ORCPT ); Mon, 10 Aug 2020 09:57:58 -0400 IronPort-SDR: RK9PLOcql2I/j79yww0M60FrprKDxA0KrAm8R3Zm8tLmkU+dMKjnF4C2meSvmMOPyT0rEKcC+Z DrB9RzlAYhzg== X-IronPort-AV: E=McAfee;i="6000,8403,9708"; a="150969357" X-IronPort-AV: E=Sophos;i="5.75,457,1589266800"; d="scan'208";a="150969357" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 06:57:58 -0700 IronPort-SDR: unklh3Is/xfywKnmdcebNcmDXp90MkvOjJgiIx580TsBBevmNSMt3qupsfUo97a2GdEK1h8lNM cEAg1kGJYQhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,457,1589266800"; d="scan'208";a="276015511" Received: from um.fi.intel.com (HELO um) ([10.237.72.57]) by fmsmga007.fm.intel.com with ESMTP; 10 Aug 2020 06:57:55 -0700 From: Alexander Shishkin To: Andi Kleen , peterz@infradead.org Cc: 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: <20200806153205.GA1448395@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> Date: Mon, 10 Aug 2020 16:57:55 +0300 Message-ID: <875z9q1u3g.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: >> > This adds an opt-in flag to the perf_event_open() syscall to retain >> > sibling events after their file descriptors are closed. In this case, the >> > actual events will be closed with the group leader. >> >> So having the 1:1 relation with filedesc imposes a resource limit on >> userspace. >> >> This patch breaks that and enables a user to basically DoS the system by >> creating unbound events. > > The idea was to account the events in the locked memory allocation too. > Not sure that made it into the patch though. 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 as iirc the default MLOCK_LIMIT is quite low, you'd hit it sooner than the file descriptor limit. > 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. Regards, -- Alex