Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp42445pxk; Wed, 2 Sep 2020 13:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzibHocNRrK7jXbz2kjN80RPKC2rbCjTLxL/f6noQOvIIzLwkWjSYzOxFq5x03XJ0JQzA8d X-Received: by 2002:a17:906:a251:: with SMTP id bi17mr1896547ejb.526.1599080016222; Wed, 02 Sep 2020 13:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599080016; cv=none; d=google.com; s=arc-20160816; b=mt2865vfhbQk8OKe3aigntTRHLZsRTfjdV1gwDHI27C/tX5ebXxsv4GVXpZA2pXf8n YLvsLq0SuYgb8CXmwTuJrg9Gk9FBI7c2DVRB1CKXJR6CTsF6hM1jQ7st2DtnzK3/7DMX CujzjCmeTViiv8nuqh7ju1MyBjiKZ8j6O/NM38rVyQcfyqV391IIdDUVX2WMb0Yk+E5B DBYJq7jdEB07FcxkNtOE3K49OQlq/o86/UjUwhCQg8CS+u2vrudM5jy4te9YXP5JVX42 tATDMMI5OleR4Iyjkp2pEtSMFHvThoTIMJrxHSxmcG8+fi7hhqr29LZZnaqCFC5+9pz/ 51Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=Bnc1QocclEa0CaEoPiXV6Akeua3Riy/viDElinHY9lw=; b=XHqBJ3JIQIsCtY4Ow/uqPfO+md1RJemcQ6hxQjPS7yxNk8MN07uRBXnPcFR7Tv5swx wwmdsxu3u0O87tOsBaX6AGsbu/gw+0WR6vlkTSk6uzRht39A23f9dGskzTKFgozvUE5t 68s96oGhLQCPtSrpudKQJHpCC+vrjXKUse8nRVCiIJbb/b3Bo4uZwZekTnMh10NU5pBS 4ZLCZSuGgBQ2N+dsm3mcjjLAQwaCH8pYaAtNs7+YzL15h7FN1umagGeRdtEpfACMkfmK 9W5Q/KpiYUFuJpGwQA/X0HC3gD2ALdX/VoPfA/O6jkoe4fPvyg88yAo/cHitDnurr2dd 3rGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=BjGYjixc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si475730ejc.134.2020.09.02.13.53.13; Wed, 02 Sep 2020 13:53:36 -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=pass header.i=@nvidia.com header.s=n1 header.b=BjGYjixc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726794AbgIBUtN (ORCPT + 99 others); Wed, 2 Sep 2020 16:49:13 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:4842 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbgIBUtG (ORCPT ); Wed, 2 Sep 2020 16:49:06 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 02 Sep 2020 13:48:52 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 02 Sep 2020 13:49:06 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 02 Sep 2020 13:49:06 -0700 Received: from [10.2.161.253] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 2 Sep 2020 20:49:01 +0000 From: Zi Yan To: Randy Dunlap CC: , Roman Gushchin , Rik van Riel , "Kirill A . Shutemov" , Matthew Wilcox , Shakeel Butt , Yang Shi , David Nellans , Subject: Re: [RFC PATCH 01/16] mm: add pagechain container for storing multiple pages. Date: Wed, 2 Sep 2020 16:48:59 -0400 X-Mailer: MailMate (1.13.1r5705) Message-ID: <57FD8627-2411-448B-9F0E-E4742CAF6C82@nvidia.com> In-Reply-To: <5a91ac07-2c15-2e15-caec-5570bacf415b@infradead.org> References: <20200902180628.4052244-1-zi.yan@sent.com> <20200902180628.4052244-2-zi.yan@sent.com> <5a91ac07-2c15-2e15-caec-5570bacf415b@infradead.org> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: multipart/signed; boundary="=_MailMate_468D2D46-BBC2-4AE2-AEBE-C13C1109D934_="; micalg=pgp-sha512; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1599079732; bh=Bnc1QocclEa0CaEoPiXV6Akeua3Riy/viDElinHY9lw=; h=X-PGP-Universal:From:To:CC:Subject:Date:X-Mailer:Message-ID: In-Reply-To:References:MIME-Version:X-Originating-IP: X-ClientProxiedBy:Content-Type; b=BjGYjixcu/d8DuitSP+9BYHvVNmuPlesnvtO63FJ0MQjHNVIffDeXPAMCthoJX0uM +xu1H+DlXvjMNnQ2f+xynadcl7pTwoSlo5eqDx9hq643XnYJ9YFpgzuDlwcFKWTYvT sBj/HQz8ag7qq6/2x92diZ4e1y5lRE3dmg25LdmD6Ujtzk5guP7YOeDtCZMUjia6qK DmSffjoiS5YgHPG+zvZvK+FPmtoWWTFv5SFpLsD8vhPAue4n7hION0b2cgFq/ltlr0 GY3kSDk9kpfEofRAp6pJ0dGLa+35Hxp2EXSGCDz+T6tk1ndXnSBFtr29ta9XhZ2dM1 bdvtUllSbHqmA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=_MailMate_468D2D46-BBC2-4AE2-AEBE-C13C1109D934_= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 2 Sep 2020, at 16:29, Randy Dunlap wrote: > 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 t= he >> 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 mu= ltiple >> + * pages. A pagechain is a multipage container which is used for that= =2E >> + */ >> + >> +#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 unsi= gned int. > Where are the 2 longs? My bad. Will change this to: /* 15 pointers + one long align the pagechain structure to a power of two= */ #define PAGECHAIN_SIZE 13 struct page; struct pagechain { struct list_head list; unsigned long nr; struct page *pages[PAGECHAIN_SIZE]; }; Thanks for checking. =E2=80=94 Best Regards, Yan Zi --=_MailMate_468D2D46-BBC2-4AE2-AEBE-C13C1109D934_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAl9QBTsPHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKqRsQAId/jV9PpVTmeiDgUZA5dsaQ6pGR4X7LNpOB IkfXIwZYANfQviqFP3hjyfK2W07nLEXDUEXNu2XYBxoCXh7MCrkbv90Oqtj8874I j/q6AeWZFketB4Fk88EBdbGt9NyV7uh2lg5WERawznBHwQVXM9eC8jHt9eL0bNHk 2o2JJiK18e2WtbGySUDwzF0MiDWpkzG/8jFpKzPPOmfon3QijPFlePfbt/2cdXcn +uOL+c50StvNqDnFN2xz0Rh6BiRsrrUbHzWn3LqtktlPYqeIIx0CUK3JPqZwqQ8g 8TZYeMZtESKn6bBCQwK+wzW/aAbHIMNlYxrZwjE1camp3XVdMB7skqgh8eIji9eO WAhjfyBOlxsQtvSWz2ruENNiICjvDH0TPbab8dJz0bQX6SCqZuvziTYdUXcuwNxY Tjim6E1tcI14AxR4mFw7YqVd8v21Pddna/JF6vE0pY7wEK2hHgWdqVAwcT7Zyv27 WzXSepDRCI1l1ObEMX0+w+KsjT8i/eJcd9KlerTJFchpnyHORLxy2zpKCwlvV6Hl JVsc4FccsvJehCBCQ7wAC9KpCuuzaqY7rhLq0SmRZOyI0f7F2zTunNbf1bAVqRn0 8T3ytJncHj2OBYrtYK43KhwgRFBjLZxGzZZZ6dfqsXlnYCZ3wpeESR0np0Jf19fU HB0z5jiI =nvIn -----END PGP SIGNATURE----- --=_MailMate_468D2D46-BBC2-4AE2-AEBE-C13C1109D934_=--