Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030467AbbKDCay (ORCPT ); Tue, 3 Nov 2015 21:30:54 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34721 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965368AbbKDC24 (ORCPT ); Tue, 3 Nov 2015 21:28:56 -0500 Date: Wed, 4 Nov 2015 11:29:51 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michael Kerrisk , linux-api@vger.kernel.org, Hugh Dickins , Johannes Weiner , Rik van Riel , Mel Gorman , KOSAKI Motohiro , Jason Evans , Daniel Micay , "Kirill A. Shutemov" , Shaohua Li , Michal Hocko , yalin.wang2010@gmail.com, Sergey Senozhatsky Subject: Re: [PATCH v2 01/13] mm: support madvise(MADV_FREE) Message-ID: <20151104022951.GA3744@swordfish> References: <1446600367-7976-1-git-send-email-minchan@kernel.org> <1446600367-7976-2-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446600367-7976-2-git-send-email-minchan@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1075 Lines: 41 On (11/04/15 10:25), Minchan Kim wrote: [..] > +static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, > + unsigned long end, struct mm_walk *walk) > + > +{ > + struct mmu_gather *tlb = walk->private; > + struct mm_struct *mm = tlb->mm; > + struct vm_area_struct *vma = walk->vma; > + spinlock_t *ptl; > + pte_t *pte, ptent; > + struct page *page; I'll just ask (probably I'm missing something) + pmd_trans_huge_lock() ? > + split_huge_page_pmd(vma, addr, pmd); > + if (pmd_trans_unstable(pmd)) > + return 0; > + > + pte = pte_offset_map_lock(mm, pmd, addr, &ptl); > + arch_enter_lazy_mmu_mode(); > + for (; addr != end; pte++, addr += PAGE_SIZE) { > + ptent = *pte; > + > + if (!pte_present(ptent)) > + continue; > + > + page = vm_normal_page(vma, addr, ptent); > + if (!page) > + continue; > + -ss -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/