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 EEA37C64ED8 for ; Mon, 27 Feb 2023 13:34:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F4026B0072; Mon, 27 Feb 2023 08:34:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 87D086B0073; Mon, 27 Feb 2023 08:34:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 745666B0074; Mon, 27 Feb 2023 08:34:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 62AD76B0072 for ; Mon, 27 Feb 2023 08:34:09 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1CBFB1608BB for ; Mon, 27 Feb 2023 13:34:09 +0000 (UTC) X-FDA: 80513165418.08.9901CD4 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf13.hostedemail.com (Postfix) with ESMTP id 7F6912001F for ; Mon, 27 Feb 2023 13:34:05 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="okZ1/Iuk"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf13.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677504845; 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=rZr+AZDZ1RO7fX8oz8OymIMfvIwgMjhP3rsgS91awvk=; b=stvAumvXow+7rKLjuq0jNIJO+L0YTU1DAMz4PFXSKNHjm4MkdWbPWJnBLA9NRfbLmd2bTo JS4O3dqnEvh6v2+85ZatBJmKIigkXRFYXEoK4KjfsNjrvhI8QAFVUV8jYNnIt5gGovHupF gu3sbi4iOeb3Iv3Zz7pjInQ0kvmZINo= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="okZ1/Iuk"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf13.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677504845; a=rsa-sha256; cv=none; b=F0NgWuqrRSfd2TjCQbiJ0IctYXco/bJa9gorCisbh0sw+UX0vFAW+HYJ3GMzJMgV357Osj /7e+6Zw2jgXa/SXqinNMlmRLwGuQDArPwLOaXH2sLzlzY3IE/EKl0Ga+R3f4pZ9/0AsKlC 0wpVr1gtf0SkGK/bslvNfwUF5ZVdrIw= 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-out2.suse.de (Postfix) with ESMTPS id 6E85F1FD67; Mon, 27 Feb 2023 13:34:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1677504842; 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=rZr+AZDZ1RO7fX8oz8OymIMfvIwgMjhP3rsgS91awvk=; b=okZ1/IuksZE8Qw6ct66OfkQDzZ4k/FhzTDScvCH0c+HWNkDSJ52JK/l7f8QuZR2M8d7emO ptv2ffu0+m65Suh2nXxQ+vEaroIu6+hESzZbyyCHUd3qtNDB/QdGXNaCMXZME69BOq/nwM 5JzW//fdLAHOryfXiNc/dBU/E9nDabs= 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 5E9C713912; Mon, 27 Feb 2023 13:34:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id J8JCFkqx/GOSaQAAMHmgww (envelope-from ); Mon, 27 Feb 2023 13:34:02 +0000 Date: Mon, 27 Feb 2023 14:34:02 +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 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: rspam02 X-Rspamd-Queue-Id: 7F6912001F X-Stat-Signature: fesi8stfr3i8z4da5o8tbxmx4ejbwetc X-HE-Tag: 1677504845-329728 X-HE-Meta: U2FsdGVkX18Q7HjaBRW91AjtGDY38aRsRpQTIh/wCAi69zu53Xf+tVN+wTL2tsmjYstwf7aZxY3V561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v4JzOrcK/5EWMBOY+IMmldrOmYfYCkHc/YV7X2Xuek0AwQ3AAvqlzXOC/6WGu 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 Fri 24-02-23 13:07:57, Suren Baghdasaryan wrote: > On Fri, Feb 24, 2023 at 4:47 AM Michal Hocko wrote: > > > > On Tue 14-02-23 11:34:30, Suren Baghdasaryan wrote: > > [...] > > > Your suggestion to have this limit configurable sounds like obvious > > > solution. I would like to get some opinions from other maintainers. > > > Johannes, WDYT? CC'ing Michal to chime in as well since this is mostly > > > related to memory stalls. > > > > I do not think that making this configurable helps much. Many users will > > be bound to distribution config and also it would be hard to experiment > > with a recompile cycle every time. This seems just too impractical. > > > > Is there any reason why we shouldn't allow any timeout? Shorter > > timeouts could be restricted to a priviledged context to avoid an easy > > way to swamp system by too frequent polling. > > Hmm, ok. Maybe then we just ensure that only privileged users can set > triggers and remove the min limit (use a >0 check)? This could break existing userspace which is not privileged. I would just go with CAP_SYS_NICE or similar with small (sub min) timeouts. > > 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? -- Michal Hocko SUSE Labs