Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752092AbdFOJhF (ORCPT ); Thu, 15 Jun 2017 05:37:05 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48102 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752008AbdFOJhD (ORCPT ); Thu, 15 Jun 2017 05:37:03 -0400 Subject: Re: [HELP-NEEDED, PATCH 0/3] Do not loose dirty bit on THP pages To: "Kirill A. Shutemov" Cc: Will Deacon , "Kirill A. Shutemov" , Andrew Morton , Vlastimil Babka , Vineet Gupta , Russell King , Catalin Marinas , Ralf Baechle , "David S. Miller" , Heiko Carstens , Martin Schwidefsky , Andrea Arcangeli , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com References: <20170614135143.25068-1-kirill.shutemov@linux.intel.com> <20170614165513.GD17632@arm.com> <548e33cb-e737-bb39-91a3-f66ee9211262@linux.vnet.ibm.com> <20170615084851.if6sntxo5tswhlk5@node.shutemov.name> From: "Aneesh Kumar K.V" Date: Thu, 15 Jun 2017 15:06:49 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170615084851.if6sntxo5tswhlk5@node.shutemov.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17061509-0008-0000-0000-0000080633DC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007236; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00875065; UDB=6.00435648; IPR=6.00655153; BA=6.00005422; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015835; XFM=3.00000015; UTC=2017-06-15 09:37:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17061509-0009-0000-0000-000042A0E60E Message-Id: <2a54d607-6e46-3693-158b-5e8101010ce2@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-15_03:,, 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-1703280000 definitions=main-1706150169 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1028 Lines: 26 On Thursday 15 June 2017 02:18 PM, Kirill A. Shutemov wrote: > O >> I am not suggesting we don't do the invalidate (the need for that is >> documented in __split_huge_pmd_locked(). I am suggesting we need a new >> interface, something like Andrea suggested. >> >> old_pmd = pmdp_establish(pmd_mknotpresent()); >> >> instead of pmdp_invalidate(). We can then use this in scenarios where we >> want to update pmd PTE entries, where right now we go through a pmdp_clear >> and set_pmd path. We should really not do that for THP entries. > > Which cases are you talking about? When do we need to clear pmd and set > later? > With the latest upstream I am finding the usage when we mark pte clean page_mkclean_one . Also there is a similar usage in migrate_misplaced_transhuge_page(). I haven't really verified whether they do cause any race. But my suggestion is, we should avoid the usage of set_pmd_at() unless we are creating a new pmd PTE entry. If we can provide pmdp_establish() we can achieve that easily. -aneesh