Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756467AbcKKMM3 (ORCPT ); Fri, 11 Nov 2016 07:12:29 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34113 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751606AbcKKMM1 (ORCPT ); Fri, 11 Nov 2016 07:12:27 -0500 From: "Aneesh Kumar K.V" To: "Kirill A. Shutemov" Cc: akpm@linux-foundation.org, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 2/2] mm: THP page cache support for ppc64 In-Reply-To: <20161111101439.GB19382@node.shutemov.name> References: <20161107083441.21901-1-aneesh.kumar@linux.vnet.ibm.com> <20161107083441.21901-2-aneesh.kumar@linux.vnet.ibm.com> <20161111101439.GB19382@node.shutemov.name> Date: Fri, 11 Nov 2016 17:42:11 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111112-0024-0000-0000-00001500D561 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006057; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00779524; UDB=6.00375589; IPR=6.00556843; BA=6.00004869; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013291; XFM=3.00000011; UTC=2016-11-11 12:12:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111112-0025-0000-0000-0000460FEB7A Message-Id: <8737iy1ahw.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-11_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611110219 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1083 Lines: 37 "Kirill A. Shutemov" writes: > On Mon, Nov 07, 2016 at 02:04:41PM +0530, Aneesh Kumar K.V wrote: >> @@ -2953,6 +2966,13 @@ static int do_set_pmd(struct fault_env *fe, struct page *page) >> ret = VM_FAULT_FALLBACK; >> page = compound_head(page); >> >> + /* >> + * Archs like ppc64 need additonal space to store information >> + * related to pte entry. Use the preallocated table for that. >> + */ >> + if (arch_needs_pgtable_deposit() && !fe->prealloc_pte) >> + fe->prealloc_pte = pte_alloc_one(vma->vm_mm, fe->address); >> + > > -ENOMEM handling? How about if (arch_needs_pgtable_deposit() && !fe->prealloc_pte) { fe->prealloc_pte = pte_alloc_one(vma->vm_mm, fe->address); if (!fe->prealloc_pte) return VM_FAULT_OOM; } > > I think we should do this way before this point. Maybe in do_fault() or > something. doing this in do_set_pmd keeps this closer to where we set the pmd. Any reason you thing we should move it higher up the stack. We already do pte_alloc() at the same level for a non transhuge case in alloc_set_pte(). -aneesh