From patchwork Wed Mar 6 08:55:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13583551 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 C5418C5475B for ; Wed, 6 Mar 2024 08:56:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 85DE06B009B; Wed, 6 Mar 2024 03:55:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CA6D6B00A0; Wed, 6 Mar 2024 03:55:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4723E6B009E; Wed, 6 Mar 2024 03:55:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 19B246B009D for ; Wed, 6 Mar 2024 03:55:44 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EB115120384 for ; Wed, 6 Mar 2024 08:55:43 +0000 (UTC) X-FDA: 81866006166.04.7609D18 Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by imf06.hostedemail.com (Postfix) with ESMTP id 129A018000A for ; Wed, 6 Mar 2024 08:55:41 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709715342; 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=i+vMKunG3eaiF9lJzlsXPRXR8u6Jtbkfr6fzW/dMC4o=; b=1VIVvkVTToiCEDEVhjpok13pbUSpQtDrbTkMAmn68pwCRO2P+PpY8YA/gZnCWuV8PybhQw Ee9hLbY/pkPMiOcpisYGqN5w8fuCuWPYDrqOwq//f/B2pR84lBxaHsu0qutaDxuOe2jico p7XFNZV6l+t1mk4QeCzSprLQbTPsG5o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709715342; a=rsa-sha256; cv=none; b=HhXbWkAMNHd832VYkrOe6CzCvCghXznXqwgwRlZE0SYWhmmOp+ufjogWfKHWp9ws2uwn70 VwBLJxSsH/pc4IMTbThYwlcd7uCAlw76S1LUjDb46P9auThujfweC+vNBTJjlaPU5BnUNT Nw3BEt3EblJyfLvTrMyFpDLK9d2WAmA= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none X-AuditID: a67dfc5b-d85ff70000001748-38-65e82f7efe45 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 v13 17/27] dept: Apply timeout consideration to wait_for_completion()/complete() Date: Wed, 6 Mar 2024 17:55:03 +0900 Message-Id: <20240306085513.41482-18-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240306085513.41482-1-byungchul@sk.com> References: <20240306085513.41482-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSbUhTYRTHfZ57d+91tLoto5sFyUyEotTKOIJEn+omCEbYB/swR15y5Uts ahlZmi+kpmamlprMqWu6lbZZWDkxTctFNl8wK5My8YWmkrqVKdVW9OXw43/O//fpMITULPJm lAlJgipBESejxKR4do1216WAaSHQoAuB4muB4Fi6SkJVk5EC230DAmNLBoaZ7sPw1mlHsPL6 DQHlpTYENZ8/EtDSM4bAor9CweDEWhhyzFPQW5pPQWZtEwX9X1cxjJbdwGAwhcOr61oMHctT JJTPUFBZnoldYxrDsq6RBl26H4zrK2hY/RwEvWPDIrC83wm3q0cpaLP0ktDTOo5h8EkVBWPG 3yJ41fOSBFtxgQjuzWkp+OrUEaBzzNMw0KHB0JzlEuUs/hLBi4IODDl1DzAMvXuKoP3qJwwm 4zAFXQ47BrOplICfd7sRjBfO0pB9bZmGyoxCBPnZZSRkjQbDyo8q6mAI32WfJ/gs8zne4tSQ vFXL8Y8rPtJ8Vvt7mteYknmzfgdf2zaD+ZoFh4g3NeZSv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YJIdF+TqicNJBC g4kXyvO7GSGxqpMRDLazgr3QR7hTMYQF41cXJdiKUmnB9jWHEdJG27Aw1tTECK9vTJPCQFse PrTguGRzqKhSxohq3y3BkjDL+5vMmduS8/bUFhyPetk05MHy3HreWdyC3ExzK/iOjinCzV7c Yt6e+ZlyM8GNSPi7TbvTEMt6csF86aON7prklvFN2iTGzVJuAz/YkI3/KRfxxQ8dfzUes/21 sWu0m2VcAP9Wa6SzkMSA5hQhL2VkTIRCqQpYqwkPi41Unl8bEhVhQ7NvMV+cyS5DE617qhHH Ivlc6VaPQVFGKWI0sRHViGcJuZc07seAKJOGKmIviOqok+qzKlFTjRawpHy+NOioGCzjTiui xXBRPCOq/6+Y9fCORymdnoGvrvTtG7YW7IjOOt4RJd35YXd+kL5/07bU9d6yQy+Dcog1jTsi rC9qk0/s3zC6cMmDI8mHv18/Nr2XcZbPUZV82pmQQD05ZaLGtju/RC0t8l1n4Iy6id53w7tK VoUst1asrO3eZXXK9Z1LGxtNz5dfujf3p6PdboyLbmnmcrbISU2Ywt+HUGsUfwBNhV94KQMA AA== X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 129A018000A X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ewm4ggfdmwfcau3kbrwbzgtmu1g5ab7k X-HE-Tag: 1709715341-294803 X-HE-Meta: U2FsdGVkX180vaHm6o0QTODenaGYyB2HiCm5oZOohwaNlIcyO2BSqJFCqKLeaqQfQXQgEeRgNFaCMHc+V+CQBqT2pyhkhmE2fW9zRUbnlP3WyVHd/GrrQ6ettgTVv+uGskYZdjag7VhrgdJHUUSXe3GuBKPCtoZnQFkcTCkdkKYEiSrI50w4bx/ne6CpRlx30A7ETYMngFDnqdg8n6MoGCvttxiGYyRsbrFWCfhuWycs122eqdNFsOIpj8aaPZDWeOa2hMBUW7eRzr9jNNpSX6/ERrxDRXfECwcfPZGZo04cXx1+r0F+3w2RxeSF/TQXFsxI5ymvvaW2HDmEdAbE+u4ZuQ+sv/nrpKUi/09H4zziYvHXwlfvcf6N8TML9AKO69TwJK3jjvshx5HPvM1mtBd4BJIV3kO7AgWm2WCD+MbR0wCxFcXiseMh0885980MyvFaZejzR6LM+mxC33CPHbqydLTGTj50skdUIoU/itrNH7YHsuL7WNwWuo0WTpr0O678rGcNVOa5HgHe0Uo3D5XAbP2VRLFrekQ69LsehyMOUJbfz0oUGpBckw3IEzPjOP+HDm/jgv3iA2B1agc0s+s/mLxToOpKbGaowVI1Zkwp1WNYm+Rz8Sjbt1K0kh5nVMza4vTorqo/U2I97VtsL767St7fOF4yeODbWU2oQ8wPiuYyCuOXVkmzbA49bZ7+JukuxvaNdlW8KxFNFA1FhFR8VkiLfrWATNXlfjFygUHP5zOtJW02rs9X5rqOkV1UGjJp6eQFEf3sVjfFcIJBjVptXRL2PTFjDfrCCL6A+GAUINZRa1/YFreE7o7yWFFkTCja7tv86HZKEwO/+T1/7O8nTJP2BRHGv2bnb/RXRne/P1Yxtbg0XvTHnwCEXemnXSwAxSFg4LwUh5Etuaf1J41jt2va/+GACNI1aYOO4aDN6rLaj0TFbrGNWj2Hk4PKsBIinVDTXmx0xqKKoQW lmFMYtE4 bnk7MpQ8x6TnzHdH1nuwpiETWfgCq//aHlATrNilbxxohbKcBV8kp8Kft/GtGPVg1SC35AHhSaYRdnznqG510uGSO/RUBFc1eBino1jsBEI7G0qw= 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: 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);