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 592E8C3DA49 for ; Sat, 20 Jul 2024 15:34:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD7AE6B0082; Sat, 20 Jul 2024 11:34:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A86A66B0085; Sat, 20 Jul 2024 11:34:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 975DF6B0088; Sat, 20 Jul 2024 11:34:31 -0400 (EDT) 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 779636B0082 for ; Sat, 20 Jul 2024 11:34:31 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5F3C3120D94 for ; Sat, 20 Jul 2024 15:34:30 +0000 (UTC) X-FDA: 82360527900.06.A2FF03D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 41A6880004 for ; Sat, 20 Jul 2024 15:34:26 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Ul5tdT1N; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721489635; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tYI9/wpxiwDrT9DycHs3mVuVPtxyQVCMEzDzFS2sndQ=; b=YU52e5J5l1xODcd64hosW0sPvjFiwsYh6Lx9heYjSVyYK/wXYIWb+z0rKIQKTGetMfaZ61 SBDSbOwaFnv4YpZBLjowvcNgRFQUyC9EH1JmUr3+e2kwa8x/qF21ZXw0nzBPxcpqjl4WZY d+1gUMd3cDM/w/XznNKWooKGyflzRRg= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Ul5tdT1N; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721489635; a=rsa-sha256; cv=none; b=BA0Pp1vhF+RF6xNxKYAU2Cpdgr3yGLb5Ih0duz8UWjq3w3mrnP6TiAJKuhlBcvESINLPDU 1+ok66Ksygim7dHM4CLVuMmlcYXr8B5dj828HMW3JhhRbVKRKnpe7ziplWqcRkDvv2gvtR X0+lSHhc/1UIEdkd1cm8VWCZAf+yCWg= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tYI9/wpxiwDrT9DycHs3mVuVPtxyQVCMEzDzFS2sndQ=; b=Ul5tdT1N6CNjoCAOz1btXoeQCk pgU1fUTzmeSIBabvYZleMidu2Gt1W61fc1WW42z9vp2uA3ehTaRayTQrLBYZ70Sbt68xmL8itsIOb yrDeAsjaCtxoaJ+n8bliLn7jWk/GhTn+oOeOJKitBtnfsTy72R3UEUui68kuzy43D9aXe7GqTjUcd ss/Pjtn06qKdcahoq2fzp3RWV7te5Ne8kUX8ENSy8XFzAz8tQItmbaKqEH10dkKohr1U9KiCB40fj dqHfNne2xmb71KA1gXaW+vFOaYTkoh7YlVscrO0kKPtCRsCLTz2pOfqcGp1Z7OBp3e7nUnFUFD41L xAbyX5Qw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVC6H-000000045al-1AVs; Sat, 20 Jul 2024 15:34:21 +0000 Date: Sat, 20 Jul 2024 16:34:21 +0100 From: Matthew Wilcox To: Minwoo Jo Cc: akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH] HitShield:Something new eviction process for MGLRU Message-ID: References: <20240720142528.276861-1-chminoo@g.cbnu.ac.kr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240720142528.276861-1-chminoo@g.cbnu.ac.kr> X-Stat-Signature: 4sz46m5duidxcxmxtkspycphudtbe93e X-Rspam-User: X-Rspamd-Queue-Id: 41A6880004 X-Rspamd-Server: rspam02 X-HE-Tag: 1721489666-370280 X-HE-Meta: U2FsdGVkX1+zDHPCSFqCEAgVObVbm7WllKi/1Lz9qqHW3RzqG8ilSHTQQ45EsVoJ9slrcRMxDvtGzA/7QPa433OQxxoL3hzk8HbjYEPp4WGlPyOTwHrcIQG3xnqDYVc7F6T+5OFRQSLXi2foVfAM8F+4Wn5QPQafbJhGSdjohT75Pex4KTTSyN+s55K9evAUV2Uro0zj9QBkLUAwaXq9NE1BNX5h0XtVlACJxAUD5FAjRhpyYq8wr+SK1dTpm+Ss+ATiOfglTOzvaUr67URFYU8AQwhzHdKlyEOsbNQKt5tUJ259kldrZbm9woOqBOlsf85FTHRR7OaNOHLFp5KdOhGCgFha1whg8QyNZv9qcYmVaaX4GvinH6824oxLlPqso15FrrX4ZvVAUHYczFMVqpjqKqlslW1tPOBAOYnnl9jgP1oSA+RSS8TjTp7+J+8Tk7atwEyQvz8WLk2iVOu2gA3swOJPBAyV8NE/uLaauJGU9OSck3drP3FbgnRJT/rjtQkiQESEcQ/zxsmh9XD3JGIkyUfIqznoQ3seVP7MxvqAVObNGPzHaHN98d/hIi8ERSi9dzAIkDcP+gwhxfMaD0ThL0pIMNAl+zdr+wPXJ1awp9jXbQAefMdbh6mDHovYcunjepfy9xAMeOE22SNNkO7gUfV1KHqvtufl6oQeiF0ENEGUDuhggb3zZPehnTURO8PaeTVZwuCHXrB+dVMTTgOaD6BCQkx2OgmflaQdN8akBoHQ98gb1zxTjMqVFKgJ/9hVAnj2rK6Jye10Q1f2SzWYPw3a/whSJ6RIf85atUO+VbxoH7yy/ds3aS0+We/zvdvqWH6EJdfjdx5jnIpeH3ycyYoFLglh/wpmL8TetaSYCSX9Ti3irEOaMvZslP0I+ewW/Rj+7La5DUZKy0OVSyZHI53TFKwii7+tWM3LLXO9vSaCzVc2bWODHmoc+6ti7TA9I/Ji/hDv/mnPrbL e9zrFzLY wTCHteZq1u5ALkFEyiG/8I+EvETPzrDfdObABqRiNOiAMMrM31iNrJybzN4s6yuQ5qZ0N7kzPPvhu35bn4iJdSKFUhOClPISQ8IDrzJTTajTt999NChjvGsnBAV8jrduFD/bdWzW78gnuGNMz4mzSVYk3gZIsfNwkeG7om1Dx7GmvEzqudNVIKEMVb1u7WiBPsN9g1KOmfbEArss= 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: List-Subscribe: List-Unsubscribe: On Sat, Jul 20, 2024 at 11:25:28PM +0900, Minwoo Jo wrote: > This hitshield technique was devised based on the observation that MGLRU > does not consider the state of the folio when performing eviction. > > The assumption is that if a folio that has been updated 1-3 times and not > frequently updated accumulates generations until it is evicted, it is > likely to have a low probability of being referenced in the future. Hi Minwoo. This is interesting work. Thank you for sending it out. I do not consider myself qualified to comment on your assumption, but I have some feedback on your implementation. > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index a199c48bc462..053d5620574e 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -189,6 +189,12 @@ struct page { > void *virtual; /* Kernel virtual address (NULL if > not kmapped, ie. highmem) */ > #endif /* WANT_PAGE_VIRTUAL */ > + unsigned char hit_shield; /* > + * The hit_shield variable I added to the page > + * This variable is responsible for counting > + * the number of times this > + * page's generation has been updated. > + */ We don't really have space in struct page for this kind of thing, unfortunately. There are a _few_ bits available in page->flags on 64-bit, but even that is a bit tenuous.