Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7628772rdb; Thu, 4 Jan 2024 02:39:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKa+wxUwnOT+/Iu7FTBiW8rklQq/uURbimXEZGICPjFE0wPT4P5a9rRKvMQRKc9/+368JA X-Received: by 2002:a05:620a:55b2:b0:781:e6a5:f027 with SMTP id vr18-20020a05620a55b200b00781e6a5f027mr270135qkn.73.1704364739955; Thu, 04 Jan 2024 02:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704364739; cv=none; d=google.com; s=arc-20160816; b=DTGGF/CmD1TgoLh7PZ9cQcOG8lqXPBNsLGdWWqq9URtrd8MX1i2qEBMENdnkIYg7Jf CJaiUNF6ClZbLD+WEuH6UiqAp4czg4XM7xGuEZRNqbSRafVpOSeaxcnC2L2811hySdCo w35hBfI51AbsOnU7AN+OWL8aqBHwH52ig4VQmOslBkyVBWNTqOqlDW0J95xSOJeu+qUy QtuhwVfuPKYQMQ4B10Qt2MCfw8fkNjogV1ti1G+JS8g5LFto+KVcoBRkgunHgfV01LDh GibyR3dXDIVkRP8r6ZI1m+RxKT1bCN3buteUdwVfuBksNgG/RkK1qGycd2uxBIE/Xwsf zGSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=UBsofFS/gKrGHJmrD7vxg1XvYsRw/h2z5LmDFHSmzrw=; fh=WQB3T0XQnPwDJFSulMC7i10eMaLR2W+OCDUnRFOv8KU=; b=uwfy1Y14r2M1eDnbB0+knvjHuIU2NRC0bNk6hyOTda/TnEiUXECjdCJD3S9XLcNbSO IzPw3MefbbeY1I0ox4l8+zGeXZ+UUEm3EMnRTDK3c+mhtB+/FHIr+dCC15qVI98sK32U gOwfkeKjg9WEzH4t5KUgi4yZRWGcyEUjSC/soXFd+P4qCXzA/vox7L+gIZRnawidi6lt gqFt64vRqUWL7w91P442CSQ7MP4wULBWLpGdKVE3eDh+0EYA3n1TiB/5LdvKCA3CY1qw Ljc/k1dH2j+nBcVybvWpixoWb2PLWvg3M3osb8MXi5A61XXIzDbWOFi64KQ9CNRlY7XI Z6Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PimzDzdY; spf=pass (google.com: domain of linux-kernel+bounces-16513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bn5-20020a05620a2ac500b007810add037csi30777121qkb.494.2024.01.04.02.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 02:38:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PimzDzdY; spf=pass (google.com: domain of linux-kernel+bounces-16513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 778FF1C2150C for ; Thu, 4 Jan 2024 10:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEC9D20DD4; Thu, 4 Jan 2024 10:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PimzDzdY" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9874F20B12 for ; Thu, 4 Jan 2024 10:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704364730; h=from:from:reply-to:subject:subject: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=UBsofFS/gKrGHJmrD7vxg1XvYsRw/h2z5LmDFHSmzrw=; b=PimzDzdY5sNi8daa6UiT8WNCxBOZvyyjeA/Cm60PY8uECNase8UkRQsu9pmPZjkhNMxhVq vT+2NL/6PckKUhoBJ4+1QvmQE5vKyYcyLpwQt13Sm6dl8CWtUD92WcRYtjRpEXT8GnvXRz E3QckJ2zfGIsAVlpaEUUzRk59V+SRhU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-enNxeBIPNPueHODMRSoRNA-1; Thu, 04 Jan 2024 05:38:48 -0500 X-MC-Unique: enNxeBIPNPueHODMRSoRNA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3368250f2a3so233923f8f.3 for ; Thu, 04 Jan 2024 02:38:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704364727; x=1704969527; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UBsofFS/gKrGHJmrD7vxg1XvYsRw/h2z5LmDFHSmzrw=; b=S7BZpvSAeN2Gjp41iEIK1AbJEliOLMGOkdj6mFlUkMdXnz5xqbq++RCJcfI5QC/g1c jcYydNfdRJbJTJ61/Q2kCtzphQPgdumtVn87/jAxI4V71xsA57/NLh4T5lU6YxHWFG81 M+Acq/A9kUc7gt4FNLd8QLSx9t97VcwV6UmEOyu5c7P49wRh/olt7Bh2Z2agwBu2VfYZ DvxiS7BEmZClP1Ags3WkyfWjzp2Qn9KRNem3mjKKbWCXvSpjLy8aMGgVFElm2XBW5pN+ VNy8v0pja1bsDE/Rpe1Wjgf6VbBeOrEXeYDmAKz06oQ/8MJDwkl0LOkzq16PvHyCd4OR cFiw== X-Gm-Message-State: AOJu0YxGmD+KhzicDWFMB/17yZJBtPGzzA/k2q/effnAsXq7Gol7XWER TB4RoyJmWoR52H7niwjl8e4nPlQySXECp8SkWYyFQetWZphTMz2AEqprukdQYjQyG89G2iDMqjV k2HAJy/sYMq/kyhJydsLjtMuvjO5Dz+gj X-Received: by 2002:adf:cd90:0:b0:337:4e99:9193 with SMTP id q16-20020adfcd90000000b003374e999193mr114390wrj.2.1704364727742; Thu, 04 Jan 2024 02:38:47 -0800 (PST) X-Received: by 2002:adf:cd90:0:b0:337:4e99:9193 with SMTP id q16-20020adfcd90000000b003374e999193mr114382wrj.2.1704364727440; Thu, 04 Jan 2024 02:38:47 -0800 (PST) Received: from vschneid-thinkpadt14sgen2i.remote.csb (213-44-141-166.abo.bbox.fr. [213.44.141.166]) by smtp.gmail.com with ESMTPSA id h15-20020a5d430f000000b0033740e109adsm8900271wrq.75.2024.01.04.02.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 02:38:47 -0800 (PST) From: Valentin Schneider To: alexs@kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org Cc: curuwang@tencent.com, Alex Shi Subject: Re: [PATCH v2] sched/stat: correct the task blocking state In-Reply-To: <20240103081042.1549189-1-alexs@kernel.org> References: <20240103081042.1549189-1-alexs@kernel.org> Date: Thu, 04 Jan 2024 11:38:46 +0100 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On 03/01/24 16:10, alexs@kernel.org wrote: > From: Alex Shi > > The commit 80ed87c8a9ca ("sched/wait: Introduce TASK_NOLOAD and TASK_IDLE") > stopped the idle kthreads from contributing to the load average. However, > the idle state time still contributes to the blocked state time instead of > the sleep time. As a result, we cannot determine if a task is stopped due > to some reasons or if it is idle by its own initiative. > > Distinguishing between these two states would make the system state clearer > and provide us with an opportunity to use the 'D' state of a task as an > indicator of latency issues. > get_task_state() already reports TASK_IDLE as 'I', which should be what userspace sees (e.g. via /proc/$pid/stat). This is also the case for the sched_switch and sched_wakeup trace events. I assume what you mean here is you first turn to schedstats to check whether there is any abnormal amount of blocking, and then if there is any you turn to tracing, in which case you'd like the schedstats to not make things look worse than they really are?