From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A83F30214B for ; Tue, 28 Jul 2026 06:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785220490; cv=none; b=VRT28fA4B0tW/mXD4tpF5Ijfwn6XMHaY53Ffy+PXfDmThCmw5YPYpvEkzor6a+h+ZVXljj7jBaW+21ANHGMTcoTRxgVMpwcu9Pawu+bhwYXPbDeM++FTLhvv7mhFuWHVc6SRv4c1sK6o3MhYzyOqQJOFL7Gj3Ev59sw4mq0B64U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785220490; c=relaxed/simple; bh=C9VKEBlI3QoYGKujYEufSP4DeAjUG9BxDjxb068NP0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pHn2Us7mRJLxB82mgo2BO3ytkgEVMhWCxdWzftck6pGBlRpGcTrqzDhzJpm6OQuwcqgbs7ci+sHkayosDTvzN2kmMNettMrjlms5QkCvLrShb9pl9C4dVp3tGJ8TPRBfR0GTK+w1h7veJEfrlNyvfoUP1eZupY7jlPhFJxISAsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=INx0jAj7; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="INx0jAj7" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-495590dde14so38206755e9.0 for ; Mon, 27 Jul 2026 23:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785220487; x=1785825287; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=0A9q6+z5m3QXXvqGIWfq0vv3gNI9JsJet68ShvDG/uw=; b=INx0jAj7fyV7g80f6TywLs9org0VVF2bo1ybJMyvO9VvT1hqeZoD3xbNimLKi58DLV TvsfN/BN1nhR29mNg9ihD99dMqHQONJG8lZRURMClwBXyYUvwzxRZAuKZnoQFyVILMxi tooMAoFuM52pmIbu9YoeshQew6feidiXZhQD3bL1RH7pDb9g5k35UNR5KgtgybQwPXk3 clkNT7UEbenOpLv1rdpHKeROaHs7GbvTd4LmUECFdVKKUFnSGgclMLwq+BOdRz2UUHrO VQbN5kgrqwzxSwWCvvLr4DitbazGoMFSRDoCewm0nvIcyZOMgaNawNz0LEqWXX3c2DEa stSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785220487; x=1785825287; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0A9q6+z5m3QXXvqGIWfq0vv3gNI9JsJet68ShvDG/uw=; b=AFwXrv6AWlMmWSu2cmO95aZ9Tq/YYHQXe1TxOMIWK0S01s3G4GUhQihJ12pSrTEwab Bcy+hJ+jpQGVClwJibtA+Ihsaa6wshwfaI2ebfwNophjIMSyNWAdqJUS2M7z5l4QjiPh LrdVHW94h7J2z8K6KdY36YdYJ1nDEO1lD9gmC6uRIwVUm8HhhZt1v62NtSpyjoDpqNUj gI12478rOwVy6c84NzoWi8bnP6rYj9f6lZOWo3EM3p14kOMWXoKujzMFFgPhpW/45apc yHIBswCFGkPr9imxsUlUvGXvwXbFuR/B+5kFBjkWog2UHtkUOfWjDPtZ330Hz/13xvOn aJgA== X-Forwarded-Encrypted: i=1; AHgh+RrwWDhwlYFX9z2aB1Oy9uMnR/wcr1OaUjLtWwteLFJO1LYQcilF9myr5SEikC65Powjk9fpbkVqCqlGrDQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzJci7mSCQtKQThObjdmbrqUr4CtcvHD5a1A3c1GzWt89qOY/Nu MdOpjObtTV+wgmcUXnVYnEDNKvAL9GBAFBWOigL/P3dQxeuQGE8DMSdH X-Gm-Gg: AR+sD12o4hqfMQ+S0falvJtg/+eeO07e0nW/b3v7KDRBwQUat5Skg77deVS5PrZYExa pDu5dVuf0BZ1S98+PUvYlLZlUs+W32C5I1i13rfL+D3MOj2dMJ6GDz++IhEugNM2NaHXVe0yirq L/4/9d8FDGRCL86f7DeKZv0Cy6fRI9B5eVFHuWfjTddcdrTF5/BEfeIZGxE2R1AFqMUB/dKNjBf /hePSKTd/FIsvSliKbQq4HLlrb0AOg4gW6qTq/nZjvkIQWMNBqqefEYWeWa8Xf1dzxtOA0Y430r uYK5sXpL3oZ+umELyDAMNSzB5GpYowRNpjLcxJevML3PbK6rf3xU2jaJFkUfkp1VOXZsbljoxrQ ufKKM36F7diOWZGLGWVIYCgrTLzeIx5SZNZTRxDF9yEdgqAZ1FhuuvZj8eU2cBPbfQr9HVFzFab cxTKEASREs61a99JcRKU0LKtKR X-Received: by 2002:a05:600c:8b78:b0:495:5d6d:9cb3 with SMTP id 5b1f17b1804b1-496c65996aemr8753725e9.37.1785220487037; Mon, 27 Jul 2026 23:34:47 -0700 (PDT) Received: from osman.mioffice.cn ([43.224.245.178]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-496c4632263sm55178925e9.15.2026.07.27.23.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 23:34:46 -0700 (PDT) From: Zhan Xusheng X-Google-Original-From: Zhan Xusheng To: Aaron Tomlin , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, neelx@suse.com, sean@ashe.io, linux-kernel@vger.kernel.org, Zhan Xusheng Subject: Re: [PATCH] sched/debug: Introduce per-CPU debugfs files Date: Tue, 28 Jul 2026 14:34:36 +0800 Message-ID: <20260728063127.812004-1-zhanxusheng1024@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260728020309.6169-1-atomlin@atomlin.com> References: <20260728020309.6169-1-atomlin@atomlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Zhan Xusheng =0D On Mon, Jul 27, 2026 at 10:03:09PM -0400, Aaron Tomlin wrote:=0D > Currently, accessing scheduler debugging details for a specific CPU=0D > requires reading /sys/kernel/debug/sched/debug, which outputs=0D > information for all online CPUs. This results in redundant output and=0D > parsing overhead on large SMP systems when targeting an individual CPU.=0D =0D This looks like a handy addition. One thing that might strengthen the=0D changelog: the bigger win of a targeted per-CPU file isn't really the=0D userspace parsing overhead (a grep over the existing file is cheap), but=0D that inspecting a single CPU no longer requires walking every runqueue and= =0D taking each rq lock to produce the full dump - which is what actually=0D perturbs a large, busy system. Framing it that way makes the case more=0D compelling.=0D =0D > + for_each_possible_cpu(cpu) {=0D > + struct dentry *d_cpu;=0D > +=0D > + snprintf(buf, sizeof(buf), "cpu%lu", cpu);=0D > + d_cpu =3D debugfs_create_dir(buf, d_cpu_dir);=0D > +=0D > + debugfs_create_file("debug", 0444, d_cpu, (void *) cpu, &sched_debug_= cpu_fops);=0D > + }=0D =0D One design question: the existing /sys/kernel/debug/sched/debug only=0D iterates cpu_online_mask, whereas this creates cpu/debug=0D for_each_possible_cpu. Reading an offline (or never-onlined) CPU's file=0D then calls print_cpu() on a quiescent rq. As far as I can tell that is=0D harmless - rq->curr is that CPU's idle task from boot, so it just prints=0D idle/zeroed values - but it does differ from the existing interface, and=0D where possible CPUs greatly exceed online ones it adds many directories=0D for CPUs that will never report anything interesting. Was exposing all=0D possible CPUs intentional, or would gating the files (or their contents)=0D on online CPUs be preferable?=0D =0D Thanks,=0D Zhan Xusheng=0D