From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756865AbdDQQNy (ORCPT ); Mon, 17 Apr 2017 12:13:54 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:36638 "EHLO mail-qk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932AbdDQQNw (ORCPT ); Mon, 17 Apr 2017 12:13:52 -0400 Subject: Re: Using ion memory for direct-io To: "Zengtao (B)" , "sumit.semwal@linaro.org" References: <678F3D1BB717D949B966B68EAEB446ED0BCCFFC4@dggeml511-mbs.china.huawei.com> Cc: "gregkh@linuxfoundation.org" , "arve@android.com" , "riandrews@android.com" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" From: Laura Abbott Message-ID: <2b0d4915-3705-dce5-d9dd-066549050bfc@redhat.com> Date: Mon, 17 Apr 2017 09:13:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <678F3D1BB717D949B966B68EAEB446ED0BCCFFC4@dggeml511-mbs.china.huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/14/2017 02:18 AM, Zengtao (B) wrote: > Hi > > Currently, the ion mapped to userspace will be forced with VM_IO and VM_PFNMAP flags. > When I use the ion memory to do the direct-io, it will fail when reaching the get_user_pages, > > Back to the VM_IO and VM_PFNMAP flag, there two flags are introduced by the remap_pfn_range called > by the ion_heap_mmap_user. > > From my point of view, all ion memory(cma/vmalloc/system heap) are managed by linux vm, it > is not reasonable to have the VM_IO and VM_PFNMAP flag, but I don't any suitable function > to replace the remap_pfn_range, any suggestions? > > Thanks && Regards > > Zengtao > The carveout heap is omitted from your list of 'all ion memory'. At one time, carveout memory was not backed by struct pages so I suspect this is a holdover from then. This would probably be better served by using vm_insert_page and handling higher order pages properly. Thanks, Laura