From patchwork Mon Jan 9 03:33:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13092893 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE5E4C54EBD for ; Mon, 9 Jan 2023 03:34:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78F2F8E000F; Sun, 8 Jan 2023 22:33:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B3F78E000D; Sun, 8 Jan 2023 22:33:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96FFC900002; Sun, 8 Jan 2023 22:33:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BA1FD900009 for ; Sun, 8 Jan 2023 22:33:57 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8DF02801A6 for ; Mon, 9 Jan 2023 03:33:57 +0000 (UTC) X-FDA: 80333841714.09.A170C76 Received: from lgeamrelo11.lge.com (lgeamrelo12.lge.com [156.147.23.52]) by imf27.hostedemail.com (Postfix) with ESMTP id 8C7694000A for ; Mon, 9 Jan 2023 03:33:55 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of byungchul.park@lge.com designates 156.147.23.52 as permitted sender) smtp.mailfrom=byungchul.park@lge.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673235236; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=47kkp901Xdw/ohexQUypZDX1g+7qztT7G8JS1gQG2vg=; b=x/hKkCa/xN91LmNCbQ4qsmG09cnvlQs1VTWrhvub2IKSt9tY+q11Cn+HyZK1qtmvovT8ev SpsI7ukUz6T569JMwxwiQy4D1o3A0QyQt+Rse/XURu6KlA/B7TaPfYulQmDsq4YvGXaio1 7YD6kpJ6X5OHIWpRaig+TDqgLIFnf/c= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of byungchul.park@lge.com designates 156.147.23.52 as permitted sender) smtp.mailfrom=byungchul.park@lge.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673235236; a=rsa-sha256; cv=none; b=EMvRgk+UCiBWpXZqHztnhPg6fvBeA4EEJgNnx55MqCFq42lkib3g07SPTG8Hl3PCafj2tV UBBxIsw2tMGwGduGrlWOiRewMuMM0KP/eKFmDLcmNon5fd72S0Tg85+H3SdnMrPGFZEJPU IQYaXQ6Zj6HyEd67XsVhVr5wsFhrYaI= Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.52 with ESMTP; 9 Jan 2023 12:33:53 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: byungchul.park@lge.com Received: from unknown (HELO localhost.localdomain) (10.177.244.38) by 156.147.1.121 with ESMTP; 9 Jan 2023 12:33:53 +0900 X-Original-SENDERIP: 10.177.244.38 X-Original-MAILFROM: byungchul.park@lge.com From: Byungchul Park To: linux-kernel@vger.kernel.org Cc: torvalds@linux-foundation.org, damien.lemoal@opensource.wdc.com, linux-ide@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, will@kernel.org, tglx@linutronix.de, rostedt@goodmis.org, joel@joelfernandes.org, sashal@kernel.org, daniel.vetter@ffwll.ch, duyuyang@gmail.com, johannes.berg@intel.com, tj@kernel.org, tytso@mit.edu, willy@infradead.org, david@fromorbit.com, amir73il@gmail.com, gregkh@linuxfoundation.org, kernel-team@lge.com, linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org, minchan@kernel.org, hannes@cmpxchg.org, vdavydov.dev@gmail.com, sj@kernel.org, jglisse@redhat.com, dennis@kernel.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, vbabka@suse.cz, ngupta@vflare.org, linux-block@vger.kernel.org, paolo.valente@linaro.org, josef@toxicpanda.com, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, jlayton@kernel.org, dan.j.williams@intel.com, hch@infradead.org, djwong@kernel.org, dri-devel@lists.freedesktop.org, rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com, hamohammed.sa@gmail.com, 42.hyeyoo@gmail.com, chris.p.wilson@intel.com, gwan-gyeong.mun@intel.com Subject: [PATCH RFC v7 16/23] dept: Apply sdt_might_sleep_strong() to dma fence wait Date: Mon, 9 Jan 2023 12:33:44 +0900 Message-Id: <1673235231-30302-17-git-send-email-byungchul.park@lge.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1673235231-30302-1-git-send-email-byungchul.park@lge.com> References: <1673235231-30302-1-git-send-email-byungchul.park@lge.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8C7694000A X-Stat-Signature: uykog878qe96iqmfhh1ah36i4ghxrtdj X-Rspam-User: X-HE-Tag: 1673235235-86647 X-HE-Meta: U2FsdGVkX1/NJ6QOEZMeBazMbQfptLAHo80zCEEuxRwzt2IgWJuVAFfcdRhZmRnJBJKMcvsWoBDVVlPmMHebKbYPvpyYlQKZJAhmf55mxwlbkd0FiQ5pMFjRKuTDeu+C+0SCZdkTtv9QjIc/GWbAGlfEbuV1T4FRjArS8Sj3docROgf6bYlHL0VtX59P3rKJnxr/mDuxyiGZ5K1e2k9vGeiGYrY81q9v8gQSpGjJvMIQM+tDRRUdDJRGUVl7jJihB2bYn2mwCdsMsczf/93PTTPR5ab6idWnCZ4UCYCHVINPVud0zCtsr6xJlz5dxg7ThlOtskVM6iYK/VWO91bmT4A6YFszWrJNKU3+Q7JiEuWbtodd6hg2zEji4gAOSkPUSLYBAj0AzTb2jGSDO/ckhx2VqAlZUeRavffHWJuMSGX+INAkIqOmpK2BAgCbycmHauxYYVwtlSrLd+sKCV6CLwVg/aQ2L2Hd4H3MGgJcC4MfrT6mgCinKQenL3DlZIC/IH8LIlNdsfmAKYljCdTU1o6UoQ/Z2iBeFl8UrjjoBVIF2R6vw1FlzbeWPBB1zljErYKvZNCcNG5CHrJpm4WAmj1BxXnTlpwuZDmfRk5lu0Av7R9tiMlDskP5Rpue2q1QmT1qg0MQPrO3hAZ3jXgcOGHlBZsTjjKAoBeHWjYixv0EnrofQpuiHswD8ZIVXPuU7RzFj6GdtX0HuDkNsSzTN8Pt6Wpf8Rjq9wyh/v1rVV2Ykr7ulTPyvMzLFUtZGQQNG8nPxnkkAEGVJ/GzAp0+3E9R47MyZPI13VDh2RAeCZtJH+O+2OlUoBcJ35N9wUScPUf9Nm8bRBitGpqJF4u44J+TOXbMEU1S+RgBW0J3DK3lfi7nS8h+L1Abc3sP0nDl X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Makes Dept able to track dma fence waits. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 406b4e2..dd190cf 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -16,6 +16,7 @@ #include #include #include +#include #define CREATE_TRACE_POINTS #include @@ -782,6 +783,7 @@ struct default_wait_cb { cb.task = current; list_add(&cb.base.node, &fence->cb_list); + sdt_might_sleep_strong(NULL); while (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) && ret > 0) { if (intr) __set_current_state(TASK_INTERRUPTIBLE); @@ -795,6 +797,7 @@ struct default_wait_cb { if (ret > 0 && intr && signal_pending(current)) ret = -ERESTARTSYS; } + sdt_might_sleep_finish(); if (!list_empty(&cb.base.node)) list_del(&cb.base.node); @@ -884,6 +887,7 @@ struct default_wait_cb { } } + sdt_might_sleep_strong(NULL); while (ret > 0) { if (intr) set_current_state(TASK_INTERRUPTIBLE); @@ -898,6 +902,7 @@ struct default_wait_cb { if (ret > 0 && intr && signal_pending(current)) ret = -ERESTARTSYS; } + sdt_might_sleep_finish(); __set_current_state(TASK_RUNNING);