Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp391841lqo; Wed, 8 May 2024 03:04:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWk8KaNZPcGLtHvBru693WKNrWEYP/Uev7i3wMVTDn40Mk8uUI6PqGTrJJdeUr2HamqtkpIFhJt7h4ncflcY/61wj+hO+O7vT5YGx4/Nw== X-Google-Smtp-Source: AGHT+IFm9ptfMNeBtBMLR78azvfZZZysEbOoFT7Z5S2+F0hBeVdJM9KMpXH0VNs/XtiRLQuc5Jmt X-Received: by 2002:a17:906:29d4:b0:a59:cb08:465a with SMTP id a640c23a62f3a-a59fb924a0cmr135813666b.7.1715162689518; Wed, 08 May 2024 03:04:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715162689; cv=pass; d=google.com; s=arc-20160816; b=fA0XOiPlO7X27CltW+1yMB3sPgZn2MwRFkTQC84L5Z7wYzvYjV+Lv34zeIliNzkAty xnItdIY1qe79/U8Kn5B1hOGVVTt/HvXB8w28Y5PRN1qYHHDbpvYE+enJ/bK3XHandeyo V6iMhT/HoJrJoR7HgeYU9nie05s/1wdy/2dvSyiMmLTNMU1MYNGh3I6IWY5+pAyLQzmh mVdCahVpnkrlqFbN1GQjyNbvVyv/NhM0HssHV16xGqKDM1708He5OphhelVupWcdQZR1 t1HO1dkBsV8w3w4bCjdR7x5hQlPuJEJoEok7P6NsJohcB88StFWrQXLFHhwCg3pWs2SP FZ5A== 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=BveDZXyUi+0KphJCZYH/lpxdeY6rjC9WhIaqxXlaGMI=; fh=H2KRUF8uSM4+6+w6W9vKW2QB11XTfop4gd9hLuyjokE=; b=RkxppdTo3W9FJBtQ+K+8zBq1Ve0z2THtfQK1jIFinQ4Ml8tknlVwdnmziMiqLxS7h0 0/Bd9qu5Wzyv9LglYZSHB6FPXe6uOAkMvIu1I6ygjh4EutrxP55XFJHdF1wu57Lgz24Z c6lK6HKYA85XIn6lu0iQN/H8HO16jxDlk5hBIxy4uQ8ncE/Lfy0ZSsZ5JVrM6u3oreZy igyQvOCIqs1+biUtYL7pQXakTWRrzxWWJKrr5VOGPoKBl7vl5cJ4S8LrHbnV4KiDCx4m FINvW74wOZQ4Op7xKOyYF2K9xoVrg1jLxE6/ACqcv8rGXXbE55qsKAM1kKOSDb6DqVAB rDaA==; 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-ext4+bounces-2371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2371-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b8-20020a170906194800b00a59a98fe818si4560403eje.562.2024.05.08.03.04.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 03:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-ext4+bounces-2371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2371-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 18F331F23DCB for ; Wed, 8 May 2024 10:04:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 544D580626; Wed, 8 May 2024 10:03:04 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F28D7E0FF; Wed, 8 May 2024 10:02:59 +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=1715162583; cv=none; b=aZQqtStLXIU4dDifskHgIepw0TBrLCs8VF+Px+6j7pxHnAwWDVI9IIW8qZoChNWlbql2LRjDnAQDvbo5MpKNI7imBYWTrEoxcmXZk+zkaBeRApu2R8GAEnZHJ4U3TdFjl6adyVrXloJFOkxQQIWVsSDlqtqnB6jNbYSzq0uayDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715162583; c=relaxed/simple; bh=Z/lrsPfinthw0Keb2TOWgQylHJ0tuWxQmHrjSTWrwaY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=UBpHFhHuap42M0xL3Jl3a1U0nR2jROgFvBfLjafo3nAVroTyzIt9Aw6MZuoYpuzDcjgmqdaLHf6EkNR6Fjk8WP/ncVD5X3o8K12cRd9ADhmD50mrm1uzMlzywSDCHkWpvgwbx/MERGdCDyo77YZKeowueOrpAqNmvXBEDL/vFMw= 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-c5-663b4a39573f 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, 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 v14 11/28] dept: Apply sdt_might_sleep_{start,end}() to wait_for_completion()/complete() Date: Wed, 8 May 2024 18:47:08 +0900 Message-Id: <20240508094726.35754-12-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240508094726.35754-1-byungchul@sk.com> References: <20240508094726.35754-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzXSa0yTZxQAYN/3u1Kp+awYP1jGZo0xwYiwwHa8xC0uGe+cM9P5S3/MBj6k sQVTFOzMJlhQ7gEmdhTcuJiuQrVSunhFKw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kernel.org List-Id: List-Subscribe: List-Unsubscribe: Makes Dept able to track dependencies by wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h index fb2915676574..bd2c207481d6 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -10,6 +10,7 @@ */ #include +#include /* * struct completion - structure used to maintain state for a "completion" @@ -26,14 +27,33 @@ struct completion { unsigned int done; struct swait_queue_head wait; + struct dept_map dmap; }; +#define init_completion(x) \ +do { \ + sdt_map_init(&(x)->dmap); \ + __init_completion(x); \ +} while (0) + +/* + * XXX: No use cases for now. Fill the body when needed. + */ #define init_completion_map(x, m) init_completion(x) -static inline void complete_acquire(struct completion *x) {} -static inline void complete_release(struct completion *x) {} + +static inline void complete_acquire(struct completion *x) +{ + sdt_might_sleep_start(&x->dmap); +} + +static inline void complete_release(struct completion *x) +{ + sdt_might_sleep_end(); +} #define COMPLETION_INITIALIZER(work) \ - { 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) } + { 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait), \ + .dmap = DEPT_MAP_INITIALIZER(work, NULL), } #define COMPLETION_INITIALIZER_ONSTACK_MAP(work, map) \ (*({ init_completion_map(&(work), &(map)); &(work); })) @@ -75,13 +95,13 @@ static inline void complete_release(struct completion *x) {} #endif /** - * init_completion - Initialize a dynamically allocated completion + * __init_completion - Initialize a dynamically allocated completion * @x: pointer to completion structure that is to be initialized * * This inline function will initialize a dynamically created completion * structure. */ -static inline void init_completion(struct completion *x) +static inline void __init_completion(struct completion *x) { x->done = 0; init_swait_queue_head(&x->wait); -- 2.17.1