Message ID | 20230626115700.13873-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 77439EB64D7 for <linux-mm@archiver.kernel.org>; Mon, 26 Jun 2023 11:59:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87BB68E000E; Mon, 26 Jun 2023 07:58:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 805BC8E0006; Mon, 26 Jun 2023 07:58:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5940D8E000E; Mon, 26 Jun 2023 07:58:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 393128E0006 for <linux-mm@kvack.org>; Mon, 26 Jun 2023 07:58:58 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1174A1206A8 for <linux-mm@kvack.org>; Mon, 26 Jun 2023 11:58:58 +0000 (UTC) X-FDA: 80944752756.20.A4F0BAB Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by imf12.hostedemail.com (Postfix) with ESMTP id 17BD340021 for <linux-mm@kvack.org>; Mon, 26 Jun 2023 11:58:55 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687780736; 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=gox5NpBP0WU7s8HKerotsvGnlXdqlqnN/w4Zw8DPVuU9cSiBqck2U4I3NaomM88iUzkRxX dvj/uhwenHt+HJHqUmo1kIYnNQvw8c5cJIpbTzZQ2oYDTEDOQ3JZBzzdUP0L4PedU0UyKM mWPFs1npKfJR/6TObxkL5ZzptBcuo+8= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687780736; a=rsa-sha256; cv=none; b=Pc2AZ35cDevr0UtzF8Gb+/xqLHnYcNhqyGgbKMsrFZE3yTlMI30bA/L04yxjuPFXWkvsyG erRTZfbMyZ7XUztHgg0wBuBeWfoBx1fIE0pG8NOTIPgwqQpW2MynUS3/pNB/jl1WkzgICV dFtHOQr1C2GdllNGQaHdIF8b+c5r0NA= X-AuditID: a67dfc5b-d85ff70000001748-17-64997d6e5ce2 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, 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, her0gyugyu@gmail.com Subject: [PATCH v10 23/25] dept: Record the latest one out of consecutive waits of the same class Date: Mon, 26 Jun 2023 20:56:58 +0900 Message-Id: <20230626115700.13873-24-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230626115700.13873-1-byungchul@sk.com> References: <20230626115700.13873-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSa0hTYRjHe8/lPWfLyWHdThcqBhEVlXZ9oIj8EL0QURBR2Ie22kFXOmuW aRRYWth0lpJOTcpLLfGSNosuOllWpmWlqdNiWdnFtKlhznRbly3py8OP//95fp8enlbWsbN4 nf6IZNBrolRYzsgHggqX6k/makOqXDMgIy0E3CMpDORXlmNouVGGoPzWKQr6Hm+GzlEXAu/z lzSYs1oQFH54S8Othm4EtpLTGNo+BUO7ewhDU1YqhqTiSgyt33wUOLMzKSizboVnF4oosI/3 MmDuw3DJnET5x1cKxi2lHFgSF0BPSR4Hvg+h0NTtYMH2ZgnkXnZiqLU1MdBwt4eCtvv5GLrL /7DwrKGRgZYMEwsVg0UYvo1aaLC4hzh4ZS+goCrZL+r32Sg4++M3C09Mdj9dvUlB++saBHUp 7ymwljswPHS7KKi2ZtHguf4YQU/6AAdn0sY5uHQqHUHqmW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xjovXbqJwfmiGkFt xhsMtooOGuo9fRiqbLkEDF95gKA76wsD6aeGGDiXkoXgZHoeCU9+NVKQ5gqDkZ/F9Mpwob7P TQhpVfsE+6CJFB6aeeFO0StGSKt9yQgm216hqixQKK3pxULJgIcSbOWZtGAbOMMIhi9OLLg6 amihv7WVEZoKRsgNM7ZIw1VinDpJ1C5aHiWN+VBcQO3+MX6/8WktqUftEgOSsDy3mO8ZNmAf 09x8vrNziPCxPxfAVxk/UAYkZQmudDzf03SfMSCWncQp+bPuBN8Pyc3lK0s7kK+WcUt417VV /5SzeGtl3V+NxFtXPzIjH8u5MP6Yy0FnI6kJjStH/ur4JI1SHRcWrIuNSY5X7w/ekaCxIe9u LIdHc26j7+2RDsSxSDFBFjKzQCWnlEm6ZI0D8Syh8JdN/pmvkstUyuQDojZhu3ZvnKhzoOks qZgiW7tZjJJz0cpEMVYUd4va/1fMSqbpUezl00GujfMCLm1fmtsTYNfPOc7fjFrgrJfUpLQE XwkcHjP5rdjkMK+bmKhfvbMxepdk/td3+MhU/fCqkg3ZR4x7Ln4svKoJjzm0JvFgbeTsQEV/ Z9bR68Gh807cu+O6GzGhwW1C2yLSX2/J3GolWvdt6l5kUY85Dffzipb/sE40TJmqIHUxytBA QqtT/gH3/dofMwMAAA== X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 17BD340021 X-Rspam-User: X-Stat-Signature: meqnofps9n4jm1fkgc894s153hiqd47a X-Rspamd-Server: rspam01 X-HE-Tag: 1687780735-581135 X-HE-Meta: U2FsdGVkX1/JJ2bAPMwSWDskJafYBRoBv//glPOrc87mDby+9EyWNDjFTp73RiQJL2tE3OdiGU4zsINWMpRk1mR8NlvIJdu53ZfmUk6iOKxuflWQ49oFr4c7focXs1iOJNHMqDSlPIFTGpOIAJcrFO9Hyf1WF+pwOQJsComtB4N9IzvRLJCFI5nSlexnPgrdRLAa7UNW05gmC+QkwN5X1Z79nVuA3p88Pwk56dgiX6IJMb0pPyN+HRTTzBo3V1t2B6nEgUvWX/8SWdKAgEf6NFeX+Y8SHVneYfx/MdeFlTOlXTiosq4IZYTTKSzWWeJFN6Gb7hrFHw4QWSGBdsE3fGR+ZIYiIp1kDViJJTNUvlcrD1Dg+pHldYOWdVP4PuZbEHnTXrMwlWPW7j+2+KcoZ4d6VAlBBvHQWXY1YC4OkLJ/JUINd85aR8e2AqgdS/FglIygw2K1l0Dgh2Og2fIsPdvk6Rxhkf7taiq5/KkZsn4mJ8BUALsZWeGk0jl4Ar6ka4nhTFBOWhhwX6taPuOfxy/SCSgW1wcjPSk4SbKOrgMa77Tbbow9QH/CZbO+GgOq0BFVTmj4dyw8DkZpQdbwN5d/wgwkyY0OqMjkcE+C6AM2FAmcOtXfXSwLo6ycqPLSRjs6UlQ0RxSoYG3lT81nsHl74ciT24pRKNSW0HmtGbWAiUShyflGMOplhUTx4fPH6ScfceJo8C6bTXu81F10GMuPETxSD+L7GMnGyWbeqoif8AnQedKw35jQU4ZqrVCAOZYyMipC3pZNihaD8j35qbjFjH6+jIUwyg3A0rLqsa9WHoqkuzShL9ptXX/WUIt65cqfBl57EGs3L2sM98K6F/mOfWfNEsVTDpgj8RBovn4zWW2O4pT2IPIS4hEpHT62e9Y1KDJJE+lv602NzJ13ABt8WmHgo9TGt6LiANofwcr9OgjpuYvs63YcTg3jKQKtbTFAt5vQ2+gL9vnke0A Gep3U0W4 BU59c6MGCYfZ9mw83Cu0+rOn2UXNyYVCEHaTlO7ksepWlGu9xijSEpA/gz2FuC0/rHX9MDYAe/99eGkgraSvUcmI40QWtFYCdnboTiNz+KcG6I8RtrTGYcbMfU8kNEU1oeKwP 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(-)