From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 BCA421F7569 for ; Wed, 22 Apr 2026 01:53:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776822809; cv=none; b=JyEwVBsU/yfcckWchLcovFWbty0jJExqMMr7Hz2RN4pjl0kDr+bRwOlU+HlbJn1XVCR5nxnC8DmQXWmhW6daDs/BY2Tm6MSn655Q13q8bL1xapNHU87RBy12D08Ku+57P/7bUgJ+6rvjDzzNbSSX/EQlIw/TpHLlROXHoNLsHZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776822809; c=relaxed/simple; bh=iPsuJ+3YNbu3A7xKPhwlOBCHI0w4RA/i+A8/XLPG3/U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Gy6KfE1kI1Y8OMtthFV4H6Mnekk0r4/+5r0ab7ALL7iaSYRqW+zJHlka+9HPYfsZpkIb+XwINnkJdEgL3+298/WlLRKxd3SMoiOFusoe211dj8y9iYt5BJFPz2UUle89XWm8MxKc9Si5xTT/agueRK6m0uB0FmSB4jRbNYb+0bY= 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=P0HwV5nj; arc=none smtp.client-ip=209.85.215.178 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="P0HwV5nj" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c7971d0d97dso2935108a12.1 for ; Tue, 21 Apr 2026 18:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776822808; x=1777427608; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=88pOpxM7/TmqzN0A6UrOhXDmQlCvSHTQ3maZE1RsEwQ=; b=P0HwV5njeyqJPV/bqpx8ok8Q0JnZ8SWDXIcrwDk6v+8ylVo1pPOrae5FiHlP+4BN09 mjQCDG/4Z7lnihXYLiTjp+gi6+6GmUIPzXKaTG1FgCasFdr9DjUfjKJmFdkexu2mfsv+ C+tuZpXcWeul3BHrGLwQlb9T1+vECrcd2fTyh/oRSb+ynansZpLYO2MfStfdj65RSugs DCbR1IoYH0akzznMyPgdMxgnSCM1P2nAydGnN4jCpFxchOqHdurcQLg4LCsWp0PzZj3/ OQVbKomd86lXj2sdOeubDcXtMXFqG7nlTND/qg1Th9a7f38PaKgQca/k1T1zJfooL5Fj dhKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776822808; x=1777427608; h=in-reply-to:content-disposition: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; bh=88pOpxM7/TmqzN0A6UrOhXDmQlCvSHTQ3maZE1RsEwQ=; b=f3TIgVbzbaU9mdkPagsgAPOAvpF3AdM8eoNszTPxRjbVX1tdZFuGPDQjTY7d5qn7OI W4NywfsyNMY2viK4p45wqviTLbpH+BPsQ3O+5Y/bSgwZx+E05/daVxr5BeUCwgqP2VcA kaToTq12CHOYR0NYMwVcTmYr6YAXTB/83789Ar1fQVgdHvEj5nFHcTcNOncMP+TA8JQn X+i7L2enkoUE/XPnoysEUMgJ7M/iiZdIxb4yHqsw9/x7BwdvzGQq3OaNJkmCtSKYw3ie ZxmWk8d83VqqCl0sT5a2mTid4J74PhR1GdEOKbiqO9Xnt5cO5tg0ITZDJ0P688HGuqeN LlLg== X-Forwarded-Encrypted: i=1; AFNElJ+T6WsPx6SFpaU+Eaz82/gtC9FuhkO6XWFqnYbLuj73f3oFM3bWJVo4JfYYEf7v3d82xe0O1nwQzoaxuUw=@vger.kernel.org X-Gm-Message-State: AOJu0Ywqgg0A+M30e+wImWSd6khVe3s1GICR2GLxGTfujKfLoKYjLWMY 1dv4sbfGspgxNkMFSgiDmqtlrK7lRU0Y1+jGeYvv2DjKCBHLZLjyew8t X-Gm-Gg: AeBDietw+vZcCZa7fDSjieGZBPnNnMWdEO91r4N7xfi18LZKaxL+dgpf8m7+e2cDsT8 ltiEuEkKIaOsrllMPcT/IIFqrc+SuMFhB0+THj3lObllG+FSQz8l8njYSBblhnHpsN6K0jTt8kH Lzj153z0zECiko0F65GM7pgXbjIzFaMy2JS4MlFjskziD9OVL4eNWbK1msWMFdmCJ1BnQDlw8U0 0UBKqF8W+bRxs2riPfew7bJRK4TihmALo9VXKQYf7A8UJnvKuWuw9iAVbffibITckt665Pz8Ygq NT7TJDqrxGWIp6l2db8O1Usvy9ytRasMOZXR0Q8INGYDDx5zNaQdAfDNGI6lLz3JPBegv1nchtk y5ZOAxD2tnaV+kmbcmnxHCMoveUTqxvO9scvEbz6wsXDxqZBjEHMbD39Fgp621xXf1OjZ/HMDtp onQVS2TWVnivR8/vmP+Aa7HdAZZGSWv3IXPc7JBXqI+SY4R57Tzk1A09IgnsAaLjaKpq+l0rQeM cw91jVfbDbbNlnh X-Received: by 2002:a05:6a20:2591:b0:398:7d6e:27f4 with SMTP id adf61e73a8af0-3a08d6eb34cmr24523945637.1.1776822808054; Tue, 21 Apr 2026 18:53:28 -0700 (PDT) Received: from cchengyang.duckdns.org (36-225-97-241.dynamic-ip.hinet.net. [36.225.97.241]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7976f0811fsm11321339a12.0.2026.04.21.18.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2026 18:53:27 -0700 (PDT) Date: Wed, 22 Apr 2026 09:53:24 +0800 From: Cheng-Yang Chou To: Tejun Heo Cc: sched-ext@lists.linux.dev, David Vernet , Andrea Righi , Changwoo Min , Ching-Chun Huang , Chia-Ping Tsai , Emil Tsalapatis , linux-kernel@vger.kernel.org Subject: Re: [PATCH sched_ext/for-7.2] sched_ext: Refactor scx_root_enable_workfn() enablement task migration Message-ID: <20260422094555.Gaec7@cchengyang.duckdns.org> References: <20260421074154.584737-1-yphbchou0911@gmail.com> <6cccef586daa450e322d9659d4e64e13@kernel.org> 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: <6cccef586daa450e322d9659d4e64e13@kernel.org> Hi Tejun, On Tue, Apr 21, 2026 at 07:30:18AM -1000, Tejun Heo wrote: > Thanks for the patch, but I don't think this makes the code better. > scx_root_enable_workfn() is a linear setup sequence; length comes > from the number of ordered steps, not from doing unrelated things. > Each extracted helper has exactly one caller, so the split is pure > code motion. The locking story and the error path both fragment > across three functions, and small things drift - the TID_TO_TASK > read moved from ops->flags to sch->ops.flags, which is equal today > but sch->ops.flags is mutated elsewhere (SCX_OPS_HAS_CPU_PREEMPT), > so the two sources aren't guaranteed to stay in sync. I see your point about maintaining the linear sequence for better auditability of the locking and error paths. You're also right about the TID_TO_TASK drift - checking the immutable ops->flags is indeed the correct approach. Regarding the ordering of the task enablement sequence: do you think it would be useful to be included in the kdoc? Thanks for your time. -- Cheers, Cheng-Yang