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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF35EC433EF for ; Sun, 13 Feb 2022 21:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+K0njYJxvAHO1ljfigOegpoPW+O/RBrtH0ms22UjK3Y=; b=x9oscQQbymTOHT FpZNLY2UcypEvC9k1+QocU5m+XUeT11a+d1IvO2+C2nhgLn1QUhsyKt5dKTEtU371HTXNQuOKEkJB WZRH+m0E//elmyZGbvWuP16sVhk1G/ABX6rfIIVqnXivprC2uXBiYi2d9fJQCNMONc+GVlA9fCte6 +AoiEsNr7rvur5M15meVEm0jGC1gjfbcp8cghDlXO7NRQoJAraUXkbUQI1uQvLlAt69XqeTZhriBr ENdDCSv//dzB08HLM5VDFlIY3lpfZ6tf5VA3uNhOh8WfQV41/KUAcssuyV7Yy5WTuHkfNsOpGJkds LqZ4yhPeJnprEjbgtdxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJMEL-00CXuI-Mj; Sun, 13 Feb 2022 21:16:25 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJMEH-00CXrc-Q8 for linux-arm-kernel@lists.infradead.org; Sun, 13 Feb 2022 21:16:23 +0000 Received: by mail-io1-xd2b.google.com with SMTP id p63so17701294iod.11 for ; Sun, 13 Feb 2022 13:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HoEQyB0wXuP36DzZ0QRkHqCD5SbkH+algRG5wEjwJXo=; b=h5N69fHGI7cZvuuQQQVEWq5Ocbd1LmgnZQMruZWLFS62Tf0f3r6KH42yPIcbnpUzPe TOn2cr/eU2bgt8ZGSdvN9x7aDu4Bhxk+oygox+iO/oUp7WJGV50FSWgs66oeuvA2WYnI 1sVuzNVISszFEapEIRj7yG/HqKMqyFtZ2ZqqpcerSoEhNeldBdH/ktro0S0cvKStf8Hm 2xifBMI7o4a9q0RW+OVDeqxbjym3XwIzszWyGaTHbmojx1Jkjbz4tT0rCY4ML4+hfHJt uT8ZOyTX5nHvhZHk3nUbalAYxRip7KmO44j/1qtzTwg2iu86F1sZusw7FqD5PtqJ5Hon Xabg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HoEQyB0wXuP36DzZ0QRkHqCD5SbkH+algRG5wEjwJXo=; b=d0UQhJioFkH6ygsr/a+IscT8ZoXCOl/FUZdCA6YTHt5iXdUUEVSnlxq+EcCmkmv0IK YDzrzGwEJe3h3Wm3guQm6gguXzqVnRZPrMYYfSzrId3/oi7DaNL82TbpFqx5gsqQDUPB YkwotD3/rOjKfYjCyv7nzqL3KXfqmWbcBg3qwiXoQKe/ORPhPyByN088hn+YhahkCClY t65UpaHOJJRx7CbfsUjMidgCrbYAWaYQmYUERpcW7qRsuCagKpgHiYuWJNV+oYoUc4Cm avah/DaOni/HNL91q2+1NqkZ7slTFCnS1HE0wC8r99U/kKz+4ABCgGhHo/2HA6YBVqGq g0Og== X-Gm-Message-State: AOAM530lX0TwBTJqFOFYPFmjbirn7XQcVQkzOWPTAwVKu9o5aqyzUtkd qQT/bI+rcMkS+hhAu8B1tPm9nQ== X-Google-Smtp-Source: ABdhPJx2zA0Qgp3jj6EvOzNNp5e5TWs1qwwakXa6kVQ5HAZUV4wNcOsmNoaH07/PQ38CF5kNKnRKiw== X-Received: by 2002:a05:6602:1656:: with SMTP id y22mr5599323iow.34.1644786974067; Sun, 13 Feb 2022 13:16:14 -0800 (PST) Received: from google.com ([2620:15c:183:200:4782:b5ed:f641:ee91]) by smtp.gmail.com with ESMTPSA id q2sm12515494ilt.33.2022.02.13.13.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 13:16:13 -0800 (PST) Date: Sun, 13 Feb 2022 14:16:09 -0700 From: Yu Zhao To: Matthew Wilcox Cc: Andrew Morton , Johannes Weiner , Mel Gorman , Michal Hocko , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Jonathan Corbet , Linus Torvalds , Michael Larabel , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?iso-8859-1?Q?Hoffst=E4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh Subject: Re: [PATCH v7 04/12] mm: multigenerational LRU: groundwork Message-ID: References: <20220208081902.3550911-1-yuzhao@google.com> <20220208081902.3550911-5-yuzhao@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220213_131621_858800_B8E1556D X-CRM114-Status: GOOD ( 28.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 10, 2022 at 09:37:25PM +0000, Matthew Wilcox wrote: > On Tue, Feb 08, 2022 at 01:18:54AM -0700, Yu Zhao wrote: [...] > > +++ b/include/linux/page-flags-layout.h > > @@ -26,6 +26,14 @@ > > > > #define ZONES_WIDTH ZONES_SHIFT > > > > +#ifdef CONFIG_LRU_GEN > > +/* LRU_GEN_WIDTH is generated from order_base_2(CONFIG_NR_LRU_GENS + 1). */ > > +#define LRU_REFS_WIDTH (CONFIG_TIERS_PER_GEN - 2) > > +#else > > +#define LRU_GEN_WIDTH 0 > > +#define LRU_REFS_WIDTH 0 > > +#endif /* CONFIG_LRU_GEN */ > > I'm concerned about the number of bits being used in page->flags. > It seems to me that we already have six bits in use to aid us in choosing > which pages to reclaim: referenced, lru, active, workingset, reclaim, > unevictable. > > What I was hoping to see from this patch set was reuse of those bits. Agreed. I have a plan to *reduce* some of those bits but it's a relatively low priority item on my to-do list. > That would give us 32 queues in total. Some would be special (eg pages > cannot migrate out of the unevictable queue), but it seems to me that you > effectively have 4 queues for active and 4 queues for inactive at this > point (unless I misunderstood that). I think we need special numbers > for: Not on the LRU and Unevictable, but that still leaves us with 30 > generations to split between active & inactive. > > But maybe we still need some of those bits? Perhaps it's not OK to say > that queue id 0 is !LRU, queue 1 is unevictable, queue #2 is workingset, > queues 3-7 are active, queues 8-15 are various degrees of inactive. > I'm assuming that it's not sensible to have a page that's marked as both > "reclaim" and "workingset", but perhaps it is. > > Anyway, I don't understand this area well enough. I was just hoping > for some simplification. I plan to use the spare bits in folio->lru to indicate which lru list a folio is on, i.e., active/inactive or generations or unevictable. In addition, swapbacked could go to folio->mapping -- we wouldn't need it if there were no MADV_FREE, i.e., it would be equivalent to PageAnon() || shmem_mapping(). These two work items can be done separately and in parallel with everything else that's been going on lately. It'd awesome if somebody volunteers, and I can find some resource from our side to test/review the code so that we can have them done sooner. The rest, in theory, can also be moved to somewhere but, IMO, it's not really worth the effort given the situation isn't dire at the moment. referenced and workingset are already reused between the active/inactive lru and the multigenerational lru; reclaim is reused for readahead, but readahead could be split out as an xa tag; lru is reused for isolation synchronization. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel