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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5623CC64EC7 for ; Tue, 28 Feb 2023 13:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=si+uXBCLTCw+/su+4DLahnrVJG6qtHUp0Nw09hDc5mo=; b=wo2Jrk7JZ2GZ3o wDHfPwby+M5NmbfkEDrBzTaPV5yXR2juetkEi93bTCk+Q+g9bA+DIAkbsmPeKZgQ4DeZ68ECtW6nn LS03Wa4f8s8aqiJ41rq8MpbSSDf0dlhcY6008XEjrTWG3184pZyKW0ya1ZyzcW0xfV3ess33+2mWX D1n/ZYRJBwTtxjref5N3TNtT1RWnqvumzxhiD5DYchLF4kpysh1fYB0w2j38IwhNk6v4o0qzXxH32 bfNuYu1l6VDQjrmMj5+0Gy9X0A7lan2Je/peFvyIC/RQxnT/vlTm1bcOUs8K84dqK8tKZJ4fjaFOw +Cn/L7AGYL6GtxTYdGfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX0Nj-00DKpu-Jc; Tue, 28 Feb 2023 13:51:03 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX0Nf-00DKn5-Ur for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 13:51:01 +0000 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 9FA681FDC1; Tue, 28 Feb 2023 13:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1677592253; 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=a+axJ4fDmePQKpl5oDQ9xI+mAYeRUk3jBZn02hzcYwk=; b=IYQKcMF4XvBnvvKRj/q+4NsA4zlgvalUeOeZo1lBfkaF3u2BNeUHa15J5mK2wKQUGa2QzL 7DHSTLBQQX4mHTOkhneDNjY8k6kwgvqUD4TOa2szu510WQDdc/g+V5bXW+oLqUMQDQCzLK //rYSrtyAx9tgv/KUWmg5yxRdrZunok= 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 798E913440; Tue, 28 Feb 2023 13:50:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jU5ZG70G/mPKQQAAMHmgww (envelope-from ); Tue, 28 Feb 2023 13:50:53 +0000 Date: Tue, 28 Feb 2023 14:50:52 +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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_055100_186267_45FDB468 X-CRM114-Status: GOOD ( 28.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon 27-02-23 11:50:48, Suren Baghdasaryan wrote: > On Mon, Feb 27, 2023 at 11:11 AM Michal Hocko wrote: > > > > 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. > > Right. But if cgroup constraints are violated then the psimon thread's > activity will be impacted by throttling. In such cases won't that > affect other "good" triggers served by that thread even if they are > using higher polling periods? That is no different from any other part of the workload running within the same cpu bound cgroup running overboard with the cpu consumption. I do not see why psimon or anything else should be any different. Actually the only difference here is that the psi monitoring is outsourced to a kernel thread which is running ourside of any constrains. I am not sure where do we stand with kernel thread cpu cgroup accounting and I suspect this is not a trivial thing to do ATM. Hence longer term plan. -- Michal Hocko SUSE Labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel