From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14177C64ED8 for ; Mon, 27 Feb 2023 19:11:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0A156B0071; Mon, 27 Feb 2023 14:11:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B9BF6B0075; Mon, 27 Feb 2023 14:11:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A7926B0078; Mon, 27 Feb 2023 14:11:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 79E366B0071 for ; Mon, 27 Feb 2023 14:11:13 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 40D06402C5 for ; Mon, 27 Feb 2023 19:11:13 +0000 (UTC) X-FDA: 80514014826.29.6800BB4 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf21.hostedemail.com (Postfix) with ESMTP id 4430A1C0014 for ; Mon, 27 Feb 2023 19:11:10 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=EWgOdMt9; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677525070; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=k7KLqc0ddMXLeQzmWAODibPhNefuYjs5GZ/oLOoQbho=; b=zkMmCq0HQ9xUdOsDHCjRSA/ipjK5ttjDgs5biRu78P4TEffBi79pKi+7xMJJFFbuBHImTh MW0+wKcfFbGgbcmOUKkmb26cn25KK3o95Qs9m8ubMEf0QxZ30ocrgtkFSyx/zvBePdly6/ MQZlp7gk98ojBEJzxQhHIvw4SaGaJsc= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=EWgOdMt9; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677525070; a=rsa-sha256; cv=none; b=CAw7p+4kPsqd6I5kobEk1KsFyPjL8XqvqDI90c8cPKl5IYPvCJeJYCkh4hYm+nEPCucsUQ hLc60ipnaxUpQglGuEhyzqV50jU5QwIh1R4rfOT9OXPUFcxq5TGV3JNQM7aksk9oUu+N8p ntGiX0TpCaWDOMthCH7yZYne859KYPU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B206C219F8; Mon, 27 Feb 2023 19:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1677525068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=k7KLqc0ddMXLeQzmWAODibPhNefuYjs5GZ/oLOoQbho=; b=EWgOdMt9uLzuqoPUeB79LOuBCUrHjFTtVdJQ5hYBnMXNvMVzAbI98b3A6VjBIftUaWTooM loUS2WCJYIvxXGxxbSqEkzoAdmgyMt343VMkKJepTyaE+bjL60uiM7N+tAR9fu4YnE8KXZ mV62PV9lxoztijjx1ZaOzygRFLz9LBE= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8FB1413A43; Mon, 27 Feb 2023 19:11:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CzbTIEwA/WNcDAAAMHmgww (envelope-from ); Mon, 27 Feb 2023 19:11:08 +0000 Date: Mon, 27 Feb 2023 20:11:07 +0100 From: Michal Hocko To: Suren Baghdasaryan Cc: Sudarshan Rajagopalan , David Hildenbrand , Johannes Weiner , Mike Rapoport , Oscar Salvador , Anshuman Khandual , mark.rutland@arm.com, will@kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Trilok Soni , Sukadev Bhattiprolu , Srivatsa Vaddagiri , Patrick Daly , johunt@akamai.com Subject: Re: [PATCH] psi: reduce min window size to 50ms Message-ID: References: <15cd8816-b474-0535-d854-41982d3bbe5c@quicinc.com> <82406da2-799e-f0b4-bce0-7d47486030d4@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: wy7m6bjmt3s7fodty6wcpy88zij5y9dx X-Rspamd-Queue-Id: 4430A1C0014 X-HE-Tag: 1677525070-908948 X-HE-Meta: U2FsdGVkX19GvqA83DJlPvNCJSJaQMAppIJf6pIBkN538pKTQvJicDPav7H12IYS3Ii1l5tucv5ZX9uaKWvLdc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Y3BYQglt0G/erIt7oB8rkpXa3Y7ic8nONF3Oj7fI9Eciz7JNex5hNr3NIk X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 27-02-23 09:49:59, Suren Baghdasaryan wrote: > On Mon, Feb 27, 2023 at 5:34 AM Michal Hocko wrote: > > > > On Fri 24-02-23 13:07:57, Suren Baghdasaryan wrote: > > > On Fri, Feb 24, 2023 at 4:47 AM Michal Hocko wrote: [...] > > > > Btw. it seems that there is is only a limit on a single trigger per fd > > > > but no limits per user so it doesn't sound too hard to end up with too > > > > much polling even with a larger timeouts. To me it seems like we need to > > > > contain the polling thread to be bound by the cpu controller. > > > > > > Hmm. We have one "psimon" thread per cgroup (+1 system-level one) and > > > poll_min_period for each thread is chosen as the min() of polling > > > periods between triggers created in that group. So, a bad trigger that > > > causes overly aggressive polling and polling thread being throttled, > > > might affect other triggers in that cgroup. > > > > Yes, and why that would be a problem? > > If unprivileged processes are allowed to add new triggers then a > malicious process can add a bad trigger and affect other legit > processes. That sounds like a problem to me. Hmm, I am not sure we are on the same page. My argument was that the monitoring kernel thread should be bound by the same cpu controller so even if it was excessive it would be bound to the cgroup constrains. -- Michal Hocko SUSE Labs