Message ID | 20230821034637.34630-24-byungchul@sk.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 3134CEE4996 for <linux-mm@archiver.kernel.org>; Mon, 21 Aug 2023 03:50:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5A64F940019; Sun, 20 Aug 2023 23:50:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5325694000C; Sun, 20 Aug 2023 23:50:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 35D5D940019; Sun, 20 Aug 2023 23:50:03 -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 2112794000C for <linux-mm@kvack.org>; Sun, 20 Aug 2023 23:50:03 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EF260140222 for <linux-mm@kvack.org>; Mon, 21 Aug 2023 03:50:02 +0000 (UTC) X-FDA: 81146733444.20.657E9FA Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf03.hostedemail.com (Postfix) with ESMTP id 1199A2000B for <linux-mm@kvack.org>; Mon, 21 Aug 2023 03:50:00 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf03.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=1692589801; 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=7VSmtydfVXVr/jsL1vG1bxg8h8ezelWaDitAIzEFS3w=; b=fASraJ/rmzJb/8YnTR+8a6iD2w7n4fNg7astzaUg3rmJUAufFku1Kx4TJYiHzEFDxb/b1W h3vyrCWY0g5KOvStzkWZ5XFtazeZ9qPv9N49YkqJUqlE1h+oHIpegz0w/OZaBnB/SqpOjb 20vrPZRMAwRCLPNh3l2fsQGkOn0vNMc= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf03.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=1692589801; a=rsa-sha256; cv=none; b=r3pFj30ju2mXxp7fQSvu64MFetq+78dAcVMHZ5PuEK1hAFFLQ8ZkrAjcTHbEvhjfJmkznU swmvpJOvNOKIkvARO2xtyEMwWC68MDAuflyL1q7fXv35+3nPedCmyOOFWbp9VKoBn9C1sy 1KWK0t7Ta2uc/5z807eJMBJYd+LC3EM= X-AuditID: a67dfc5b-d6dff70000001748-5b-64e2ded78431 From: Byungchul Park <byungchul@sk.com> 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: [RESEND PATCH v10 23/25] dept: Record the latest one out of consecutive waits of the same class Date: Mon, 21 Aug 2023 12:46:35 +0900 Message-Id: <20230821034637.34630-24-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230821034637.34630-1-byungchul@sk.com> References: <20230821034637.34630-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSW0xTWRSG3fvsc2mx5qRD4lGMaBOjkYwK8bJi1Phg4vGuOIlRH7ShZ4aO BU0rWDRGkAKKYNSkFBW1gFMbKIIHH+TWdGoA6wWqNIgEiVSjEkEEbRHBC6C+rHxZ/8qX9fBz lLqWnsnpkw9LxmStQcMoibJ/asmfT7uDuiUVF6PhfN4SCH06RaCo0sWA/2Y5AtftDAy9jevh abgPweijVgpsVj+C4p7nFNxu6kbQ4DzJQNuraRAIDTDgs55hILO0koHH78YwdBVcwFAub4EH 50oweEbeELD1MnDZlonHx1sMI44yFhzp8yDovMTCWE8s+LrbaWjojIGLV7sYqG/wEWi6E8TQ VlvEQLfrOw0Pmu4R8J/Pp6HifQkD78IOChyhARaeeOwYqizjouyP32hozvdgyL5+C0PgWR0C 96kXGGRXOwN3Q30YqmUrBV9uNCIInu1nIStvhIXLGWcRnMkqIND6tZkGS9cyGP1cxKxdKd7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qupbtpyL1yE8GNa9kEdM41k6Dtl8HMTz21K4hvGJ/Eea3l Al/jMhB8az7Hv7g3QPPa2j6aN5hjeUuRH19QPYrxeVNOkjcXp1K8eSqT5tMm7Bj/paOD5lvu zBD8B3sOdtg7TLRdIUQp4wT1pp3hoshP+jvkuR9L43XdtUQisnmkIQ+GY7dwKYWt+AJT7Hru zRv3InuyaziL7hOZhkQMzqYs5Yq+tlMLxQo2kktNz0ILTLC+nCP7J5GGGEbMbuVKCzb9c/pw pvK6RY/HfGyuqlycS1gZ921omLiFRAa0pBh5KlVx0XJllGyj5mxkgkoZv/F0TLQZzf+M8fJs RgWatgXXI5ZB0mXicG+HQkLK4zQJ0fWIY3Cpp3j1jyGFRKyQJ1wU1DGn1LFRgqYerWYI6Srx vlAhXMKekZ8XzgrCOUH9v8UYD69ERBypro1Y2dDh23rQuUob9vaRe1KWvWxHsc/tgKCqE9Ou d9u9XnV1RFhOPpSlhATUV4zu37UvMXMtld6413DGVukX3+nfclxZ3n5Ml/lUmWyd89k/dbz0 6Lbgj4/3huwsG5sLs1xac1o1HPFyZCYld/dESOrlUPu6Q6zLew89sq35uUlKaCLlgX64WiP/ C5lDZM0vAwAA X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 1199A2000B X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: dofuak3fue4o9rdnnrwoz3wb3io1ko1z X-HE-Tag: 1692589800-762725 X-HE-Meta: U2FsdGVkX18h1EwPyWa/cxNJRehvTF4Q729+URgJl9yIEg2oolmTB5UxdQBsuBJCrX90iwOq9XRgTw1nPs+Luy4BXGNXpmzGVviIeEq4HKTCZVWi2jYOpkGHBDtFAy/VL8xMMwIH5ebkdSBXY3tL532SZXOp2vjMVA4REJgpHZTqCwJ0LMWPLOpqUb9lVg2DP5yt9+BB3DmZwKYHSn9T89ffgJVyAPIFegQnKX9j5xvKJbsEnfXOaCpIBr784KI0RBfQL4jbc9+/VfooQv7X+XTdE//EgaH1aYIh9+e2B+hQ8N7hSBlWlN8K0ZsKiPZF3rq/a/fnuWrQFbPkPTI3Pq99aKrwhE5Pep+UpK+RLbGl2xyE+K10FxJlEu6uxp4DZDFneeGtbRzb+fMn1JVH8svMlzuRBWy5pMdniCAgcGVxmNuUhoxDRdtDw1DmM6SBhfQoqXyTyWA8HUMtxqJpEuOFOg0EDtE8vn1CATr6rPr7EOPu476zO7939grCY9rrXQoIFCB+sEMpycby93TgDzUc+HXEw9hgkZ9c/Kc5aq491aOiJFSnh3tTy5OjJ0P+IfI4YgnWPtI/z/q7MOuvLEugztcvD6FF/7Pk2OAvtpnBn0JpIH6g9azQKCgMmVu3oyIjU370bcRu82dwGmjFQXgiVVBsn8JHkBxagGGmUDBMnOe1ycaxsN83vLq7u0YCeLkmrihpd6wlxy33KLHrjOGYPTrO9rbLKIja1QHAuPHFIHFVuzJCh6J5euj9lgzjLss3tUB3zF4iCBXXr7iDsRNkgkaf8XqiqbG/tiV1BtRsj5w1bH0fJJGm0lrp08OzpqtMRcXvg5L5kTG28vRo5u23RIGFlh51/+P+V1EuDsmJbA6goaWoXHGsBKPYNBL4DTZTUjYHjY+QlGHZQ58jP7JcMNl7Y1lSGOl31FIuxjP0jLZs/y+9Hy4vAaqDvkTgMSqtcLF9lLNimoocdX1 X/X/+eEP +Or5FVamiBOwWvmyJUi+mQ+VYypphYs08r2DgftW65H6x5DogSyPb34E78Fc/wXXJ7P5NuoAXPb+Hh9jFJy8vyMJioyPHw84TmjtV2VDGdivav57f91JAAlSa8fC25aQPsg9Y 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 52537c099b68..cdfda4acff58 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 <byungchul@sk.com> --- kernel/dependency/dept.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)