From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx202.postini.com [74.125.245.202]) by kanga.kvack.org (Postfix) with SMTP id B957D6B0005 for ; Wed, 6 Mar 2013 04:28:37 -0500 (EST) Message-ID: <51370CC7.8050406@cn.fujitsu.com> Date: Wed, 06 Mar 2013 17:30:47 +0800 From: Lin Feng MIME-Version: 1.0 Subject: Re: [RFC/PATCH 3/5] mm: get_user_pages: use NON-MOVABLE pages when FOLL_DURABLE flag is set References: <1362466679-17111-1-git-send-email-m.szyprowski@samsung.com> <1362466679-17111-4-git-send-email-m.szyprowski@samsung.com> In-Reply-To: <1362466679-17111-4-git-send-email-m.szyprowski@samsung.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Marek Szyprowski Cc: linux-mm@kvack.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, Kyungmin Park , Arnd Bergmann , Andrew Morton , Mel Gorman , Michal Nazarewicz , Minchan Kim , Bartlomiej Zolnierkiewicz Hi Marek, On 03/05/2013 02:57 PM, Marek Szyprowski wrote: > @@ -2495,7 +2498,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo > */ > static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, > unsigned long address, pte_t *page_table, pmd_t *pmd, > - spinlock_t *ptl, pte_t orig_pte) > + spinlock_t *ptl, pte_t orig_pte, unsigned int flags) > __releases(ptl) > { > struct page *old_page, *new_page = NULL; > @@ -2505,6 +2508,10 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, > struct page *dirty_page = NULL; > unsigned long mmun_start = 0; /* For mmu_notifiers */ > unsigned long mmun_end = 0; /* For mmu_notifiers */ > + gfp_t gfp = GFP_HIGHUSER_MOVABLE; > + > + if (IS_ENABLED(CONFIG_CMA) && (flags & FAULT_FLAG_NO_CMA)) > + gfp &= ~__GFP_MOVABLE; Here just simply strip the __GFP_MOVABLE flag, IIUC it will break the page migrate policy. Because " But GFP_MOVABLE is not only a zone specifier but also an allocation policy.". Another problem is that you add a new flag to instruct the page allocation, do we have to also handle the hugepage or THP as Mel ever mentioned? thanks, linfeng -- 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/ . Don't email: email@kvack.org