Message ID | 20240124115938.80132-23-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 8DA51C47DDF for <linux-mm@archiver.kernel.org>; Wed, 24 Jan 2024 12:01:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BE108D000F; Wed, 24 Jan 2024 07:00:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 641F88D0007; Wed, 24 Jan 2024 07:00:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B57D8D000F; Wed, 24 Jan 2024 07:00:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2508F8D0007 for <linux-mm@kvack.org>; Wed, 24 Jan 2024 07:00:11 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 05D8916038C for <linux-mm@kvack.org>; Wed, 24 Jan 2024 12:00:11 +0000 (UTC) X-FDA: 81714061422.09.9CE3794 Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by imf30.hostedemail.com (Postfix) with ESMTP id 26B598001E for <linux-mm@kvack.org>; Wed, 24 Jan 2024 12:00:08 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.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=1706097609; 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=BFhoBMbkm4fdpwbPCyHPgkLbc5d+gjfBeXoXgdor0OY=; b=WRN59q+qgUQTfCb6kIx5nfu3k48YYJg7CsWMCcrb0fdhReaVTa31KxyMihNvVHmgYa++W+ RApXHV0R18wZAnajhGuFh/YAkpWuDgvSd9Hksvh9x0s13KcL8HCe1mPOcRUgHievB3D20F h4xv0RK7SUceat+8I8XtWSlLrLyS9Pw= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.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=1706097609; a=rsa-sha256; cv=none; b=TVEn3WGckY7AybUP4Ngai7LPdwMYoC3Jzd6xkhxe1P+vRStx9S9UC7nM+Folv8JiCyzoQD 5Vb9+W9SdMerXvgqyj+Z3lp6XPBWz+s2KbJv1NgGOE3N0LN15MBVs+rv/nPAOfDXiJc0/h m9dohE2NjK7bwX3zGNL1NNZQRPK6ZMs= X-AuditID: a67dfc5b-d85ff70000001748-a5-65b0fbb74714 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: [PATCH v11 22/26] dept: Record the latest one out of consecutive waits of the same class Date: Wed, 24 Jan 2024 20:59:33 +0900 Message-Id: <20240124115938.80132-23-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240124115938.80132-1-byungchul@sk.com> References: <20240124115938.80132-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSe0yTZxSHfd/v2mrdl47oK25xaUK2weSyiR51UWN0fiY6tkwTcTHawReo FDAFQUxIEIoybgKxFhQJoqm1oGDBiBYYg3DTcNkgiqwwrERt5JZi0QKyAcZ/Tp6c3/k9fx2e UtoYb14TEy/pYtRaFSun5WMrytbfm62SAsdTgyE/OxDcbzJoKK6sYKHndjmCipozGJwte+DJ 9CiC2c5uCoyGHgRXnw1SUNM6hKDenMpC78hK6HNPsNBhyGIh7VolC3+9nsNgv1iAody6Hx7l lWFo9Lykwehk4bIxDS+MVxg8JgsHphQfcJgvcTD3LAg6hh4zUD/gB0Uldhbq6jtoaK11YOh9 UMzCUMV/DDxqbaehJz+HgVvjZSy8njZRYHJPcPB3YymGKv2C6OzUPANtOY0Yzl6/g6HvqQ1B Q8YwBmvFYxaa3aMYqq0GCmZutCBw5I5xkJ7t4eDymVwEWekXaeh+38aA3h4Ms++K2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GZT0G1q+vELTdHMXA UPOZgk7nFAZGgwaH30/eIrDn/qAh/fYiDY9SchFkpxcSYFnpJkFtC4alhSLqYAjfOTWD82pj Im+aLyX49+Uc/+LhEM2r2wZpvtQQzxurfPmKVgfGl/1ykrxBf4viDb8KaD7rhxXjp3t6aP7d /SWCH7dqsWPbTov2hwvR8gRBsefAOVGEpXGWvORwVeXax1Ey6nbJQi4MxwZxzZWrxDpT7C5u YGARX2cPdgdnzPlGZiERg7OZrlzVz4/UeuDOyri50RJynQnWh7PPft14FrP7uGJNKvlPup2r rmvfELms7Z89GNy4kbDB3Kg+j76DRKVokx55yGMTYmTy6GB/ZVREUqxc5X8hLsaA1kqju76c 34Lm+kM7EMsg6WbxQX2tICFlCcqkmA7EMbjUQzzg+VyQiMNlSVcFRdxZRXy0oOxAWxlCukV8 +KRwTsJelF0RogThkqD4n2KMi1cyKgr0Nt9LpiMuj72/H7WZubHz+ONDJZGWEXpB0xDmmsoO iNRu9VbjqdBrm+J8t9i8A0Ysx576z7gPZTZVWE6f+PLkza3itsjvBY0TvvGOkTRpXWPf3iB5 il/6PpuyMKQir0cv3J3Xvm4ISjjjSYU1qVTh51ULOMuZwqKycxJXzFJCGSEL9MUVStlfR33r vzADAAA= X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 26B598001E X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: e17qzjogs3zoazm3wzc88i9n38oeswxc X-HE-Tag: 1706097608-733130 X-HE-Meta: U2FsdGVkX1/w+4zp4RjHISKgLv6PhXlJbf0ehpsHnU+oQLLtRu2vufc6+5ZQR3AzsfFE5ElLFC6aDwz7dnPuTtdwxFoSJFKEJbfDzSnRY+6P1lFBowe3WnNXZPzWEkLwNsJUkgVGHoTZ/McXYWFMfClStXFazoC/dBxlw5GQwACMhH0uyZ6s5N9jlH9KOj++wyPUdllI9x6u4za9Bd+EFF5+2pj7/J6UgCZEe70lYJcOZVxn2SFQx7n5uIX2FqoZe8IpECJ6c/7+gZREm3RrmlBedQcY9Nn+/mjj3SdWuqOxxIU/F0wgmyCitSqs1yvW7yhFJ+NnSRkiavjmWrRk3MvKaPdd/vDrdJbnjn3Q+WxSRJjLTLwcIhBMD+lbmIBG7UhlXZOTVWba0IBbjC2DvgG4TffT9eFMLoHj0S/V1bOk2CdmzJlwNEuNip5rOpN57085WnUMQ8d4geDHXGgXYi0v7qoF0uToHi5h/7dZlAlwAVI+Cq3vhTpTKEy3fR7nhCekkc439B11OPmj4Ukct3RjtwY/GrDFnNp5H5+laDlG/cPbafgLlrC8CiP/J3UdY06n2ooOH8a6dIWntw+fPBO7xHaMVzqsLde0BQo4NEWkTBhYqRqv4UvoeC/gniuqFj1XojWnv1BJtv2fvLpSDNUTHPO05S6ui3Q5lVpSW/d7l/PSzsnW1RrvfuaWcK/MD+2lblwWD+DgsfmCke4pSPbzhOOnBgPPD+8x9Ys1qKRURvzjPd0NLdac9WM/B5Y4dpWfeF2MlVw0YrYEkH66XFzXNcXd9gEwnXKXKlDlxESGcljQNpXxK5McFirGW/gboCHkl6N317onhgpPgmLJRj1W1LpZSsmC8EQRwAPlhxnQtMs6YLiAYX9i5BoGfKLY71tqfoWhbB0AU0LINi/tq2biVRkP5cD57Sl3mJ7m4HoP8yvhh2QrMiU4zYGnLZbUP3xJ8Hc5hzmCd6NOo6+ IVqRvPa6 wXeKMUS8829CxpOmGGF9IkrNZ6+RmwdipG9yTcOWzEkGsCghIkME+EiXdzrz+/ShinG49dr7jmQjCmANQc9MLomeZvyk8sBF3Dkve 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> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
DEPT(Dependency Tracker)
|
expand
|
diff --git a/kernel/dependency/dept.c b/kernel/dependency/dept.c index 1b8fa9f69d73..5c996f11abd5 100644 --- a/kernel/dependency/dept.c +++ b/kernel/dependency/dept.c @@ -1521,9 +1521,28 @@ static struct dept_wait_hist *new_hist(void) return wh; } +static 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(-)