From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx194.postini.com [74.125.245.194]) by kanga.kvack.org (Postfix) with SMTP id 29AD06B004A for ; Fri, 13 Apr 2012 22:51:56 -0400 (EDT) Received: by vcbfk14 with SMTP id fk14so3543167vcb.14 for ; Fri, 13 Apr 2012 19:51:55 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 14 Apr 2012 10:51:54 +0800 Message-ID: Subject: Re: how to avoid allocating or freeze MOVABLE memory in userspace From: Haojian Zhuang Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, m.szyprowski@samsung.com On Sat, Apr 14, 2012 at 2:27 AM, Christoph Lameter wrote: > On Fri, 13 Apr 2012, Haojian Zhuang wrote: > >> I have one question on memory migration. As we know, malloc() from >> user app will allocate MIGRATE_MOVABLE pages. But if we want to use >> this memory as DMA usage, we can't accept MIGRATE_MOVABLE type. Could >> we change its behavior before DMA working? > > MIGRATE_MOVABLE works fine for DMA. If you keep a reference from a device > driver to user pages then you will have to increase the page refcount > which will in turn pin the page and make it non movable for as long as you > keep the refcount. Hi Christoph, Thanks for your illustration. But it's a little abstract. Could you give me a simple example or show me the code? Best Regards Haojian -- 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