Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4437001pxk; Wed, 30 Sep 2020 02:59:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRM6xnRYdnA5KHOvHLnygMG4pOdOemMwc++BVLIKZFuZWS2VXrwN8O6OrFypO1LmHhEnaE X-Received: by 2002:a50:9a86:: with SMTP id p6mr1801325edb.96.1601459942310; Wed, 30 Sep 2020 02:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601459942; cv=none; d=google.com; s=arc-20160816; b=MtID3e0RNR7zlvdWiHqjD35lAz5D1vwZYBRlY/+p6GE8jcoubJVv9yZH9R1tVTMeoI tArd8LaPxyKzVdCNJTl+J3Kb3qN9JAUXu+39MIyQW4OOA05NwssT3WhMVhYhQbaItENA jKR7GkDMHD3nF5aVSKglbaRWWwUV6tLC8DPBhq81QGm1amWhti9LExCUjVtA2GOcrje7 lv4XdUFk0q07LAYlEJlMtJH6ofJ23/idszTbGNtwZL3Ix2pJ25hv89ovC8ESR4CvbS+r le1VpHxrKaVKJlL+oCgknRBTKsIrRCTEmUpAb/jSZg0fW0rXt1uQMXFHhULDTRO7pqPA bJeg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=acJeaY+em+yFqmsg4ixfWjsNenQl9pdpGLeTKGEFnig=; b=UZ+ov7FAeM8VmvqeOn6J7F4HJRDh1GQ6ELU157/6OuT0hOnJEMIHhdrGXEe/E7mLr/ SfTh9ZLr63AqKbJsO80l4O474hQKmJ9aSfmeFIyGxudmdH9sbccPB3rX+XGp852FIZ2h pcLhq7O5iiVqE6TFT3t0rATEkZvxgHWQrT2rMeu92qUZtBwoePGcUlIF2YrSSP3/5l79 4jOs1A8b5TmntW8TNcC0Q7/L0AVDhXx0623OT/9GYSNLFtFXF6u0lsNnQWbs/WnR//qp u6uahXqQI+31DNUVoQSfQWhr+Wl4mZk9A/9b0QQk1QZIiumRTqD6axkU9yT7hsn3OCV/ 9JxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=T770lPaY; 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 g8si917851ejm.389.2020.09.30.02.58.39; Wed, 30 Sep 2020 02:59:02 -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; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=T770lPaY; 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 S1729157AbgI3J5d (ORCPT + 99 others); Wed, 30 Sep 2020 05:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728126AbgI3J5d (ORCPT ); Wed, 30 Sep 2020 05:57:33 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ED77C061755 for ; Wed, 30 Sep 2020 02:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=acJeaY+em+yFqmsg4ixfWjsNenQl9pdpGLeTKGEFnig=; b=T770lPaYdepLLCOCbKo3F2YMMM lJLY0pM4wvC8u4okwISJuIVxdl/Y9XKXl94T9R84ekexWYbdU9ZNgBAuArHXWWCzLv3yGz+8LYlEG XWJixZ+sxXoAt9JxeRz0w9Q2iLwJ8mY3l6oS20tPeLkKssjK4eqjId2PBtjq5izQNeR8/nOQphbyM 3L+tbuQxoziidkCgw5Jq/bkEzcIOy/N9CexfCTQyI2/zkmzhj0V2m5ZA8foRSwpzQL/2xvi115RQp vz/FDii8IpSqUEFCdUlWKdC4Naz5pdBejvOok1PhIzI92vvDDtBqY2IqIM1rNph2FPl05Ep+idbbD G4CmJjlQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNYrR-0002L7-JR; Wed, 30 Sep 2020 09:57:21 +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 1BB1A3062BA; Wed, 30 Sep 2020 11:57:19 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CF29E202A4087; Wed, 30 Sep 2020 11:57:19 +0200 (CEST) Date: Wed, 30 Sep 2020 11:57:19 +0200 From: Peter Zijlstra To: jun qian Cc: mingo@redhat.com, Vincent Guittot , juri.lelli@redhat.com, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, Yafang Shao Subject: Re: [PATCH 1/1] sched/fair: Fix the wrong sched_stat_wait time Message-ID: <20200930095719.GW2628@hirez.programming.kicks-ass.net> References: <20200930024712.88258-1-qianjun.kernel@gmail.com> <20200930081953.GU2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 05:16:29PM +0800, jun qian wrote: > Peter Zijlstra 于2020年9月30日周三 下午4:20写道: > > > > On Wed, Sep 30, 2020 at 10:47:12AM +0800, qianjun.kernel@gmail.com wrote: > > > From: jun qian > > > > > > When the sched_schedstat changes from 0 to 1, some sched se maybe > > > already in the runqueue, the se->statistics.wait_start will be 0. > > > So it will let the (rq_of(cfs_rq)) - se->statistics.wait_start) > > > wrong. We need to avoid this scenario. > > > > Is this really the only problem there? Did you do a full audit of that > > schedstat nonsense? > > > > Did you mean that the sched_stat_xxx's xxx_start(sched_stat_sleep > sched_stat_iowait sched_stat_blocked > sched_stat_runtime) may be also depend the schedstat_enabled? Yeah, this runtime schedstat_enabled thing is fairly recent, it used to be an always on/off kinda thing. At the time we figured inconsistencies from dynamically enabling/disabling it were okay, it's just stats after all. But if you now want to 'fix' that, then a full audit might be nice. > I have searched the codes, and found that these sched_stat_xxx's > xxx_start don't depend the schedstat_enabled > except the wait_start. OK, so you did the audit and only found this one issue? That's good Changelog material :-) Thanks!