Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1128710pxb; Thu, 4 Mar 2021 04:11:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRuaEqffeHOcQ7AEONuqHTEmDMGHd0qeGDImh+02XuXAWJZXeBwWefCjQfdUOHd5loDBQg X-Received: by 2002:a17:906:f891:: with SMTP id lg17mr3875270ejb.69.1614859870883; Thu, 04 Mar 2021 04:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614859870; cv=none; d=google.com; s=arc-20160816; b=Xfl9IupipzwjeZqTWfgMCpswJigeSX0TgzvIaNNiMN4dyOIUReikbAahI0gQgaP8JE PoR/bZOHteHdFjdEtunPElkId9gj/7SD20G29+yO8fnG69GlrB0R1tBU9Vyv3643lGQi ZPl3wXPwwoVfwo5RUkjfSdCgPpDwqe2LmHCeg6/9vGUZF2XnfpCgdS6nUnmBsoqKk1OE tASI0Y8B8e/9Pf8rBP5Ahkm4FrueCgwVaAznT1EJVONl7wQzeGe8dKYlSev9zrVjywKN lokbOgSMWBbEqb0MfTmHhkT2ix3P1a28hLkPsZSIN/EFip6mRaOjdPLGNKGQWHg3UCvG GXKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0DzFIM+EUTjiOjJVBMqKyqS4BHki234n3r4/jWOomlM=; b=IM6PaWWUNY9o+6Z9m4J1QZK3yso5MbM5LsOdDJV0G/bCExYj9h5+cark5Rdte4JBYr cK36OFqR89utn+A2Xq3KdcodMtDuHurViJpnhP7VIHjtBEuJvwrf9H88ZbaSryWswvLd KF8kyrAuMo9kwoD0XFjxhTRZkPYgo+NbZmmlmSj9TzdN76nOksRmMca2/DRe1mjHDihs cZh44vkMWNwHHRV+53aaQefj6G0Vn9PXz/cMk0kGf0QlaafV0vAjwU4tclmJW9A8YiJR n5+QyD5TEDTvSjA1Y7g9TDUK0wopTyp4YV/2okYr0CqVqYnWFJ89DWBjgIXVYTMJVsVo OGzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=C+MPKxna; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si5274490edp.527.2021.03.04.04.10.48; Thu, 04 Mar 2021 04:11:10 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=C+MPKxna; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1579873AbhCCSc0 (ORCPT + 99 others); Wed, 3 Mar 2021 13:32:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441811AbhCCQuY (ORCPT ); Wed, 3 Mar 2021 11:50:24 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 112B2C061765 for ; Wed, 3 Mar 2021 08:49:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0DzFIM+EUTjiOjJVBMqKyqS4BHki234n3r4/jWOomlM=; b=C+MPKxnaArUY0J/dzHwZ6PfuGy P5yvOQnDgBJy9qLyYrTTVYo8dOl+ttvdFuY8M5OGYfBk6s8tcSgHxc+hsnmDODGozvZabI31z9KEv vTPbDuuCyhjA4wsjaTfpJ3DxrbVDstm/Z3P09enQdBlAlDdUpMwpIQoC0wmexw8Wqt8upFuzVPt2j TqU/55rv3WA6k3UBTxd4R9zcVcnvrKVGRFsvx9MUCw+r8B7sMigOwBKXNJEbXWDTcCadpwuSwdefw JEebpC9+j+bsMF9a97zgUj8SckQdBiKK8Xgm6XPo3ood9FapawPfkpdDcsUOaBSiGeJ+pidPCrMNk LqFZEqyw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lHTo0-005TYo-I9; Wed, 03 Mar 2021 15:52:56 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EECB0303205; Wed, 3 Mar 2021 16:52:54 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CF08723662BED; Wed, 3 Mar 2021 16:52:54 +0100 (CET) Date: Wed, 3 Mar 2021 16:52:54 +0100 From: Peter Zijlstra To: Chengming Zhou Cc: hannes@cmpxchg.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, linux-kernel@vger.kernel.org, songmuchun@bytedance.com Subject: Re: [PATCH v2 2/4] psi: Use ONCPU state tracking machinery to detect reclaim Message-ID: References: <20210303034659.91735-1-zhouchengming@bytedance.com> <20210303034659.91735-3-zhouchengming@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210303034659.91735-3-zhouchengming@bytedance.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 03, 2021 at 11:46:57AM +0800, Chengming Zhou wrote: > Move the reclaim detection from the timer tick to the task state > tracking machinery using the recently added ONCPU state. And we > also add task psi_flags changes checking in the psi_task_switch() > optimization to update the parents properly. > > In terms of performance and cost, this ONCPU task state tracking > is not cheaper than previous timer tick in aggregate. But the code is > simpler and shorter this way, so it's a maintainability win. And > Johannes did some testing with perf bench, the performace and cost > changes would be acceptable for real workloads. > > Thanks to Johannes Weiner for pointing out the psi_task_switch() > optimization things and the clearer changelog. > Co-developed-by: Muchun ? > Signed-off-by: Muchun Song > Signed-off-by: Chengming Zhou