From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with SMTP id 0BDFE6B004A for ; Mon, 13 Jun 2011 09:48:45 -0400 (EDT) Date: Mon, 13 Jun 2011 15:46:36 +0200 From: Oleg Nesterov Subject: Re: [PATCH v4 3.0-rc2-tip 2/22] 2: uprobes: Breakground page replacement. Message-ID: <20110613134636.GA21979@redhat.com> References: <20110607125804.28590.92092.sendpatchset@localhost6.localdomain6> <20110607125835.28590.25476.sendpatchset@localhost6.localdomain6> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110607125835.28590.25476.sendpatchset@localhost6.localdomain6> Sender: owner-linux-mm@kvack.org List-ID: To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Masami Hiramatsu , Hugh Dickins , Christoph Hellwig , Andi Kleen , Thomas Gleixner , Jonathan Corbet , Andrew Morton , Jim Keniston , Roland McGrath , Ananth N Mavinakayanahalli , LKML On 06/07, Srikar Dronamraju wrote: > > +static int __replace_page(struct vm_area_struct *vma, struct page *page, > + struct page *kpage) > +{ > + struct mm_struct *mm = vma->vm_mm; > + pgd_t *pgd; > + pud_t *pud; > + pmd_t *pmd; > + pte_t *ptep; > + spinlock_t *ptl; > + unsigned long addr; > + int err = -EFAULT; > + > + addr = page_address_in_vma(page, vma); > + if (addr == -EFAULT) > + goto out; > + > + pgd = pgd_offset(mm, addr); > + if (!pgd_present(*pgd)) > + goto out; > + > + pud = pud_offset(pgd, addr); > + if (!pud_present(*pud)) > + goto out; > + > + pmd = pmd_offset(pud, addr); > + if (pmd_trans_huge(*pmd) || (!pmd_present(*pmd))) > + goto out; Hmm. So it doesn't work with transhuge pages? May be the caller should use __gup(FOLL_SPLIT), otherwise set_bkpt/etc can fail "mysteriously", no? OTOH, I don't really understand how pmd_trans_huge() is possible, valid_vma() checks ->vm_file != NULL and I iiuc transparent hugepages can only work with anonymous mappings. Confused... But the real problem (afaics) is VM_HUGETLB mappings. I can't understand how __replace_page() can work in this case. Probably valid_vma() should fail if is_vm_hugetlb_page()? Oleg. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org