From patchwork Fri Mar 4 07:06:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 12768599 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 D79C3C433FE for ; Fri, 4 Mar 2022 07:07:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F4648D0009; Fri, 4 Mar 2022 02:07:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF4828D0012; Fri, 4 Mar 2022 02:07:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 494858D0012; Fri, 4 Mar 2022 02:07:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 818328D0012 for ; Fri, 4 Mar 2022 02:07:11 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 33D7E93D64 for ; Fri, 4 Mar 2022 07:07:11 +0000 (UTC) X-FDA: 79205822262.28.42FE5CD Received: from lgeamrelo11.lge.com (lgeamrelo12.lge.com [156.147.23.52]) by imf12.hostedemail.com (Postfix) with ESMTP id 475614000E for ; Fri, 4 Mar 2022 07:07:09 +0000 (UTC) Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.52 with ESMTP; 4 Mar 2022 16:07:09 +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; 4 Mar 2022 16:07:09 +0900 X-Original-SENDERIP: 10.177.244.38 X-Original-MAILFROM: byungchul.park@lge.com From: Byungchul Park To: torvalds@linux-foundation.org Cc: damien.lemoal@opensource.wdc.com, linux-ide@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, peterz@infradead.org, will@kernel.org, tglx@linutronix.de, rostedt@goodmis.org, joel@joelfernandes.org, sashal@kernel.org, daniel.vetter@ffwll.ch, chris@chris-wilson.co.uk, duyuyang@gmail.com, johannes.berg@intel.com, tj@kernel.org, tytso@mit.edu, willy@infradead.org, david@fromorbit.com, amir73il@gmail.com, bfields@fieldses.org, 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, jack@suse.com, jlayton@kernel.org, dan.j.williams@intel.com, hch@infradead.org, djwong@kernel.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com, hamohammed.sa@gmail.com Subject: [PATCH v4 20/24] dept: Add nocheck version of init_completion() Date: Fri, 4 Mar 2022 16:06:39 +0900 Message-Id: <1646377603-19730-21-git-send-email-byungchul.park@lge.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1646377603-19730-1-git-send-email-byungchul.park@lge.com> References: <1646377603-19730-1-git-send-email-byungchul.park@lge.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 475614000E X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf12.hostedemail.com: domain of byungchul.park@lge.com designates 156.147.23.52 as permitted sender) smtp.mailfrom=byungchul.park@lge.com X-Stat-Signature: 51nuct781zwr3s96nw45a3shhbad6ckx X-HE-Tag: 1646377629-690397 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: For completions who don't want to get tracked by Dept, added init_completion_nocheck() to disable Dept on it. Signed-off-by: Byungchul Park --- include/linux/completion.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h index a1ad5a8..9bd3bc9 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -30,6 +30,7 @@ struct completion { }; #ifdef CONFIG_DEPT +#define dept_wfc_nocheck(m) dept_map_nocheck(m) #define dept_wfc_init(m, k, s, n) dept_map_init(m, k, s, n) #define dept_wfc_reinit(m) dept_map_reinit(m) #define dept_wfc_wait(m, ip) \ @@ -41,6 +42,7 @@ struct completion { #define dept_wfc_enter(m, ip) dept_ecxt_enter(m, 1UL, ip, "completion_context_enter", "complete", 0) #define dept_wfc_exit(m, ip) dept_ecxt_exit(m, ip) #else +#define dept_wfc_nocheck(m) do { } while (0) #define dept_wfc_init(m, k, s, n) do { (void)(n); (void)(k); } while (0) #define dept_wfc_reinit(m) do { } while (0) #define dept_wfc_wait(m, ip) do { } while (0) @@ -55,10 +57,11 @@ struct completion { #define WFC_DEPT_MAP_INIT(work) #endif +#define init_completion_nocheck(x) __init_completion(x, NULL, #x, false) #define init_completion(x) \ do { \ static struct dept_key __dkey; \ - __init_completion(x, &__dkey, #x); \ + __init_completion(x, &__dkey, #x, true); \ } while (0) #define init_completion_map(x, m) init_completion(x) @@ -117,10 +120,15 @@ static inline void complete_release(struct completion *x) {} */ static inline void __init_completion(struct completion *x, struct dept_key *dkey, - const char *name) + const char *name, bool check) { x->done = 0; - dept_wfc_init(&x->dmap, dkey, 0, name); + + if (check) + dept_wfc_init(&x->dmap, dkey, 0, name); + else + dept_wfc_nocheck(&x->dmap); + init_swait_queue_head(&x->wait); }