From patchwork Mon Jan 9 03:33:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13092901 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 CE49AC54EBD for ; Mon, 9 Jan 2023 03:34:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 43EF390000B; Sun, 8 Jan 2023 22:34:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DCBE78E0008; 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 55130900009; Sun, 8 Jan 2023 22:34:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DEB058E000A for ; Sun, 8 Jan 2023 22:33:57 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B74C31401DC for ; Mon, 9 Jan 2023 03:33:57 +0000 (UTC) X-FDA: 80333841714.05.7451363 Received: from lgeamrelo11.lge.com (lgeamrelo12.lge.com [156.147.23.52]) by imf04.hostedemail.com (Postfix) with ESMTP id A74B44000A for ; Mon, 9 Jan 2023 03:33:55 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.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=Kk6WsaMe5oeoEuoSKbxOkBl3nHmhvS8UyaA2IaKRScc=; b=XPDP1tbjyhDveuQCrEbNfKrcEqYAXAu1vjDJGE7r3qKsAczvQh0k7F7ODWNRlZY9BCrQzM IVK0u1hiRH9o54fM/G/mIT2xgnvD39wPDw6MjzdNsIbbgu7GJpV+V0fK1+ZM8WL0H7pQx5 phctn4p9zkoLTdODBilJyFnObAF7k3M= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.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=uDh7azF7lK5YWUCOrY9alI/4VbtqHe+yUtR+BAQhWVRD5nZ1/KocUzjiRiCMBnSMARAOnQ c5jwmiCV3cQOnh2tNrbejBec7mJP2sDUH9JzslJl2sY6DIVIJ/iIr7EHzMnyRYhFNO4b2P uim7BO3DVNvHDU3BYEIfkrRwSbfzQd4= 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 20/23] dept: Apply timeout consideration to waitqueue wait Date: Mon, 9 Jan 2023 12:33:48 +0900 Message-Id: <1673235231-30302-21-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-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A74B44000A X-Rspam-User: X-Stat-Signature: c4nxn7ubxye4rz19b43reohxfs3na79e X-HE-Tag: 1673235235-92022 X-HE-Meta: U2FsdGVkX194m7j4qhBxpI6a1FNTPnHh0A0zDzYzqN5rZpabtMILM3XOax/DyLNVEUZPIbCqBaaCrWt/OYv4OHbzY9HZRuqDxwAMSMuvZuC5TS1be2ydcHOAOreWLBswNHXa8Tz3SjU/gWYL/p6j4EmY3vQSN4Ms0nq+xsNZHOMzfa5d09TFLXSY+26izw8xSHswwYxES6f38hC0C4LhfalPCEtwZyEOVNOgjdftFErGMPEdsjpVmfjfMgsowmaqOpYX9V28EgI/dD+PZO0Dmwg6l7+LJualDu3Ny3vWeuS6yJLI07SQoaTgXwtAcb3jUNFxEDrd5bF/UHlkt5hTWukhUpDbqhtIBVNmI/eJkviKnCB1OHWsnFkayWm98Ps6ukgmiXl1YVZsdnPsZqcDTv1u26bh6m37Jk0O0S6rNxw5d0o1MbhBcxNI+652twLLqDu9+dEJw0d/IThx3Hd4i9zLO1kCUHm8Rl6R/q309fRJ3gsI/jME+qaCRyeor8wTZjYJ399ZbBqM/KpQL+7UcwNvxONbqd+6yi8WVP+2P0oXdif87xQNzsegvQyBBejpA0JshCmSEnoAKja0XHSCOZ6qhmJeUe10vz0TUt/GB8fzQx39Ede2BMp5LG+6AyY7fp4qPHZYafTuaBoGCfhf1Ee+w5GsLsiXFDogFiemNi9N+chNLRTC+BDfAZ3zCZyK3B8/JjTDsOj4tHFFt80dVO0f26mLlIDhZiXEYr8Dy600GxI90dkriTM+gYsiB6mTIEKuVHJ7t2VDjujmdRIAqY95oWGDOanZ8JtRRfFXvYOfwYOHdRYL6yypV+iaJ3yKp2yjiRlvTg454K3sHB+XNw== 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 waitqueue wait, assuming an input 'ret' in ___wait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/wait.h b/include/linux/wait.h index ede466c..87888ee 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -304,7 +304,10 @@ static inline void wake_up_pollfree(struct wait_queue_head *wq_head) struct wait_queue_entry __wq_entry; \ long __ret = ret; /* explicit shadow */ \ \ - sdt_might_sleep_weak(NULL); \ + if (!__ret || __ret == MAX_SCHEDULE_TIMEOUT) \ + sdt_might_sleep_weak(NULL); \ + else \ + sdt_might_sleep_weak_timeout(NULL); \ init_wait_entry(&__wq_entry, exclusive ? WQ_FLAG_EXCLUSIVE : 0); \ for (;;) { \ long __int = prepare_to_wait_event(&wq_head, &__wq_entry, state);\