From mboxrd@z Thu Jan 1 00:00:00 1970 From: daeinki Date: Fri, 07 Jan 2011 04:19:54 +0000 Subject: Re: Memory sharing issue by application on V4L2 based device driver Message-Id: <4D26946A.60704@samsung.com> List-Id: References: <4D25BC22.6080803@samsung.com> <002201cbadfd$6d59e490$480dadb0$%han@samsung.com> <003201cbae19$bda3dfc0$38eb9f40$%han@samsung.com> In-Reply-To: <003201cbae19$bda3dfc0$38eb9f40$%han@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="euc-kr" Content-Transfer-Encoding: base64 To: linux-arm-kernel@lists.infradead.org SGVsbG8sIE1yLiBKb25naHVuLgoKcGxlYXNlLCBub3RlIHRoYXQgdXNlciBwcm9jZXNzJ3MgcGdk IGFuZCBkZXZpY2UncyBwZ2Qgd2l0aCBzeXN0ZW0gbW11CmFyZSBkaWZmZXJuZW50LiBmaXJzdCwg dGhlIG1lbW9yeSBhbGxvY2F0ZWQgYnkgdXNlciBtYWxsb2Mgc2hvdWxkIGJlCm1hcHBlZCB0byBw aHlzaWNhbCBtZW1vcnkgaW4gcGFnZSB1bml0IGJlY2F1c2UgdXNlciBhcHAgYWxzbyBzaG91bGQg YmUKYWNjZXNzZWQgdG8gb3duIG1lbW9yeSByZWdpb24uIGFuZCB3aGVuIG1hcHBpbmcgdGhlIHBo eXNpY2FsIG1lbW9yeSB0bwpkZXZpY2UgdmlydHVhbCBhZGRyZXNzLCBpdCBjcmVhdGVzIHBhZ2Ug dGFibGUgZW50cnkgZm9yIDY0ayBvciAxTSBhbmQKdGhlbiBjb3VsZCBtYXAgcGh5c2ljYWwgYWRk cmVzcyB0byB0aG9zZSBlbnRyaWVzLiB0aGVyZWZvcmUgd2hhdCB5b3UKbWVudGlvbiBoYXMgbm8g cHJvYmxlbS4KCmFjdHVhbCBpc3N1ZSBpcyBub3QgdG8gbmVlZCBkZW1lbmQgcGFnaW5nLCBzb21l IGlzc3VlcyB3ZSBkb24ndAp1bmRlcnN0YW5kIG1heSBleGlzdCBhc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Pj4KPj4+Pgo+Pj4+IGxldCdzIHNlZSB0aGUgZGlhZ3JhbSBiZWxvdy4KPj4+Pgo+Pj4+ ICAgICAgICAgICAgICAgIHVzZXIgYXBwbGljYXRpb24KPj4+Pgo+Pj4+ICAgICAgICAgICAgICAg ICAgICAgIHwKPj4+PiAgICAgICAgICAgICAgICAgICAgICB8Cj4+Pj4gICAgICAgICAgICAgICAg ICAgICAgfAo+Pj4+ICAgICAgICAgICAgICAgICAgICAgIHwKPj4+PiAgICAgICAgICAgICAgICAg ICAgICB8ICAxLiBVVkEoYWxsb2NhdGVkIGJ5IG1hbGxvYykKPj4+PiAgICAgICAgICAgICAgICAg ICAgICB8Cj4+Pj4gICAgICAgICAgICAgICAgICAgICAgfAo+Pj4+ICAgICAgICAgICAgICAgICAg ICChrHwvICAgICAgICAgICAgICAgICAgIDIuIFVWQShpbiBwYWdlIHVuaXQpCj4+Pj4KPj4+PiAg ICAgICAgLS0tLS0+IG11bHRpbWVkaWEgZGV2aWNlIGRyaXZlciAtLS0tLS0tLS0tLS0tLS0tLS0t PiB2aWRlb2J1ZjIKPj4+PiAgICAgICAgfAo+Pj4+ICAgICAgICB8ICAgICAgICB8ICAgICBeICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Cj4+Pj4gICAgICAgIHwgICAg ICAgIHwgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKPj4+ PiAgICAgICAgfCAgICAgICAgfCAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLQo+Pj4+ICAgICAgICB8ICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAzLiBQ QShpbiBwYWdlIHVuaXQpCj4+Pj4gICAgICAgIHwgICAgICAgIHwKPj4+PiAgICAgICAgfCAgICAg ICAgfCA0LiBQQShpbiBwYWdlIHVuaXQpCj4+Pj4gNi4gRFZBICB8ICAgICAgICB8Cj4+Pj4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lcm5lbC5vcmcvbWFqb3Jk b21vLWluZm8uaHRtbA== From mboxrd@z Thu Jan 1 00:00:00 1970 From: inki.dae@samsung.com (daeinki) Date: Fri, 07 Jan 2011 13:19:54 +0900 Subject: Memory sharing issue by application on V4L2 based device driver with system mmu. In-Reply-To: <003201cbae19$bda3dfc0$38eb9f40$%han@samsung.com> References: <4D25BC22.6080803@samsung.com> <002201cbadfd$6d59e490$480dadb0$%han@samsung.com> <003201cbae19$bda3dfc0$38eb9f40$%han@samsung.com> Message-ID: <4D26946A.60704@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello, Mr. Jonghun. please, note that user process's pgd and device's pgd with system mmu are differnent. first, the memory allocated by user malloc should be mapped to physical memory in page unit because user app also should be accessed to own memory region. and when mapping the physical memory to device virtual address, it creates page table entry for 64k or 1M and then could map physical address to those entries. therefore what you mention has no problem. actual issue is not to need demend paging, some issues we don't understand may exist as side effects. thank you. Jonghun Han ? ?: > Hello, > > That's not a translation issue. What I mention is the size of allocation. > The malloc uses 4KB page allocation and SYS.MMU can handle it. > But 64KB or 1MB physically contiguous memory is better than 4KB page in the > point of performance. > > Best regards, > >> -----Original Message----- >> From: linux-media-owner at vger.kernel.org [mailto:linux-media- >> owner at vger.kernel.org] On Behalf Of InKi Dae >> Sent: Friday, January 07, 2011 11:17 AM >> To: Jonghun Han >> Cc: linux-media at vger.kernel.org; linux-arm-kernel at lists.infradead.org; > linux-fbdev; >> kyungmin.park at samsung.com >> Subject: Re: Memory sharing issue by application on V4L2 based device > driver >> with system mmu. >> >> thank you for your comments. >> >> your second comment has no any problem as I said before, user virtual > addess >> could be translated in page unit. but the problem, as you said, is that > when cpu >> access to the memory in user mode, the memory allocated by malloc, page > fault >> occurs so we can't find pfn to user virtual address. I missed that. but I > think we >> could resolve this one. >> >> as before, user application allocates memory through malloc function and > then >> send it to device driver(using userptr feature). if the pfn is null when > device driver >> translated user virtual address in page unit then it allocates phsical > memory in >> page unit using some interface such as alloc_page() and then mapping > them. when >> pfn is null, to check it and allocate physical memory in page unit could > be >> processed by videobuf2. >> >> of course, videobuf2 has no any duty considered for system mmu. so >> videobuf2 just provides callback for 3rd party and any platform with > system mmu >> such as Samsung SoC C210 implements the function(allocating physical > memory >> and mapping it) and registers it to callback of videobuf2. by doing so, I > think your >> first comment could be cleared. >> >> please, feel free to give me your opinion and pointing out. >> >> thank you. >> >> 2011? 1? 7? ?? 8:57, Jonghun Han ?? ?: >>> Hello, >>> >>> There are two reasons why malloc isn't suitable for it. >>> >>> The first is that malloc doesn't allocate memory when malloc is called. >>> So driver or vb2 cannot find PFN for it in the VIDIOC_QBUF. >>> >>> The second is that malloc uses 4KB page allocation. >>> SYS.MMU(IO-MMU) can handle scattered memory. But it has a penalty when >>> TLB miss is occurred. >>> So as possible as physically contiguous pages are needed for >>> performance enhancement. >>> >>> So new allocator which can clear two main issues is needed. >>> >>> Best regards, >>> >>>> -----Original Message----- >>>> From: linux-media-owner at vger.kernel.org [mailto:linux-media- >>>> owner at vger.kernel.org] On Behalf Of InKi Dae >>>> Sent: Thursday, January 06, 2011 10:25 PM >>>> To: linux-media at vger.kernel.org >>>> Subject: Memory sharing issue by application on V4L2 based device >>>> driver >>> with >>>> system mmu. >>>> >>>> Hello, all. >>>> >>>> I'd like to discuss memory sharing issue by application on v4l2 based >>> device driver >>>> with system mmu and get some advices about that. >>>> >>>> Now I am working on Samsung SoC C210 platform and this platform has >>>> some multimedia devices with system mmu such as fimc, and mfc also we >>>> have implemented device drivers for them. those drivers are based on >>>> V4L2 >>> framework >>>> with videobuf2. for system mmu of each device, we used VCM(Virtual >>> Contiguous >>>> Memory) framework. >>>> >>>> Simply, VCM framework provides physical memory, device virtual >>>> memory allocation and memory mapping between them. when device driver >>>> is >>> initialized or >>>> operated by user application, each driver allocates physical memory >>>> and >>> device >>>> virtual memory and then mapping using VCM interface. >>>> >>>> refer to below link for more detail. >>>> http://www.spinics.net/lists/linux-media/msg26548.html >>>> >>>> Physical memory access process is as the following. >>>> DVA PA >>>> device --------------> system mmu ------------------> physical memory >>>> >>>> DVA : device virtual address. >>>> PA : physical address. >>>> >>>> like this, device virtual address should be set to buffer(source or >>>> destination) register of multimedia device. >>>> >>>> the problem is that application want to share own memory with any >>>> device >>> driver to >>>> avoid memory copy. in other words, user-allocated memory could be >>>> source >>> or >>>> destination memory of multimedia device driver. >>>> >>>> >>>> let's see the diagram below. >>>> >>>> user application >>>> >>>> | >>>> | >>>> | >>>> | >>>> | 1. UVA(allocated by malloc) >>>> | >>>> | >>>> ?|/ 2. UVA(in page unit) >>>> >>>> -----> multimedia device driver -------------------> videobuf2 >>>> | >>>> | | ^ | >>>> | | | | >>>> | | ------------------------------------------- >>>> | | 3. PA(in page unit) >>>> | | >>>> | | 4. PA(in page unit) >>>> 6. DVA | | >>>> | | >>>> | | >>>> | ?|/ >>>> | >>>> | Virtual Contiguous Memory --------- >>>> | | >>>> | | ^ | >>>> | | | | 5. map PA to DVA >>>> | | | | >>>> | | | | >>>> ------------- ------------------------- >>>> >>>> PA : physical address. >>>> UVA : user virtual address. >>>> DVA : device virtual address. >>>> >>>> 1. user application allocates user space memory through malloc >>>> function >>> and >>>> sending it to multimedia device driver based on v4l2 framework >>>> through >>> userptr >>>> feature. >>>> >>>> 2, 3. multimedia device driver gets translated physical address from >>>> videobuf2 framework in page unit. >>>> >>>> 4, 5. multimedia device driver gets allocated device virtual address >>>> and >>> mapping it >>>> to physical address and then mapping them through VCM interface. >>>> >>>> 6. multimedia device driver sets device virtual address from VCM to >>> buffer register. >>>> the diagram above is fully theoretical so I wonder that this way is >>> reasonable and >>>> has some problems also what should be considered. >>>> >>>> thank you for your interesting. >>>> >>>> _______________________________________________ >>>> linux-arm-kernel mailing list >>>> linux-arm-kernel at lists.infradead.org >>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe >>>> linux-media" in >>> the body >>>> of a message to majordomo at vger.kernel.org More majordomo info at >>>> http://vger.kernel.org/majordomo-info.html >>> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body >> of a message to majordomo at vger.kernel.org More majordomo info at >> http://vger.kernel.org/majordomo-info.html > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mailout2.samsung.com ([203.254.224.25]:34992 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752957Ab1AGET6 (ORCPT ); Thu, 6 Jan 2011 23:19:58 -0500 MIME-version: 1.0 Content-type: text/plain; charset=EUC-KR Date: Fri, 07 Jan 2011 13:19:54 +0900 From: daeinki Subject: Re: Memory sharing issue by application on V4L2 based device driver with system mmu. In-reply-to: <003201cbae19$bda3dfc0$38eb9f40$%han@samsung.com> To: Jonghun Han Cc: 'InKi Dae' , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 'linux-fbdev' , kyungmin.park@samsung.com Message-id: <4D26946A.60704@samsung.com> Content-transfer-encoding: 8BIT References: <4D25BC22.6080803@samsung.com> <002201cbadfd$6d59e490$480dadb0$%han@samsung.com> <003201cbae19$bda3dfc0$38eb9f40$%han@samsung.com> List-ID: Sender: Hello, Mr. Jonghun. please, note that user process's pgd and device's pgd with system mmu are differnent. first, the memory allocated by user malloc should be mapped to physical memory in page unit because user app also should be accessed to own memory region. and when mapping the physical memory to device virtual address, it creates page table entry for 64k or 1M and then could map physical address to those entries. therefore what you mention has no problem. actual issue is not to need demend paging, some issues we don't understand may exist as side effects. thank you. Jonghun Han ¾´ ±Û: > Hello, > > That's not a translation issue. What I mention is the size of allocation. > The malloc uses 4KB page allocation and SYS.MMU can handle it. > But 64KB or 1MB physically contiguous memory is better than 4KB page in the > point of performance. > > Best regards, > >> -----Original Message----- >> From: linux-media-owner@vger.kernel.org [mailto:linux-media- >> owner@vger.kernel.org] On Behalf Of InKi Dae >> Sent: Friday, January 07, 2011 11:17 AM >> To: Jonghun Han >> Cc: linux-media@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > linux-fbdev; >> kyungmin.park@samsung.com >> Subject: Re: Memory sharing issue by application on V4L2 based device > driver >> with system mmu. >> >> thank you for your comments. >> >> your second comment has no any problem as I said before, user virtual > addess >> could be translated in page unit. but the problem, as you said, is that > when cpu >> access to the memory in user mode, the memory allocated by malloc, page > fault >> occurs so we can't find pfn to user virtual address. I missed that. but I > think we >> could resolve this one. >> >> as before, user application allocates memory through malloc function and > then >> send it to device driver(using userptr feature). if the pfn is null when > device driver >> translated user virtual address in page unit then it allocates phsical > memory in >> page unit using some interface such as alloc_page() and then mapping > them. when >> pfn is null, to check it and allocate physical memory in page unit could > be >> processed by videobuf2. >> >> of course, videobuf2 has no any duty considered for system mmu. so >> videobuf2 just provides callback for 3rd party and any platform with > system mmu >> such as Samsung SoC C210 implements the function(allocating physical > memory >> and mapping it) and registers it to callback of videobuf2. by doing so, I > think your >> first comment could be cleared. >> >> please, feel free to give me your opinion and pointing out. >> >> thank you. >> >> 2011³â 1¿ù 7ÀÏ ¿ÀÀü 8:57, Jonghun Han ´ÔÀÇ ¸»: >>> Hello, >>> >>> There are two reasons why malloc isn't suitable for it. >>> >>> The first is that malloc doesn't allocate memory when malloc is called. >>> So driver or vb2 cannot find PFN for it in the VIDIOC_QBUF. >>> >>> The second is that malloc uses 4KB page allocation. >>> SYS.MMU(IO-MMU) can handle scattered memory. But it has a penalty when >>> TLB miss is occurred. >>> So as possible as physically contiguous pages are needed for >>> performance enhancement. >>> >>> So new allocator which can clear two main issues is needed. >>> >>> Best regards, >>> >>>> -----Original Message----- >>>> From: linux-media-owner@vger.kernel.org [mailto:linux-media- >>>> owner@vger.kernel.org] On Behalf Of InKi Dae >>>> Sent: Thursday, January 06, 2011 10:25 PM >>>> To: linux-media@vger.kernel.org >>>> Subject: Memory sharing issue by application on V4L2 based device >>>> driver >>> with >>>> system mmu. >>>> >>>> Hello, all. >>>> >>>> I'd like to discuss memory sharing issue by application on v4l2 based >>> device driver >>>> with system mmu and get some advices about that. >>>> >>>> Now I am working on Samsung SoC C210 platform and this platform has >>>> some multimedia devices with system mmu such as fimc, and mfc also we >>>> have implemented device drivers for them. those drivers are based on >>>> V4L2 >>> framework >>>> with videobuf2. for system mmu of each device, we used VCM(Virtual >>> Contiguous >>>> Memory) framework. >>>> >>>> Simply, VCM framework provides physical memory, device virtual >>>> memory allocation and memory mapping between them. when device driver >>>> is >>> initialized or >>>> operated by user application, each driver allocates physical memory >>>> and >>> device >>>> virtual memory and then mapping using VCM interface. >>>> >>>> refer to below link for more detail. >>>> http://www.spinics.net/lists/linux-media/msg26548.html >>>> >>>> Physical memory access process is as the following. >>>> DVA PA >>>> device --------------> system mmu ------------------> physical memory >>>> >>>> DVA : device virtual address. >>>> PA : physical address. >>>> >>>> like this, device virtual address should be set to buffer(source or >>>> destination) register of multimedia device. >>>> >>>> the problem is that application want to share own memory with any >>>> device >>> driver to >>>> avoid memory copy. in other words, user-allocated memory could be >>>> source >>> or >>>> destination memory of multimedia device driver. >>>> >>>> >>>> let's see the diagram below. >>>> >>>> user application >>>> >>>> | >>>> | >>>> | >>>> | >>>> | 1. UVA(allocated by malloc) >>>> | >>>> | >>>> ¡¬|/ 2. UVA(in page unit) >>>> >>>> -----> multimedia device driver -------------------> videobuf2 >>>> | >>>> | | ^ | >>>> | | | | >>>> | | ------------------------------------------- >>>> | | 3. PA(in page unit) >>>> | | >>>> | | 4. PA(in page unit) >>>> 6. DVA | | >>>> | | >>>> | | >>>> | ¡¬|/ >>>> | >>>> | Virtual Contiguous Memory --------- >>>> | | >>>> | | ^ | >>>> | | | | 5. map PA to DVA >>>> | | | | >>>> | | | | >>>> ------------- ------------------------- >>>> >>>> PA : physical address. >>>> UVA : user virtual address. >>>> DVA : device virtual address. >>>> >>>> 1. user application allocates user space memory through malloc >>>> function >>> and >>>> sending it to multimedia device driver based on v4l2 framework >>>> through >>> userptr >>>> feature. >>>> >>>> 2, 3. multimedia device driver gets translated physical address from >>>> videobuf2 framework in page unit. >>>> >>>> 4, 5. multimedia device driver gets allocated device virtual address >>>> and >>> mapping it >>>> to physical address and then mapping them through VCM interface. >>>> >>>> 6. multimedia device driver sets device virtual address from VCM to >>> buffer register. >>>> the diagram above is fully theoretical so I wonder that this way is >>> reasonable and >>>> has some problems also what should be considered. >>>> >>>> thank you for your interesting. >>>> >>>> _______________________________________________ >>>> linux-arm-kernel mailing list >>>> linux-arm-kernel@lists.infradead.org >>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe >>>> linux-media" in >>> the body >>>> of a message to majordomo@vger.kernel.org More majordomo info at >>>> http://vger.kernel.org/majordomo-info.html >>> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body >> of a message to majordomo@vger.kernel.org More majordomo info at >> http://vger.kernel.org/majordomo-info.html > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >