Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2259257rdb; Wed, 21 Feb 2024 01:55:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW6JHyIhuQax8nD5qzeQX/dXVsphAbHkjmbOHLcXDK0ppfG9BtZW3iB47mhHXsQnQ/yaHd3txH4FfzXhc5VFwMafOiU0RBP+DMZA9pYoA== X-Google-Smtp-Source: AGHT+IEZiv0TZ+KVrirsQDpgzTcDyCPKoD0hGfVL+MFQwzkt33PgDZeHCJfWUCYoXDAGA/JsclxX X-Received: by 2002:a0c:f051:0:b0:68f:7557:5892 with SMTP id b17-20020a0cf051000000b0068f75575892mr7849675qvl.27.1708509344087; Wed, 21 Feb 2024 01:55:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708509344; cv=pass; d=google.com; s=arc-20160816; b=iGnoevf7jXIKRJ5zJl/itnNNTLchax8MgPRT9d24nBxf8kAjUaYaN5xAAs7hYpUq6F GejqA4HblmM6iuNlqlunGPtWzbcA5ko34c8pE6kCn1NE67Cd7EZb7Eh02Fdd4N0FK543 Yn4xGygiqgtFfAOmMsIpVk5rh3ww1ujPVKDXz6oBnifAzBVH5vZ0Ng3hMWeb0PvmSKVZ oFoKyYyS4+WycLWdHg22rQdMKSofmGfYhbz3fAGdaekQoFylUpzpZ5ywYFwKXY7w2rwq XlycQ0FNdqXSUYqsk+kZEPK0eHjbirMO3AfFtoAydYZcjPCSE/xJAoZj3cacUNQFUMoV TY9A== 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=i+vMKunG3eaiF9lJzlsXPRXR8u6Jtbkfr6fzW/dMC4o=; fh=QMm8m/ZWm+A1EqjKAllYKUqNg+o2tkLujHELlI5tZV0=; b=nLHMj0cmTNM9khOa0ziXx01CfOMs1th55Es80fMhV3gIkSTGnfGiNjBvj/fa4KjQrd PLvopmrUooj01b85FrDxZO5elu2o6Y8nWPtrpmleuaYLiB5zT2bpdlJXPjOpHo/QBlNj 2QexD7cUPGFRhVNdLn3hYlqiq2xWybjh31S3PWXYpIcdBPFYnjq6q44u4Pn5qWcEDkBy xpP5LHaZNnElhhZpl9FeS0ffj25R3aKWczwPtPw4KlW2RXFfaYJhx0+ETpsfFB/uMzNM j3Q8TGmKZ/vq9+6AO/7YfnZzGNtAWfnqxQI6rEzZn8cKeNgNFJU5JQGTvp/E9VJiRONa rZ1g==; 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-74456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74456-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gs12-20020a056214226c00b0068fa2e70f54si985444qvb.11.2024.02.21.01.55.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 01:55:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-74456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74456-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D24251C20979 for ; Wed, 21 Feb 2024 09:55:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9B97535D2; Wed, 21 Feb 2024 09:50:07 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B4DD487B3; Wed, 21 Feb 2024 09:50:03 +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=1708509006; cv=none; b=sYCp4g9DH8wnz7qRX/AtncUdv0QGty3xACRH2G5crTxD+98zb+NXG+InUTs8Vj3vsf60/pcTUTpIui6ATIvvZ8MN3Ae/855uMbstrM9ruyYEeAAcGqWNQzQfHZk5vXSBk/UUhgg1xq758AexbNLXWEsuVHj14Rcthim5nbH07tU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509006; c=relaxed/simple; bh=TSPxdh3H9mjhA/wDLLlJUz6YZTY7hYg5ulgpaHBJJSM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=bMtV2yU5kNNrbBCGPcM4HhUU4QV0C5Wy/BFmGg0UvQADYxpN42DkH0dLS9ftWZZ1Z3fHhiimEK9yXjdwC3+ZkdDtcXrrJu9BlwFrRSh3Ylu0LaBJpIOjLWv/H6ZHU0pBuZQBvPO/vPdANl9LhccY2e/urhra1R2AECa4LfsC+E8= 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-98-65d5c73ae00c 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 17/27] dept: Apply timeout consideration to wait_for_completion()/complete() Date: Wed, 21 Feb 2024 18:49:23 +0900 Message-Id: <20240221094933.36348-18-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: H4sIAAAAAAAAAzWSbUyTZxSGfZ73k0qXN9WER/zB1oWYAcOPoDkxxo9fe2LiZrIs0WGiFd6M Iq1aFCiJCdUqghbRBDoomlJn6aAqtuoYWFMhUqoBQYuiAVRiUMKX4kpW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6VbZZmgXTTRvieZ0mYWaWVTDlWFttGaXrejLw4///8/v08NT0VeYGbw+ 7aCspOkMWlaghY3LcxcltD6X4+xeDRQVxIH/22kaSu84WOi+bUfgqM7B4G1eBy8CPgShzmcU FJu7EVx/M0hBdcsQgjrbcRZ6300Fj3+MhXZzPgu55XdYcI9OYBi4cB6D3bkBOs5ZMDQEP9BQ 7GWhpDgXh89HDEFrJQfW7PkwYrvMwcSbJdA+1MdA05V2BupeLYRLVwdYeFTXTkNL7QiG3gel LAw5fjPQ0dJGQ3dRIQO3PltYGA1YKbD6xzjoaSjDUGUK205+/cVAa2EDhpM37mLwvHyIoP70 MAano4+FJr8Pg8tppuDHzWYEI2c/cXCiIMhBSc5ZBPknLtDw7GcrA6aBeAh9L2VXLSdNvjGK mFyZpC5QRpOnFoncvzzIEVP9K46UOdOJyxZDyh95Mbk+7meIs/IMS5zj5zmS98mDyeeuLo60 XQzR5J2nGG+atU1YsUc26DNkZfHKRCHZ0XOJ239VOOQ648bZaJjPQypeEpdKOX4PjjArLpD6 +4NUhDXiXMlV+J7JQwJPiacmS7YvnWykmCYmSqZWC4owLc6XaoMmJsJqcZlkDlXhf9I5kr2q 4a9IFc4rSnx/N9FivPTcfY86h4QyNKkSafRpGak6vSE+1piSnJWmPxS7e1+qE4Wfxnp0oqgW fetd14hEHmmnqJNrPHI0o8swZqU2IomntBo1nRmO1Ht0WYdlZd8uJd0gGxvRTJ7WTlev3yon RotJuoNyiizvl5X/LeZVM7JRm+F2ihLVkfmk37Ll9Vv15oSK/MwcJfbx6t64a2+P7U2ybx9U BXoS4oeG3T6+Jl3hcaC2ft7hggOl87aotkctbG5a6b7n2r0oaXa1fN+ydkfPaF7fEfK+eVds TH3XUo+vplyIYio7yMejFyvW7EzXPEjwhgToLByvKCqwmZ19WtqYrFsSQylG3R8w6iL+MAMA AA== X-CFilter-Loop: Reflected Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 4 ++-- kernel/sched/completion.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h index bd2c207481d6..3200b741de28 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -41,9 +41,9 @@ do { \ */ #define init_completion_map(x, m) init_completion(x) -static inline void complete_acquire(struct completion *x) +static inline void complete_acquire(struct completion *x, long timeout) { - sdt_might_sleep_start(&x->dmap); + sdt_might_sleep_start_timeout(&x->dmap, timeout); } static inline void complete_release(struct completion *x) diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index 3561ab533dd4..499b1fee9dc1 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -110,7 +110,7 @@ __wait_for_common(struct completion *x, { might_sleep(); - complete_acquire(x); + complete_acquire(x, timeout); raw_spin_lock_irq(&x->wait.lock); timeout = do_wait_for_common(x, action, timeout, state); -- 2.17.1