Message ID | 1675154394-25598-24-git-send-email-max.byungchul.park@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 8000AC636CD for <linux-mm@archiver.kernel.org>; Tue, 31 Jan 2023 08:40:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BDEA6B009E; Tue, 31 Jan 2023 03:40:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06BFC6B009F; Tue, 31 Jan 2023 03:40:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD92F6B00A0; Tue, 31 Jan 2023 03:40:07 -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 CB93A6B009E for <linux-mm@kvack.org>; Tue, 31 Jan 2023 03:40:07 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A5AD5AB080 for <linux-mm@kvack.org>; Tue, 31 Jan 2023 08:40:07 +0000 (UTC) X-FDA: 80414446854.16.F997613 Received: from lgeamrelo11.lge.com (lgeamrelo11.lge.com [156.147.23.51]) by imf26.hostedemail.com (Postfix) with ESMTP id 64547140006 for <linux-mm@kvack.org>; Tue, 31 Jan 2023 08:40:05 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (imf26.hostedemail.com: 156.147.23.51 is neither permitted nor denied by domain of max.byungchul.park@gmail.com) smtp.mailfrom=max.byungchul.park@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675154406; 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=FNqlUmZTp0E++WFmgXno+LGpGRslaoBWEseXFWsLHaA=; b=PvECJcnWzq6oSe1rwvuREFvGt3WFaH5zcb+d4ZAwlYC8g2ZQ8pV9Pg5ovD6Gio2YgPDFVT GsliwDx0ARZE7B92f5KoODSc+ms0k6CP5b8/wz11xNKGTPGTC9fvQyib9JFw6ZGGYa6GnX 5pb5OQJKd1MyPJNx04wLfC0/OHcV4MU= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (imf26.hostedemail.com: 156.147.23.51 is neither permitted nor denied by domain of max.byungchul.park@gmail.com) smtp.mailfrom=max.byungchul.park@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675154406; a=rsa-sha256; cv=none; b=3W61fsZSflTwsvRkpf/CTZqexp3KrZzI1X/TB+K9xPDx+CQoPBhv2DnaYRC18wke1yrtpW fIG6P0i9hfc1OyCleWOZTE7UiBIWwTQWIhmzOkMWKdSHoUr82sBU7tHfskQoZQwiUd6WXG QK8QaF0/TpXXuboQ++1QpqzTOXNaR80= Received: from unknown (HELO lgeamrelo04.lge.com) (156.147.1.127) by 156.147.23.51 with ESMTP; 31 Jan 2023 17:40:02 +0900 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: max.byungchul.park@gmail.com Received: from unknown (HELO localhost.localdomain) (10.177.244.38) by 156.147.1.127 with ESMTP; 31 Jan 2023 17:40:02 +0900 X-Original-SENDERIP: 10.177.244.38 X-Original-MAILFROM: max.byungchul.park@gmail.com From: Byungchul Park <max.byungchul.park@gmail.com> 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, max.byungchul.park@gmail.com, boqun.feng@gmail.com, longman@redhat.com, hdanton@sina.com Subject: [PATCH v9 23/25] dept: Record the latest one out of consecutive waits of the same class Date: Tue, 31 Jan 2023 17:39:52 +0900 Message-Id: <1675154394-25598-24-git-send-email-max.byungchul.park@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1675154394-25598-1-git-send-email-max.byungchul.park@gmail.com> References: <1675154394-25598-1-git-send-email-max.byungchul.park@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 64547140006 X-Stat-Signature: j7qioxuh8c6cib3yf6utbrb7o5ygiwtb X-HE-Tag: 1675154405-792328 X-HE-Meta: U2FsdGVkX1+LNOd61ai+lip1xLxvKVupcSu4hobqpqIeeUIiuNPNu8O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42gtv9Ol6/h38Id029hdP9kLJmKKl1163mnj++2ZCd34j0oQjpBBTF+cdY4OBW0tSiAurBIn0PuW/sRQBIJyzmfBxi/CZgdfiyZIEPkeI73SJrEb+HWb9nCHjZAodMkQQBWZxPdkfq9hOeD7QEktkTwQZ1docoGB02oT3dMMYYSxTy1LfeeNrutArqgTRCBsOkDRiimAHzPxUBppFhQD7MMeb4VppB9a67QSjzPrzOH2sm20GY7+y6p5buM1jE6ZPJA/i52T6X5JHy4dHfq/lVMWH4f9lYmOabPSOLosaUIEKGitzhFW49Prp2cm8ydBoSXUHdKie8qx7ySiES9hMj0P971tGB3ACdWFVs= 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: <linux-mm.kvack.org> |
Series |
DEPT(Dependency Tracker)
|
expand
|
diff --git a/kernel/dependency/dept.c b/kernel/dependency/dept.c index 3ab999f..2887858 100644 --- a/kernel/dependency/dept.c +++ b/kernel/dependency/dept.c @@ -1522,9 +1522,28 @@ static inline struct dept_wait_hist *new_hist(void) return wh; } +static inline struct dept_wait_hist *last_hist(void) +{ + int pos_n = hist_pos_next(); + struct dept_wait_hist *wh_n = hist(pos_n); + + /* + * This is the first try. + */ + if (!pos_n && !wh_n->wait) + return NULL; + + return hist(pos_n + DEPT_MAX_WAIT_HIST - 1); +} + static void add_hist(struct dept_wait *w, unsigned int wg, unsigned int ctxt_id) { - struct dept_wait_hist *wh = new_hist(); + struct dept_wait_hist *wh; + + wh = last_hist(); + + if (!wh || wh->wait->class != w->class || wh->ctxt_id != ctxt_id) + wh = new_hist(); if (likely(wh->wait)) put_wait(wh->wait);
The current code records all the waits for later use to track relation between waits and events in each context. However, since the same class is handled the same way, it'd be okay to record only one on behalf of the others if they all have the same class. Even though it's the ideal to search the whole history buffer for that, since it'd cost too high, alternatively, let's keep the latest one at least when the same class'ed waits consecutively appear. Signed-off-by: Byungchul Park <max.byungchul.park@gmail.com> --- kernel/dependency/dept.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)