From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbdAYQ4f (ORCPT ); Wed, 25 Jan 2017 11:56:35 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45432 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbdAYQ4d (ORCPT ); Wed, 25 Jan 2017 11:56:33 -0500 Date: Wed, 25 Jan 2017 08:55:22 -0800 From: Srikar Dronamraju To: "Kirill A. Shutemov" Cc: Andrew Morton , "Kirill A. Shutemov" , Andrea Arcangeli , Hugh Dickins , Rik van Riel , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oleg Nesterov , Peter Zijlstra Subject: Re: [PATCH 01/12] uprobes: split THPs before trying replace them Reply-To: Srikar Dronamraju References: <20170124162824.91275-1-kirill.shutemov@linux.intel.com> <20170124162824.91275-2-kirill.shutemov@linux.intel.com> <20170124132849.73135e8c6e9572be00dbbe79@linux-foundation.org> <20170124222217.GB19920@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20170124222217.GB19920@node.shutemov.name> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17012516-0008-0000-0000-0000010310B9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012516-0009-0000-0000-000008F27CE4 Message-Id: <20170125165522.GA11569@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-25_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-1612050000 definitions=main-1701250161 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > For THPs page_check_address() always fails. It's better to split them > > > first before trying to replace. > > > > So what does this mean. uprobes simply fails to work when trying to > > place a probe into a THP memory region? > > Looks like we can end up with endless retry loop in uprobe_write_opcode(). > > > How come nobody noticed (and reported) this when using the feature? > > I guess it's not often used for anon memory. > The first time the breakpoint is hit on a page, it replaces the text page with anon page. Now lets assume we insert breakpoints in all the pages in a range. Here each page is individually replaced by a non THP anonpage. (since we dont have bulk breakpoint insertion support, breakpoint insertion happens one at a time). Now the only interesting case may be when each of these replaced pages happen to be physically contiguous so that THP kicks in to replace all of these pages with one THP page. Can happen in practice? Are there any other cases that I have missed? -- Thanks and Regards Srikar Dronamraju