Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933705AbdGKPov (ORCPT ); Tue, 11 Jul 2017 11:44:51 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56381 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933419AbdGKPot (ORCPT ); Tue, 11 Jul 2017 11:44:49 -0400 Date: Tue, 11 Jul 2017 08:44:15 -0700 From: Ram Pai To: Balbir Singh Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, dave.hansen@intel.com, hbabu@us.ibm.com, arnd@arndb.de, akpm@linux-foundation.org, corbet@lwn.net, mingo@redhat.com Subject: Re: [RFC v5 02/38] powerpc: Free up four 64K PTE bits in 64K backed HPTE pages Reply-To: Ram Pai References: <1499289735-14220-1-git-send-email-linuxram@us.ibm.com> <1499289735-14220-3-git-send-email-linuxram@us.ibm.com> <20170711155959.79e2d4de@firefly.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170711155959.79e2d4de@firefly.ozlabs.ibm.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17071115-8235-0000-0000-00000BE7BB1C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007349; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00886074; UDB=6.00442263; IPR=6.00666223; BA=6.00005468; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016180; XFM=3.00000015; UTC=2017-07-11 15:44:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071115-8236-0000-0000-00003CB2A7E4 Message-Id: <20170711154415.GA5525@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-11_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707110251 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1966 Lines: 55 On Tue, Jul 11, 2017 at 03:59:59PM +1000, Balbir Singh wrote: > On Wed, 5 Jul 2017 14:21:39 -0700 > Ram Pai wrote: > > > Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 > > in the 64K backed HPTE pages. This along with the earlier > > patch will entirely free up the four bits from 64K PTE. > > The bit numbers are big-endian as defined in the ISA3.0 > > > > This patch does the following change to 64K PTE backed > > by 64K HPTE. > > > > H_PAGE_F_SECOND (S) which occupied bit 4 moves to the > > second part of the pte to bit 60. > > H_PAGE_F_GIX (G,I,X) which occupied bit 5, 6 and 7 also > > moves to the second part of the pte to bit 61, > > 62, 63, 64 respectively > > > > since bit 7 is now freed up, we move H_PAGE_BUSY (B) from > > bit 9 to bit 7. > > > > The second part of the PTE will hold > > (H_PAGE_F_SECOND|H_PAGE_F_GIX) at bit 60,61,62,63. > > > > Before the patch, the 64K HPTE backed 64k PTE format was > > as follows > > > > 0 1 2 3 4 5 6 7 8 9 10...........................63 > > : : : : : : : : : : : : > > v v v v v v v v v v v v > > > > ,-,-,-,-,--,--,--,--,-,-,-,-,-,------------------,-,-,-, > > |x|x|x| |S |G |I |X |x|B|x|x|x|................|.|.|.|.| <- primary pte > > '_'_'_'_'__'__'__'__'_'_'_'_'_'________________'_'_'_'_' > > | | | | | | | | | | | | |..................| | | | | <- secondary pte > > '_'_'_'_'__'__'__'__'_'_'_'_'__________________'_'_'_'_' > > > > It's not entirely clear what the secondary pte contains > today and how many of the bits are free today? The secondary pte today is not used for anything for 64k-hpte backed ptes. It gets used the moment the pte gets backed by 4-k hptes. Till then the bits are available. And this patch makes use of that knowledge. Will add some words in the patch description towards this. Thanks, RP > > Balbir Singh. -- Ram Pai