From mboxrd@z Thu Jan 1 00:00:00 1970 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 1F88EC5479D for ; Mon, 9 Jan 2023 11:37:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 487188E0003; Mon, 9 Jan 2023 06:37:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 435B98E0001; Mon, 9 Jan 2023 06:37:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 325CD8E0003; Mon, 9 Jan 2023 06:37:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 252E78E0001 for ; Mon, 9 Jan 2023 06:37:39 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D08F0C06D0 for ; Mon, 9 Jan 2023 11:37:38 +0000 (UTC) X-FDA: 80335060596.29.A6D653F Received: from r3-19.sinamail.sina.com.cn (r3-19.sinamail.sina.com.cn [202.108.3.19]) by imf21.hostedemail.com (Postfix) with ESMTP id 5DDFD1C0018 for ; Mon, 9 Jan 2023 11:37:33 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.19 as permitted sender) smtp.mailfrom=hdanton@sina.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673264257; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=31kKGWGiWKQ2ODuckCAybm0mdK2cCuqfoWsGh2HhdZU=; b=MyKe1f/wVPYBH3Caj7vxKp8KliXhn0LJ9HBR2C619oRoMrNhCdFeNBqDZ7MYil1uN9e4py UvZE8N8Y/bDH3pNkX15bHIciflXxLbRfUZmG8C2kgZmN12BdIeVsb/pKpvjmdM4EPFrxv7 E61NGbmUzHb0P6mdUEInE9yLoidQyhw= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.19 as permitted sender) smtp.mailfrom=hdanton@sina.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673264257; a=rsa-sha256; cv=none; b=YWbt8MvkTay0EYnZZ3h93Zj8Ht91syM0WisKfpBHiIG64S8rKvGtgQyQ/4VIjGqxgNMzU3 hYqe4oeKuDfijU950yjQoZ71weSa7yJqIhfiaxsZKONgmvhIks/3vNps6TXeqoAD7MrMcj NIedPh5kwRsH/YNkQk0UmHKgEGTnAqM= Received: from unknown (HELO localhost.localdomain)([114.249.57.238]) by sina.com (172.16.97.35) with ESMTP id 63BBFBB00001B534; Mon, 9 Jan 2023 19:34:09 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 71135215075338 From: Hillf Danton To: Byungchul Park Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Waiman Long , Tetsuo Handa Subject: Re: [PATCH RFC v7 08/23] dept: Apply sdt_might_sleep_strong() to PG_{locked,writeback} wait Date: Mon, 9 Jan 2023 19:37:20 +0800 Message-Id: <20230109113720.221-1-hdanton@sina.com> In-Reply-To: <1673235231-30302-9-git-send-email-byungchul.park@lge.com> References: <1673235231-30302-1-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DDFD1C0018 X-Stat-Signature: 9a1y3stzzgn7x9xmu8p7wp9rqpwb5td5 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673264253-738948 X-HE-Meta: U2FsdGVkX1+nfeNDtIcFn8h+/JZdOk33npoRGNY6JP1o+GMwShRnrikf3NKDy/F3nJ8e0haHbYa4fxBl7wrRXGBzOEL7CaAVe/Oa7L9IRCC7rdpHm5qpaEqDrPzeC4Jc2Bz6bKI0ckW9E3udj2PcjMOe3GLkZ46GjbzqrnVubWqVglZCRdWCzi6YU2rE5FUBrtes28zxZRlDKXeSPzzdGhQcxA8jCH2PnHDkQWV2Mt2Q3oYp9TxFo1drPPpoC/BlK3GaRJf8RX1caPvAKNBk42q0GumvReEEjo7dsSK7wi2Rq5WepLauUNdV1cG11+lNOU5yAWmQXCWyqrgl+sMV5PVxR7YURc/h9bW8RGYMF1ejK6zmySOgpp1FYmvFPQ36foR/lihi8CfJENdO1zIIybz3+ZkA6lJV7o+zWExAnlUneGZez5BuidnxJgL/uQTASGsAsEnPmZQV1OFbitHDYVypcStyCcYeP0IEfl38fDk1re6Lo2REX1pBZeb3r/edZ3LYQYJHkIOqfKJV91mwM0NF9OBhBgunql7VvNqO26/b4J5i5yr8BbmIWagP1VrYksqwZN/kW9xCP1TpymMuxNv872/mr70hVxVyDswnbmQ8uEB8IM8FXu+gtpnVwEHeI17oyMxKcIQLbhHGBDxvqS6RzDDEduyY5kxkwxmjh9sTvlHtANP4TiAaI0bq1OEo1m3edq/cn8ssmx8iNmO6MbPX+AEjjfbZG6cRmNUa5bA8J7VI93f6WZie8DbPNy5OMXun60rUEA53eIRqzc480zonWQD3i+sgt06Z4OJyr8Uuo8UYfPe/VoG22Mysd6sNl3Bt4KzStADlxT6zy+QftQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9 Jan 2023 12:33:36 +0900 Byungchul Park > Makes Dept able to track dependencies by PG_{locked,writeback} waits. > > Signed-off-by: Byungchul Park > --- Hey Byungchul Is DEPT able to get deadlock reported for the syzbot report [1]? Hillf [1] https://lore.kernel.org/lkml/6383cde5-cf4b-facf-6e07-1378a485657d@I-love.SAKURA.ne.jp/ > mm/filemap.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/mm/filemap.c b/mm/filemap.c > index c4d4ace..b013a5b 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include > #include > #include > #include "internal.h" > @@ -1215,6 +1216,9 @@ static inline bool folio_trylock_flag(struct folio *folio, int bit_nr, > /* How many times do we accept lock stealing from under a waiter? */ > int sysctl_page_lock_unfairness = 5; > > +static struct dept_map __maybe_unused PG_locked_map = DEPT_MAP_INITIALIZER(PG_locked_map, NULL); > +static struct dept_map __maybe_unused PG_writeback_map = DEPT_MAP_INITIALIZER(PG_writeback_map, NULL); > + > static inline int folio_wait_bit_common(struct folio *folio, int bit_nr, > int state, enum behavior behavior) > { > @@ -1226,6 +1230,11 @@ static inline int folio_wait_bit_common(struct folio *folio, int bit_nr, > unsigned long pflags; > bool in_thrashing; > > + if (bit_nr == PG_locked) > + sdt_might_sleep_strong(&PG_locked_map); > + else if (bit_nr == PG_writeback) > + sdt_might_sleep_strong(&PG_writeback_map); > + > if (bit_nr == PG_locked && > !folio_test_uptodate(folio) && folio_test_workingset(folio)) { > delayacct_thrashing_start(&in_thrashing); > @@ -1327,6 +1336,8 @@ static inline int folio_wait_bit_common(struct folio *folio, int bit_nr, > */ > finish_wait(q, wait); > > + sdt_might_sleep_finish(); > + > if (thrashing) { > delayacct_thrashing_end(&in_thrashing); > psi_memstall_leave(&pflags); > -- > 1.9.1