From patchwork Mon Jan 9 03:33:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13092897 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 A5DF6C677F1 for ; Mon, 9 Jan 2023 03:34:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 714A98E000B; Sun, 8 Jan 2023 22:34:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C84E900002; Sun, 8 Jan 2023 22:34:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9990A900002; Sun, 8 Jan 2023 22:33:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AF10F8E0008 for ; Sun, 8 Jan 2023 22:33:57 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9326F804AD for ; Mon, 9 Jan 2023 03:33:57 +0000 (UTC) X-FDA: 80333841714.09.3CE0CA8 Received: from lgeamrelo11.lge.com (lgeamrelo12.lge.com [156.147.23.52]) by imf13.hostedemail.com (Postfix) with ESMTP id 89B7F20007 for ; Mon, 9 Jan 2023 03:33:55 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of byungchul.park@lge.com designates 156.147.23.52 as permitted sender) smtp.mailfrom=byungchul.park@lge.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673235236; 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=GA804P9UNLAWJOBDHYm8OY1DcSyqNl6afnFRKMSW+ow=; b=3QmCESsophlviwAUALyKzkuoEByKQA63NW9eZBEoe5fCLg2FNWA32+JiYWC61Au+Gp+Svl M9c2ZNVJJCsdUKqO6Ggt47uROQ2lHOd+9YOw6Osu7Ez1PKZcCDy7B2r0PJMimqeC4hj1ZE w3u4Ha7VjgOU74pjC89N8KwHoc7SN80= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of byungchul.park@lge.com designates 156.147.23.52 as permitted sender) smtp.mailfrom=byungchul.park@lge.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673235236; a=rsa-sha256; cv=none; b=GsDjoWG830AGeQ7EcGUYNcZ/vpmY8/HzjViGXXLv7hSOn6dsO5OBM7Z3/7Rr5xmA1M1CwT J9SZ0QHBcKPTgsFaVMVF5oBfBCotJf+MNwQRSH8/Ht9Gst1a/C18wQwgej4Kizn8vry4VJ FHD2k08Bdg/jspZhvQmWr0nHiR+EXGc= Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.52 with ESMTP; 9 Jan 2023 12:33:54 +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; 9 Jan 2023 12:33:54 +0900 X-Original-SENDERIP: 10.177.244.38 X-Original-MAILFROM: byungchul.park@lge.com From: Byungchul Park To: linux-kernel@vger.kernel.org Cc: 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, paolo.valente@linaro.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 Subject: [PATCH RFC v7 19/23] dept: Apply timeout consideration to swait Date: Mon, 9 Jan 2023 12:33:47 +0900 Message-Id: <1673235231-30302-20-git-send-email-byungchul.park@lge.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1673235231-30302-1-git-send-email-byungchul.park@lge.com> References: <1673235231-30302-1-git-send-email-byungchul.park@lge.com> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 89B7F20007 X-Stat-Signature: zdyq74po9i5z1iusnxoxey557fhcsuqy X-HE-Tag: 1673235235-439710 X-HE-Meta: U2FsdGVkX18J1d/dJrWJ1EyeuUIq6iuKfX3liy1I8PGMj4hPFKy2RlzqMQYwPGsy5GgbpjWzWtahLLDptV1KNKQ7lYtS505LFJcIR5vV+uXxCDg/JDm8S1OO14p6vwJ7ITnkq5w27blLKqFPwiLhGWEMcrk8Qd2DmDgXlwfdH0TGZYTu3rt3ygoGKOh4UWLcyqHNea5e/f/XXk7SnEfz323JkUp+fJkZxKUFlc8IdgWwrLYNeHaI9tlwyye4Yg30yeqKeTv9Z6MYdhg3dDTE7/WHCWve6F9sPkqmZlEc9Aqo0zbJNr2o5vSdlqeQO3aGpxqvZTbosFs6hoytuAAMdX4Yk0uT5rt6JGhK8VIxfarGGWJYEsdY1DFXQROSaFsrjX7d9phyMuJgLDc24/v327YGFaNUtESvTsUC7oqFC1XYWhGdJ3LngeNxRC+dXssnVpLCFO8Dxl/+W8cF/Kr8TGduIAs/gx4a9HZV+LgnqnMjHomftRac76SIooDM7V7chaGriyMcU8NHyqJvDWsykWy7SbP8rq6Z9+YyQSyp4i6M/ooZrO73WP3cY5X/b/DV2caFJmdfAMYvQBVfijLds8kMio9ME8iZ8U12z4nAaN8sPnEJVmhJxeNhZPxzBYFHyBhyXB1cLEupG7HlQsl7kcEqh3zkrvBR9IVZdROc5043O6Rx/7Cb+yPXaLkYeAAuX/6guaK3CYS3OK0Yk9W69+MWEQerfpMTKcfbgVaUXO+4fb9v9xJdMxEf0SSLVagC0aAN7zTr9eVmOVvj6OGg91GnBx6P2A9ntUnqSmwBc69tAwIRzbF6aVpKW8tyWOSLvJp7PggFxiIj0KIg76U8LQ== 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 swait, assuming an input 'ret' in ___swait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/swait.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/swait.h b/include/linux/swait.h index 1304209..339e5f2 100644 --- a/include/linux/swait.h +++ b/include/linux/swait.h @@ -162,7 +162,10 @@ static inline bool swq_has_sleeper(struct swait_queue_head *wq) struct swait_queue __wait; \ long __ret = ret; \ \ - sdt_might_sleep_weak(NULL); \ + if (!__ret || __ret == MAX_SCHEDULE_TIMEOUT) \ + sdt_might_sleep_weak(NULL); \ + else \ + sdt_might_sleep_weak_timeout(NULL); \ INIT_LIST_HEAD(&__wait.task_list); \ for (;;) { \ long __int = prepare_to_swait_event(&wq, &__wait, state);\