Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp32542pxk; Wed, 2 Sep 2020 13:33:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYcmox6gdxCwqPhhnoSOe8Of4ZEKG39BksBmJMpCJkFBeJS0vsZKyrkzRo4R7v2DBft/7v X-Received: by 2002:a17:906:3a85:: with SMTP id y5mr1770388ejd.507.1599078799344; Wed, 02 Sep 2020 13:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599078799; cv=none; d=google.com; s=arc-20160816; b=XtQiGAi5Y+5Sw86h31//1Mq4j7hz6UUbo2dNy5gDONzvLCcHbyCu6yQJfJuBpcb3DN 3QnZdWFVyhtd3tsrVCd64Wda1X9OCbtnPuA9Lxx6T7lDoOfsz729yIDbBRs4S24bdELR EfFm9xuNJFOUjJWxBayjTlZuQRUdnZz0T0A6oq+q+IvxbDV3ebzVZPEqgE4ounb+GoLr 7i/AbZHVsBn1TwlGY3RouklLtYVO/UpprKe6AHrb75bKkkxPKiCQcFTAxwHRR2v0LTBv K0+V04V8CduWaagxEQ4PPwfc07eIwafc7BtN78J3mbU2jxCl80A2rlz21P7PKsNHLzAD E5Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=NZgrNRwvUqZ2fItnpuN0y7CKknqhb7o5yUK6eUEHgO8=; b=HdZIy7j2JWJcEjY5R5nIQnQ6lRsBLVexgNJY40FfsPGRieUoSbLuN1ZuWynBB+d30f 3j6qFRYjNnhpSIayeYM5rJjDSK8Ae/Cu2YVz5pA74Y1g1+6REgMS8PZo1ye/kMGlN1by DI2XO+OUZFjS9cZ+OVLtNh7gtL7vEc1rdt2ms3fLMonCZ4B1nYJG77MDP5YpAWXjvnwC mGpEow+w64Ib/RwosX6CbmeZ2aiLc/AowVSu7RDsY2sqO0EmMSuhM63oCFZearZBTMec 1aPaB7/sujzyMETGIuU6r9UaEYdFfaiafGo7+V14TruTaGHk76mhm2rxsxqO37/sme5c G84A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=lGgdPmra; 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 pg7si421579ejb.395.2020.09.02.13.32.57; Wed, 02 Sep 2020 13:33:19 -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=lGgdPmra; 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 S1726355AbgIBU3o (ORCPT + 99 others); Wed, 2 Sep 2020 16:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbgIBU3o (ORCPT ); Wed, 2 Sep 2020 16:29:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D2C5C061244 for ; Wed, 2 Sep 2020 13:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=NZgrNRwvUqZ2fItnpuN0y7CKknqhb7o5yUK6eUEHgO8=; b=lGgdPmracBAkg8LSxWNuCfHRRv bNQ0bBliMublqsUgS+ZD/b2sjBi2dwYvGKicxbxrOcTIgxGmQFBBvIhrM+Yq1D54X2MrPgMaMQcMW D/sj1l4tjaI/iteMTNUy4+pBfszZe/nqpV4kHMBmatuRkocTg1z8JWi0a6Z0Ka4PcU3eknsPSK2xe dQ7KYz6xlAzQ6e0bpUUvurDQiwM9DhAT8tk2JCb02y/8WkA3RxASKjbs1JpZm7SXKh0krLULQOUSe mZQ02Me9obB2ruDt74ooLU4W4MqLSbFyZdYIKsGyCwtssmI3Zo58VDM7u8bMItDJmM+2XsyCDxgHV Z6Q/ZNYw==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDZNx-000637-37; Wed, 02 Sep 2020 20:29:37 +0000 Subject: Re: [RFC PATCH 01/16] mm: add pagechain container for storing multiple pages. To: Zi Yan , linux-mm@kvack.org, Roman Gushchin Cc: Rik van Riel , "Kirill A . Shutemov" , Matthew Wilcox , Shakeel Butt , Yang Shi , David Nellans , linux-kernel@vger.kernel.org References: <20200902180628.4052244-1-zi.yan@sent.com> <20200902180628.4052244-2-zi.yan@sent.com> From: Randy Dunlap Message-ID: <5a91ac07-2c15-2e15-caec-5570bacf415b@infradead.org> Date: Wed, 2 Sep 2020 13:29:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200902180628.4052244-2-zi.yan@sent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/2/20 11:06 AM, Zi Yan wrote: > From: Zi Yan > > 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. > > Signed-off-by: Zi Yan > --- > include/linux/pagechain.h | 73 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 73 insertions(+) > create mode 100644 include/linux/pagechain.h > > diff --git a/include/linux/pagechain.h b/include/linux/pagechain.h > new file mode 100644 > index 000000000000..be536142b413 > --- /dev/null > +++ b/include/linux/pagechain.h > @@ -0,0 +1,73 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * include/linux/pagechain.h > + * > + * In many places it is efficient to batch an operation up against multiple > + * pages. A pagechain is a multipage container which is used for that. > + */ > + > +#ifndef _LINUX_PAGECHAIN_H > +#define _LINUX_PAGECHAIN_H > + > +#include > + > +/* 14 pointers + two long's align the pagechain structure to a power of two */ > +#define PAGECHAIN_SIZE 13 OK, I'll bite. I see neither 14 pointers nor 2 longs below. Is the comment out of date or am I just confuzed? Update: struct list_head is 2 pointers, so I see 15 pointers & one unsigned int. Where are the 2 longs? > + > +struct page; > + > +struct pagechain { > + struct list_head list; > + unsigned int nr; > + struct page *pages[PAGECHAIN_SIZE]; > +}; thanks. -- ~Randy