From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2DCAAC44506 for ; Fri, 10 Jul 2026 06:40:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 831DB10E147; Fri, 10 Jul 2026 06:40:17 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by gabe.freedesktop.org (Postfix) with ESMTP id 80C0810E147 for ; Fri, 10 Jul 2026 06:40:16 +0000 (UTC) X-AuditID: a67dfc5b-c45ff70000001609-d2-6a5093cf72db Date: Fri, 10 Jul 2026 15:40:10 +0900 From: Byungchul Park To: sashiko-reviews@lists.linux.dev Cc: linux-rt-devel@lists.linux.dev, cassel@kernel.org, linux-ide@vger.kernel.org, tytso@mit.edu, linux-kernel@vger.kernel.org, Anna Schumaker , linux-modules@vger.kernel.org, Chuck Lever , ojeda@kernel.org, dlemoal@kernel.org, dri-devel@lists.freedesktop.org, Jeff Layton , kernel_team@skhynix.com Subject: Re: [PATCH v19 07/40] dept: distinguish each work from another Message-ID: <20260710064010.GG37630@system.software.com> References: <20260706061928.66713-1-byungchul@sk.com> <20260706061928.66713-8-byungchul@sk.com> <20260707073334.0E5A61F000E9@smtp.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260707073334.0E5A61F000E9@smtp.kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42LhesuzUPf85IAsg+Z36hatO/+z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S9y48RMs LiKgLDF7x1mgOBcHs8ArJoldh6YzgiSEBdwlXrx/DGbzClhIHPv/gw3EFhKYyCgx46c+RFxQ 4uTMJywgNrOAjsTOrXeAajiAbGmJ5f84IMLyEs1bZ4Pt4hSwkng+5x87iC0KtPfAtuNMExj5 ZiGZNAvJpFkIk2YhmbSAkWUVo0hmXlluYmaOqV5xdkZlXmaFXnJ+7iZGYFQsq/0zcQfjl8vu hxgFOBiVeHgN6v2zhFgTy4orcw8xSnAwK4nwPpABCvGmJFZWpRblxxeV5qQWH2KU5mBREuf1 Ck9NEBJITyxJzU5NLUgtgskycXBKNTAy/ODbsHDVxwO9FrJxx00vFy17PN/VRluU1cq55q1j sreraJNu8DPBA4rrpFat6FJ2MIg2Toq7fXWZxN+6Tx47ONd7bYmUflvXzeH/9MU7TeUNu16L u73qcnxlrTpbMfff6vJSH+al+i9eZzN9mLv48hGVW39kE965bBN/2rClw2fCe6dzKTlKLMUZ iYZazEXFiQAypySkhgIAAA== X-CFilter-Loop: Reflected X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Jul 07, 2026 at 07:33:33AM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] `dept_update_cxt()` hardcodes the process context ID, failing to track bottom-half (BH) work items in softirq context and corrupting the context of preempted tasks. > -- > > commit b8dda7d95e5377770d28c6712cf8fe7fafa98ade > Author: Byungchul Park > > dept: distinguish each work from another > > This commit updates DEPT to assign a different context ID to each work item. > Since workqueues provide their own concurrency control, wait operations in a > work item do not prevent events in other works from executing. > > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > > index c6ea96d5b7167..4a4075d0697c7 100644 > > --- a/kernel/workqueue.c > > +++ b/kernel/workqueue.c > [ ... ] > > @@ -3204,6 +3205,8 @@ __acquires(&pool->lock) > > > > lockdep_copy_map(&lockdep_map, &work->lockdep_map); > > #endif > > + dept_update_cxt(); > > + > > [Severity: Medium] > Will this unconditionally modify the process context ID, even when tracking > bottom-half (BH) work items running in softirq context? Am I missing something? AFAIK, workqueue's workers run in process context, not softirq context. > When a BH workqueue executes multiple work items in a single softirq batch, > process_one_work() executes them and calls dept_update_cxt(). However, > dept_update_cxt() is implemented as: It's becasue its not racing with other contexts. > kernel/dependency/dept.c:dept_update_cxt() { > struct dept_task *dt = dept_task(); > dt->cxt_id[DEPT_CXT_PROCESS] += 1UL << DEPT_CXTS_NR; > } > > This hardcodes the increment to DEPT_CXT_PROCESS rather than checking > cur_cxt() to increment DEPT_CXT_SIRQ. Does this cause DEPT to fail in > distinguishing sequential BH work items and falsely report dependencies? Are BH works running in softirq context? I will check it. > Also, can this corrupt the continuous dependency tracking context of > whatever task was preempted by the softirq? Process context's cxt_id is referred only in the process context, and irq context's cxt_id is referred only in the irq context. So no problem. Byungchul > > /* ensure we're on the correct CPU */ > > WARN_ON_ONCE(!(pool->flags & POOL_DISASSOCIATED) && > > raw_smp_processor_id() != pool->cpu); > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20260706061928.66713-1-byungchul@sk.com?part=7