From mboxrd@z Thu Jan 1 00:00:00 1970 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 BDCD24052A1 for ; Wed, 12 Aug 2026 09:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786526516; cv=none; b=S7SIP1d5FpzUGK0wLPRlgHnYBlLeDqszAZ1K9VQ1W2YBK320cFRw1bGYcCRgeHbY/FYOXQQdQumvWjgiRxJruaASF9Tc4wAJ+0mWLKSQDElSfBE+WZBTMg4wk4ZJ3npfX3xKT5gKz5BRdY9HSe0atRbRpCYr1HHEbKWzsMkrX2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786526516; c=relaxed/simple; bh=f/z0d8p/JHOHV8e2Y1/mIj34JxMzxElptOKrVDxUjtk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nd9eGWSeTGzWyLK81irYPBtHueEAG9hKsQC3OQCASK6froRU1G/CjZgMFjEE1DwpbQ3p1ELtwsqdQpGN70e+T4y88turpzPJ3Ac+BL8f02l4aQo35CqR8GKv4UET7xnO1iRbG+yVhygymNqTRc/6e8YveE2z4Bu+OXGd+NDFkC8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=A8c7YkGg; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=qGIVrkG6; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="A8c7YkGg"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="qGIVrkG6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786526513; 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=Zul2jzYANCApDwLIn7fzzjcsabOj3YOj7EPJ6HMmOco=; b=A8c7YkGgr/aD1Whn77166xplSnBo5KgqsMjwsGiTNSzB767LOxqj5Y5GMb/dXmvt3yOqoQ 1i8v156jul7mMQ/sOcZ77adFVnFlQH+yYJovobbTpYAEtLloiowxNftos1frtJWyLYdPYb ZisgeNnoY3hoJNnmD5cIqD0x1KE3ovk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-99-kBM06OVkPt-eF2DjzQeo5w-1; Wed, 12 Aug 2026 05:21:42 -0400 X-MC-Unique: kBM06OVkPt-eF2DjzQeo5w-1 X-Mimecast-MFC-AGG-ID: kBM06OVkPt-eF2DjzQeo5w_1786526501 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4997b060af8so4513015e9.1 for ; Wed, 12 Aug 2026 02:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1786526501; x=1787131301; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Zul2jzYANCApDwLIn7fzzjcsabOj3YOj7EPJ6HMmOco=; b=qGIVrkG6/uvzEN7q5ekPNyALt80iCWZLW3by/S+GLjKvAcDGudX8dsq5ZO8WdV7uGP 0Mirzm6sgWv4cMH2Zqse596+zI6Hb6w7Ygz5ovk/ceQho5BsE8N95XL1xkY7NNeoO8je TY2cCQNuMrvSCiH2MnCL8oRLz3mE0qdV4sj/uZr1NYQdh7CW+aVHvfmKepJPur9GPr04 Ifka4AgxIi6lIFb81HgqCqCXHA3Q32J4qBfE5XJdQLGf9JYsx3MXHywapS2xxosXEkd8 F6d+VQmI/oYZBwlWi9g1XWl9rbQY5T/SrnRPzLxi2o92WARcSpDziWsRVlTy7sT2ovQ4 WnQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786526501; x=1787131301; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Zul2jzYANCApDwLIn7fzzjcsabOj3YOj7EPJ6HMmOco=; b=Qyt+mU6tdthYdgWkbDWtIo8O5uP77JTDfHBQ+ay4it49cnujtzWCwUYw+g5iIq73XN UdpWEZQ2WIcOhDvPhIsHdBQdwfEnzZiqjnBpKF2A87PLEfkxR/pGg3OHLt1jtLnR4+cO SKxWM36S9YA1Mh8qq4BM5INlg+Bofgy2adFoeRwb7dQPpwhvgyPBJHF0+nVmq3xh/Xsr hbZ8bCUl1lL+8OqaTTOxIgldur7mg6XlR/zJZ4u56q04g6Y1pWpaAr7UDYPv0LBMglK6 uZZN9BhpRXBVng2M/iTvZThiFk4fE0uAqbOFhUuECFcx85sMmPznPDHBY+hLm+AMKp9Z nVIA== X-Forwarded-Encrypted: i=1; AHgh+Rozj00kt6eEjt/Edx0Nwg3ph/kLvhIJ+NCoMRI16u+deicFRSgcqXzR/8Ijjn2yvRWdH4sjG0bwNKj1nYo=@vger.kernel.org X-Gm-Message-State: AOJu0YwK5Ai8p0S2HBfbl4uTrPxkOXvfRsllHR9cHhR573oufhdvMVAs gXdL6i7V0SLOC+WskW0l83oRd+UJ8Sadg24R+O+rrSjo/5TcdFUlSRQtLxdsVk+Evc11ThZiQZP AY1ppeeZyDXGJ4vRPL1EKehXj+HsDzj/rCPfYi/O5MgdtsrX00fTVYGPhs5YqICGbXA== X-Gm-Gg: AR+sD11DG9EB8S+nv8T9TGf+ES21tzlU6Ffuhlo1A0lkufd1IeBmw3pqs4yzyPBx5UR oWo93ilVE2cGTZBLS0fwOe2E2yXgK66BdH22+ncz6ns9ZzzYJW+aL3U8/CZn9XkCablOMXqTQUs OAtdwpKvguFvIWsYpr4bLfAf2yV16B0NhpRiDMPHBYtmc3EkzOdW+R4fyrjuIaFyY4u4CvJPNFG adR67qt8SZAH6CP25TRQVAlj0XkGsBZ8Iov9C7Pl8EXEkzRyPRR5d245s3wDVDxk5ICBldUBlS4 I55zNpl1mB0yLMCpmodmhpVByg62fecg37kCjqvXR9q1reQfrpz8f2tdf4hgIRfzA3TrSdYKS9c MmlIsh59W2JgBk+EmNK/dHFxkPyPdsOY= X-Received: by 2002:a05:600c:4e4a:b0:499:78b3:7b34 with SMTP id 5b1f17b1804b1-4997c0fca3cmr46672755e9.2.1786526500990; Wed, 12 Aug 2026 02:21:40 -0700 (PDT) X-Received: by 2002:a05:600c:4e4a:b0:499:78b3:7b34 with SMTP id 5b1f17b1804b1-4997c0fca3cmr46672045e9.2.1786526500599; Wed, 12 Aug 2026 02:21:40 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.92.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997c9417bcsm44764135e9.4.2026.08.12.02.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 02:21:39 -0700 (PDT) Date: Wed, 12 Aug 2026 11:21:36 +0200 From: Juri Lelli To: Hui Su Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, longman@redhat.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] sched/deadline: Fix DL server initialization for initially offline CPUs Message-ID: References: <20260811100612.1408592-2-sh_def@163.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=us-ascii Content-Disposition: inline In-Reply-To: <20260811100612.1408592-2-sh_def@163.com> Hi Hui Su, On 11/08/26 18:06, Hui Su wrote: > Commit 9f239df55546 ("sched/deadline: Initialize dl_servers after SMP") > moved DL server initialization to sched_init_smp(), assuming that all > CPUs are online after SMP initialization. > > That assumption does not hold when CPUs are intentionally left offline > at boot, for example with maxcpus=. sched_init_dl_servers() only walks > online CPUs, so the fair and sched_ext DL servers of an initially > offline CPU never get their default DL parameters configured. Bringing > the CPU online later does not run this initialization again, leaving the > server parameters at zero. > > For example, boot a two-vCPU QEMU guest with maxcpus=1 and then bring > CPU1 online: > > # echo 1 > /sys/devices/system/cpu/cpu1/online > # cat /sys/kernel/debug/sched/fair_server/cpu1/runtime > 0 > # cat /sys/kernel/debug/sched/fair_server/cpu1/period > 0 > > With a zero runtime the fair server cannot be activated, so fair tasks > on the late-online CPU can be starved when higher-priority tasks > monopolize the CPU, potentially causing user-space workloads to stall. > > Initialize DL servers for all possible CPUs instead. For CPUs that are > already online, preserve the existing initialization behavior. For an > initially offline CPU, initialize the server parameters and keep its > bandwidth reservation local to the runqueue, but do not account it to > the root domain until the CPU becomes active. A subsequent root-domain > rebuild then publishes the reservation. > > Avoid updating the runqueue clock and setting up the current CBS period > for offline CPUs. The configured runtime and period are initialized at > boot, while the dynamic runtime and absolute deadline are initialized > through the normal CBS wakeup path when the server is first started. > > After the fix, the same test reports: > > # cat /sys/kernel/debug/sched/fair_server/cpu1/runtime > 50000000 > # cat /sys/kernel/debug/sched/fair_server/cpu1/period > 1000000000 > > Fixes: 9f239df55546 ("sched/deadline: Initialize dl_servers after SMP") > Cc: stable@vger.kernel.org > Signed-off-by: Hui Su > --- Thanks for the fix, makes sense to me. Acked-by: Juri Lelli BTW, while reviewing, sashiko noted a related pre-existing issue in the init=false path of dl_server_apply_params(): __dl_sub() and __dl_add() are called unconditionally with cpus that could be 0 during CPU hot-unplug, when the CPU is no longer active but still online. sched_server_write_common() only checks cpu_online(), so a debugfs write during that window could hit a divide-by-zero. Could you take a look and consider posting an additional patch to address it? Thanks, Juri