Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2260393rdb; Wed, 21 Feb 2024 01:59:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXElq2mr29RKrqL0KqEnktWG4tRF+/cLl5Lc1nEa2M5yuQJYzWQMuBynNTzAMW5qZsXHPNcGkCGc9WtK7mqvrVuK2BWvGRp0b3HHrphAA== X-Google-Smtp-Source: AGHT+IEsxOoBA2krtzxk++O8mYIaQc9I/eKN8StFzhDoFbLmZgWEveho4f1tFKVHsRvXLUSgKNp+ X-Received: by 2002:a05:6808:228e:b0:3c0:32c6:4e88 with SMTP id bo14-20020a056808228e00b003c032c64e88mr20727509oib.9.1708509549484; Wed, 21 Feb 2024 01:59:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708509549; cv=pass; d=google.com; s=arc-20160816; b=E9/0oDmWD95CEgjUANDvLs7xhpbY3E24rPTPP8BICylsdUAoHoYk74bBisFb/5v0Xk kw0TvLpHsG99edo6CL/i/PtYoizs8+npGG+21X59J8UB2AaV4CnRB7GsOH3mMiuGCARb jhUKZn8HjKtF658+DBDnfcbgvrwDeMTAwC8Tb7pCXHJT/g7D3wiTt9VH++6iUqIrfw5F /05g0KIhOubGpX0kRh//9VFDQeknuO3VOC9Pk9msxEmkNvzEyFVfVBzWSYD7SzhOx17h boMF9gWZU1EOlAzQeXBQqiZnddBVdtpqpOG4CAhAcO55r5ul3bZfHRtTkN3vgSEKBAGj NtyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from; bh=Z1Mu9mItqFFRxmNTCfIHg3Vgo+jSXM2iK+TaQ7EDB/s=; fh=QMm8m/ZWm+A1EqjKAllYKUqNg+o2tkLujHELlI5tZV0=; b=m89vi433Be7tlM9DV5oD1MgjeT6ONVouZUGU4ecEdv+8yN4J6VKDrcVbA2wZ4Q+Kbu 9IDK//XEzMDp7L1uu9OSTBzwEhj34jra+b/9fkOmUReRpG6WbC7jSgO7RtDUy54LcRtx YkGYtjlZcidj+MSs8wU4DYRasxiONPkq2547HcsVoaaDIO2V63MgVWx0KUEmyMy7UGxG LWP+Kad3k261yNlCaWtINl0ggaLHgSgv1UE2gAM18OYKsu/NFc7OGLREMuTMc4KABSDD 6JHFrPkBXuazjRHgqFYFUSY6h0XeloC5mTSpEnFq4lcGiXzxOfZAffJkUMBijf3WNULF CPmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-74453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74453-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x7-20020a626307000000b006e363ca24dfsi6718598pfb.273.2024.02.21.01.59.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 01:59:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-74453-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74453-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2F257B210D3 for ; Wed, 21 Feb 2024 09:54:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 168E94D5BF; Wed, 21 Feb 2024 09:50:05 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C3524596F; Wed, 21 Feb 2024 09:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509003; cv=none; b=fNStzsc41HSP6RWnq5Cb3PTFJkF1RR6yA+S3bYh5cxYV711f6XTRZHeh9Qjy5j4Veqpauj3pms8UK+jMKicD0372ktxkIkebXLdEaYlthF3Zzo+3Bv1ZtBnG4KEvSLcOkQHaIsXbS5YG4bHW/Qpg1KBbvSMkla5MxM33GoOkmK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509003; c=relaxed/simple; bh=t4Qh0s/9NGiebNos8RWbTI6PuT087Z/eTqnpXervcDg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=how7qUS24LbkjNtNTPy3YTDtVTuXnXLuwC4QeWPFk4X/X1C58ZBKOjWab0eKmYe2mFyfWL2HjvJIpWyQTQe55sLPlZXMhfXj24AiyiTjtaFAtW7sKTpfv+UhhnlTFYScVPAwjpF96xIsgNGivA8iK1C0VnoMQjsmIJxLJpMvjX0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d85ff70000001748-78-65d5c73a3e19 From: Byungchul Park To: linux-kernel@vger.kernel.org Cc: kernel_team@skhynix.com, 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, 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, max.byungchul.park@gmail.com, boqun.feng@gmail.com, longman@redhat.com, hdanton@sina.com, her0gyugyu@gmail.com Subject: [PATCH v12 15/27] dept: Apply sdt_might_sleep_{start,end}() to dma fence wait Date: Wed, 21 Feb 2024 18:49:21 +0900 Message-Id: <20240221094933.36348-16-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240221094933.36348-1-byungchul@sk.com> References: <20240221094933.36348-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSb0zMcRzHfX//O85+uzI/ekA3jbFSUftoGPPA74k/Y5nxgFM/7ri77Krr j7V15G9/RluFQnVcp6K6EuEsnUoopStJmg4l3ZXF3TpF7jRPPnvv/X5/Xp8nHwaX1JOLGYU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kl0fiPDAnTle2Ff3z8OH7/fL562FwSTbpxsjDzwvK cFmYlBIRogP+Md5bmroEX7ONgJQEX7BOxhOQ81BPQfuDMgT6CjUGQw274cOUBcFs61scMtLa EeT3fsWhorEHgbH4KgWdfQvBZB2joCVNS0FM4UMKOobtGHSnp2JQZtgPb5ILMKi1DRKQMURB dkYM5jg/MLDpSmnQRa8Bc3EWDfbeDdDS856E+twWEoyf18Gt290UVBlbCGh8bsag80UOBT36 ORLeNDYT0J6SSML90QIKhqd0OOisYzS8q83D4FGsw3bt528SmhJrMbhW9BgD06eXCKrjv2Fg 0L+noN5qwaDckIbDzL0GBOakERriEmw0ZKuTEGjj0gl4+6uJhNhuP5idzqG2+/P1ljGcjy2/ wBun8gj+dQHHV2Z9pfnY6s80n2eI4MuLvfjCqiGMz5+wkryh9AbFGyZSaV4zYsL40bY2mm/O nCX4PlMGFuAeJNp6UgiTRwrK9duCRSFJX9rQWbX4ouEOHY36RRrkwnDsJu6LfYZ2MsV6ch8/ 2nAnu7IeXHniAKlBIgZnr8/nisdbKWexmA3kvj8tcYwYhmDXcHdbI52xmN3MpU8PUP+cK7my R7V/PS6OvCTbQjpZwvpxXR1P8GQkykPzSpGrPDxSIZOH+fmoQkOiwuUXfU6cURiQ42V0V+wp z9Fk5+46xDJIukAc8swkSEhZpCpKUYc4Bpe6iokLjkh8UhZ1SVCeOa6MCBNUdWg5Q0iXivcc EYIl7GnZeSFUEM4Kyv8txri4RSNv4pBR0HQUzezdqJ/epdDaIRg0lZsI26qcVwqFj7qsgAhc ttbd/KuofXXJIqOHIqhSEtFwMGVxaWC/C+3VtUIa0Csa1F4KrqnsTvO0bNx/eV/FimNZubTc NryEXXj8nDqh8PDRmy9X7xTXVGkb5nrYcWGHpr95LrNa/tR6SiolVCGyDV64UiX7A1jZPJ4u AwAA X-CFilter-Loop: Reflected Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 8aa8f8cb7071..76dba11f0dab 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 @@ -783,6 +784,7 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout) cb.task = current; list_add(&cb.base.node, &fence->cb_list); + sdt_might_sleep_start(NULL); while (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) && ret > 0) { if (intr) __set_current_state(TASK_INTERRUPTIBLE); @@ -796,6 +798,7 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout) if (ret > 0 && intr && signal_pending(current)) ret = -ERESTARTSYS; } + sdt_might_sleep_end(); if (!list_empty(&cb.base.node)) list_del(&cb.base.node); @@ -885,6 +888,7 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count, } } + sdt_might_sleep_start(NULL); while (ret > 0) { if (intr) set_current_state(TASK_INTERRUPTIBLE); @@ -899,6 +903,7 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count, if (ret > 0 && intr && signal_pending(current)) ret = -ERESTARTSYS; } + sdt_might_sleep_end(); __set_current_state(TASK_RUNNING); -- 2.17.1