From patchwork Mon Jul 3 09:47:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13299834 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 DC450C05052 for ; Mon, 3 Jul 2023 09:50:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E2588E00B3; Mon, 3 Jul 2023 05:49:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B9978E00B2; Mon, 3 Jul 2023 05:49:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E75C8E00B3; Mon, 3 Jul 2023 05:49:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3407B8E00B2 for ; Mon, 3 Jul 2023 05:49:58 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0F550C0832 for ; Mon, 3 Jul 2023 09:49:58 +0000 (UTC) X-FDA: 80969829276.18.F82396F Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by imf18.hostedemail.com (Postfix) with ESMTP id 1862A1C0009 for ; Mon, 3 Jul 2023 09:49:55 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688377796; 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=kmb2s4MSRQPbUE3zQMzsQm+h7YpxC3Zof1Ki3W/MRZI=; b=7gcRstSAZA23QO1i2jtFp8W8ZtELxIeDE6Xy4e2r8SDDs6tr7LD1VD9g915qDPSvyoRrZ3 cTidVTHOAofnbJpH4ZVYBbEF+MGQGduokJ6i/0n1Pm3/Vw8XbP2bfVamn6EMdHrFBbrKXP 4RXU+EgsE4Dupm0ZaH9Gjz2SVs44D4c= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688377796; a=rsa-sha256; cv=none; b=YFL+dgoMHWGhM5B2Va6NML7gL3+6ihzSSp++8XP57/myt1jRM6VugliOgaGM3KyTwTOU7v RZoU3Vl8N/VrX8z4VZx+ebjzZ+bYCTZOHWWXVLDSnHvW46PsucV/oJMdRAjOgcbtKpHB3w c92J7kSOZldpZyfDH8URgyBJOo1Uzp0= X-AuditID: a67dfc5b-d85ff70000001748-fa-64a299b4f969 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 v10 rebased on v6.4 18/25] dept: Apply timeout consideration to wait_for_completion()/complete() Date: Mon, 3 Jul 2023 18:47:45 +0900 Message-Id: <20230703094752.79269-19-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230703094752.79269-1-byungchul@sk.com> References: <20230703094752.79269-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSbUxTZxTHfZ5773NvO+tuqomPkOyl0ZCwqWhgOVsWY5ZsPh9mMFkMifuw dfZmVKE0RRA2t/AmKgoIETqQOaimNsBAbtlSpsUKWmAEZKNxaGgHzM2x8qK4Mhkooyx+Ofnn nN//9+lInN4jxEhmyxHFZjGmGYiW106vdWxtr3GYEh4FNkLFmQSI/H2Sh7rWZgJDLU0Imtvz MUze2gO/zE8hWBy4zYG9aghBw3iQg3Z/CIHXVUBg+P46CERmCfRVnSZQeLGVwE/hJQyj1ZUY mtS90H/WgcG38IAH+ySB8/ZCvDL+xLDgbBTBmbcFJly1IiyN74C+0B0BvPdeg5oLowSueft4 8HsmMAz/UEcg1LwsQL+/l4ehilIBvp1xEAjPOzlwRmZF+NlXj+FK0Yqo+PEzAXpKfRiKL7Vh CNy9iqDz5BgGtfkOge7IFAa3WsXBv5dvIZgomxbh+JkFEc7nlyE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BxUY2rtfInh19SMG ydJJg93twmCVcgj4VVyHoD9rhIHLGRMM5CdlIbh2+RYJLb8bKEjpCYLJn0Z6Z4hgd40SQor1 jFA9XkAKr4t44XneB0ZIefWeEQqk04LV7CvcrxrCQuGYmxKkkjRakMZuMEL6SDsWvjY3M0Lj 7UlS+NRuwAeXh8m2q8UoTbyo27gjQhaZ99fAxN6Vne1OqsCJ6CObjliW5zbz0hOUjjxYmlvL d3VNEDPek1vFWzM/U+lIxhLclbm8+VsTPcMv5GL5suHQGYbkvPnnxSWzv3IumE+zV+AZz3Ne fGl5zWyPx3Q+8DNrllFwQXxPbi99HckK0JwS5KnRxkerNFFB/vqTkQlazVn/4zHREpqejOnC VLYN/XDuqUUci5Tz5F3nC9UKShWvT4iuRTxLKD3lyX331Aq5WpVwTtTFHNOdjhL1tWgZSyqX yPeFihEK7oQqTjwpirGi7v8Vsx5LExHuDh4wrPxm3Glef6xyQXbrlcUuv7DlY50cLtZ1XLKF 707du2XQkmZLOHwo4Gl4sXZ0nbdP7ODR1cbg2z73Bo50OA7abTE31zTvYqrmerlW1J4L8Up6 Vqfd5u/niYz6L6ozfMTWlRfSNqx9h5ybFr0+1dDW9/C4x0VnZ8aA79jkeaWS1EeqAn0JnV71 D1FprvouAwAA X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1862A1C0009 X-Stat-Signature: pbq8rfpkbdd1ggbykp6pgmzph15z9xum X-Rspam-User: X-HE-Tag: 1688377795-525288 X-HE-Meta: U2FsdGVkX1/sCB7gBctIp8+HgRLfC6rvY8KJccmuAYQRC5NJRb+XwEVOgnmZ/Jcbfvbr5/380Eu2EoczqPIgrw7ro80WJhKR8OZp32IQTewM0tgdUaciGyCmY2JSTYsjH5uHhK1wsfrCMfSHbBrNML4W2JIfyj9QRFwkphtpELqNdl5UpbUA9ZlNJvhR6TWLshmenCSNNRf3xpPpxbwzZ0EJSJOqtb4JCttN3ivma0c4kA8xtANLvORKGuIjwe0bp27jw3Z8FxNw7psfZ5VB+uTCJIFN+XGFAuzTS/NSayPqTxZHovl+YN8hvSQoagRhWFPiEUTVynMRvauOeLAoSZQfby2Q/hjPHjgmFnZBaIUDXkOv1H7Y7HuK1qFYb90BxAdnA6Tpl6SPmbyuKk+LIVEq3mdfrE4xXo0gQQBYzPPVOVV6b9SGILvEYnMx/M6cdVYRFdn0tExa8OrOldpr64ZvMKlyznLbEo5OuJSlyaq/b6wtsaMcY42FQPri+SFeTL2b5tgzCMVAgdBJelK9b3N+J7zSfBG4XjSHxPf26acf3mvJji5wiBO8Scf3+/L2m3FiCPkoxMLD+97T2HfHdQr0SAY+/CYmv89qgVtABwS+D9z+lcDef3DsCINiTIHtBl3o6hJLBLsB2xTBa9d4w0QAEsGnjtPB3Bi6AqtOJPZCbhclEoXlA/otQ20lcRDkQ+ckGby4YLhtDhCYITdsl6BPFxi/zzUzFlRJRClOuxvAVVsTkO8sWiFKPs74BzLzsuxXmTNVlt0+FYy/MRfyFaFuI9I4f08a/9m3Tfb7SBGcMu50n1CaxQyerpXju3WLSTpcB1K5YEF0LGbEZc/D9TCALYoFx3n0JHTlTlKvDoeBKJfUQON3PxD1+3wSVmDAmJHh3mN29czSCdPlvGwaGFY5/0EJ/2eWScv3ZbMlJHvzf70R3M5JtmthLFojsbMqNzZk9k0corC2Tj0SczB z+GdpNe0 L7JwX1CBZFbqy2ZB5AELID3bdRAQHnwGsjEfQZybIWke4RRbIsBCdVugRZuWh3Bb6yPtCpnjR8H+bCeclYJjQ7hXyRfE/rG3P/Z72wLPMppiIuMA= 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: 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 32d535abebf3..15eede01a451 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 d57a5c1c1cd9..261807fa7118 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -100,7 +100,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);