Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp226251pxk; Wed, 2 Sep 2020 20:20:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuA3UG9SkTQJ6+iDivJsbAxSiPT+ZFdrJXDsB2XoX8K6UrVHmWKN5dgrAxNt+ix55APKj7 X-Received: by 2002:a17:906:c256:: with SMTP id bl22mr74229ejb.260.1599103258118; Wed, 02 Sep 2020 20:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599103258; cv=none; d=google.com; s=arc-20160816; b=OvE2N0CZYwDS8FmwDamVQ/OFFtS0ifGL0ucA6sYDFyiwUyQqDT7ocngdl8MpTIgOpO ZCNeHB73NwFjT8XYBaQ7s0rAF93XTfEPzF3eU6Ayy7OjTeV0LXYnT0j5Sb1Xx8n2VhZ9 3WXIhOrd9nGMWsf7DFNa1wYGlMXBXnBVDsi8rzSnuu4bmV/PvySJGLEskq7n4LFnqQyk YoBEIRmmnsDKeEymIT9vaqSylH5GpIAtWqFbN83F4V1y7tILl9kk6QVPQtt63PZ5QddZ SRWtAHHlkshiChzcxEP2AICyhNJpPkkzzeTg6YyTXUfg4S5QbRWJF5tq6u1tFUYUD4Oo /PIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7M8dRmKxQ8SWluGuVH32a8z7XHLLbxlTFvPn8UpLMTU=; b=oyNeyshZNIQQwkE3GWSdURImNyc5KjT8aiCnzT/DH1lh3qedBWMHkRqesGlZ6MASAS PaJZcEVoE6Waj1lNZVgKdSn5XKkJsnLe2Hwi+cPuLXQde0GQ6K6OcgmAmeHLmGkAuRou C9MfpF2WSJ73JNdMKZnoB/lwCwpGe8ZgrYzJ8Um4woNd4JIPxoeCKcYqV1YNTj4FhEC6 ZlhyVTlSi3zQKzTIgyHSGQxrayYnf74P+Hc2WYt6t3Z/EJeZ1TdKVgk5puPw4WWB7BMO 8qx4ZFMOZl6o40/pOAiVa6g7PZ7q+U+pxPyYDRKVl/rle6y5aezNS8Rp3NwpTzp6oVe2 E6mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=enbJpHJK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si1022190ejv.425.2020.09.02.20.20.34; Wed, 02 Sep 2020 20:20:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=enbJpHJK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728070AbgICDQE (ORCPT + 99 others); Wed, 2 Sep 2020 23:16:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbgICDQE (ORCPT ); Wed, 2 Sep 2020 23:16:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 052C7C061244 for ; Wed, 2 Sep 2020 20:16:04 -0700 (PDT) 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=7M8dRmKxQ8SWluGuVH32a8z7XHLLbxlTFvPn8UpLMTU=; b=enbJpHJKb+JneT1dFhIpxsm6WV a7rMEnu0PrG4jkeDJ/TCAz4dih5YwJv9ZvIXK209n256YoLrj0jYYnrWKQ8FISbbPQouIYxwDA3qL RBLRr6ykUvENNQu4G5imMII4ui3QGdMB8yqVxdti8Rs01rFfffiQWyVDZqIDCo36G2zThkg3ojjFe V1qE+XACU/MlY0opp2nT6pSE34s/ktp7lh4e9zHOG0IRW9VBowogev6bnKyYY2TBHFjixtv3U4EBG 2j/wDRJjfX9+wvZggBkU8V+ut4wzfYZx97dPvNJEKbLD/MXR0/vCYwQmvwL0SQpaiUehHR0W6TsUa xUaRbs3Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDfiz-0000R4-Vo; Thu, 03 Sep 2020 03:15:46 +0000 Date: Thu, 3 Sep 2020 04:15:45 +0100 From: Matthew Wilcox To: Zi Yan Cc: linux-mm@kvack.org, Roman Gushchin , Rik van Riel , "Kirill A . Shutemov" , Shakeel Butt , Yang Shi , David Nellans , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 01/16] mm: add pagechain container for storing multiple pages. Message-ID: <20200903031545.GZ14765@casper.infradead.org> References: <20200902180628.4052244-1-zi.yan@sent.com> <20200902180628.4052244-2-zi.yan@sent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200902180628.4052244-2-zi.yan@sent.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 02, 2020 at 02:06:13PM -0400, Zi Yan wrote: > When depositing page table pages for 1GB THPs, we need 512 PTE pages + > 1 PMD page. Instead of counting and depositing 513 pages, we can use the > PMD page as a leader page and chain the rest 512 PTE pages with ->lru. > This, however, prevents us depositing PMD pages with ->lru, which is > currently used by depositing PTE pages for 2MB THPs. So add a new > pagechain container for PMD pages. But you've allocated a page for the PMD table. Why can't you use that 4kB to store pointers to the 512 PTE tables? You could also use an existing data structure like the XArray (although not a pagevec).