Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932349AbcLLQev (ORCPT ); Mon, 12 Dec 2016 11:34:51 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60858 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932295AbcLLQeq (ORCPT ); Mon, 12 Dec 2016 11:34:46 -0500 From: "Aneesh Kumar K.V" To: akpm@linux-foundation.org, "Kirill A . Shutemov" , mpe@ellerman.id.au Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Aneesh Kumar K.V" Subject: [PATCH 1/2] mm/thp/pagecache: Only withdraw page table after a successful deposit Date: Mon, 12 Dec 2016 22:04:27 +0530 X-Mailer: git-send-email 2.10.2 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16121216-0012-0000-0000-0000115F7632 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006236; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000196; SDB=6.00792832; UDB=6.00384316; IPR=6.00570633; BA=6.00004959; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013608; XFM=3.00000011; UTC=2016-12-12 16:34:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16121216-0013-0000-0000-000047F28DF7 Message-Id: <20161212163428.6780-1-aneesh.kumar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-12_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1612120254 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1027 Lines: 33 The current code wrongly called withdraw in the error path. But we haven't depoisted the page table yet in the only error path in that function. So for now remove that withdraw completely. If we take that "out:" branch, we should have vmf->prealloc_pte already pointing to the allocated page table. Fixes: "mm: THP page cache support for ppc64" Signed-off-by: Aneesh Kumar K.V --- mm/memory.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 455c3e628d52..36c774f9259e 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3008,13 +3008,6 @@ static int do_set_pmd(struct vm_fault *vmf, struct page *page) ret = 0; count_vm_event(THP_FILE_MAPPED); out: - /* - * If we are going to fallback to pte mapping, do a - * withdraw with pmd lock held. - */ - if (arch_needs_pgtable_deposit() && ret == VM_FAULT_FALLBACK) - vmf->prealloc_pte = pgtable_trans_huge_withdraw(vma->vm_mm, - vmf->pmd); spin_unlock(vmf->ptl); return ret; } -- 2.10.2