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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62C43C433E7 for ; Thu, 3 Sep 2020 03:15:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D0CB2071B for ; Thu, 3 Sep 2020 03:15:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="enbJpHJK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D0CB2071B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AE38D6B0062; Wed, 2 Sep 2020 23:15:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A937A6B0068; Wed, 2 Sep 2020 23:15:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 982DC8E0001; Wed, 2 Sep 2020 23:15:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id 7EF8D6B0062 for ; Wed, 2 Sep 2020 23:15:52 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3CD12362D for ; Thu, 3 Sep 2020 03:15:52 +0000 (UTC) X-FDA: 77220285744.23.cup50_210e53d270a6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 1300437606 for ; Thu, 3 Sep 2020 03:15:52 +0000 (UTC) X-HE-Tag: cup50_210e53d270a6 X-Filterd-Recvd-Size: 2500 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Sep 2020 03:15:50 +0000 (UTC) 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> X-Rspamd-Queue-Id: 1300437606 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: 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).