From mboxrd@z Thu Jan 1 00:00:00 1970 From: kosaki.motohiro@gmail.com (KOSAKI Motohiro) Date: Wed, 30 May 2012 03:22:53 -0400 Subject: [PATCHv2 4/4] ARM: dma-mapping: remove custom consistent dma region In-Reply-To: <019401cd3e34$0c6af4d0$2540de70$%szyprowski@samsung.com> References: <1337252085-22039-1-git-send-email-m.szyprowski@samsung.com> <1337252085-22039-5-git-send-email-m.szyprowski@samsung.com> <4FC5659D.6040805@gmail.com> <019401cd3e34$0c6af4d0$2540de70$%szyprowski@samsung.com> Message-ID: <4FC5CACD.6000105@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org (5/30/12 3:15 AM), Marek Szyprowski wrote: > Hello, > > On Wednesday, May 30, 2012 2:11 AM KOSAKI Motohiro wrote: > >>> static void * >>> __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot, >>> const void *caller) >>> { >>> - struct arm_vmregion *c; >>> - size_t align; >>> - int bit; >>> + struct vm_struct *area; >>> + unsigned long addr; >>> >>> - if (!consistent_pte) { >>> - printk(KERN_ERR "%s: not initialised\n", __func__); >>> + area = get_vm_area_caller(size, VM_DMA | VM_USERMAP, caller); >> >> In this patch, VM_DMA is only used here. So, is this no effect? > > I introduced it mainly to let user know which areas have been allocated by the dma-mapping api. vma->flags are limited resource, it has only 32 (or 64) bits. Please don't use it for such unimportant thing. > I also plan to add a check suggested by Minchan Kim in __dma_free_remap() if the vmalloc area > have been in fact allocated with VM_DMA set. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx152.postini.com [74.125.245.152]) by kanga.kvack.org (Postfix) with SMTP id ACC046B005C for ; Wed, 30 May 2012 03:22:58 -0400 (EDT) Received: by qcsd16 with SMTP id d16so3200219qcs.14 for ; Wed, 30 May 2012 00:22:57 -0700 (PDT) Message-ID: <4FC5CACD.6000105@gmail.com> Date: Wed, 30 May 2012 03:22:53 -0400 From: KOSAKI Motohiro MIME-Version: 1.0 Subject: Re: [PATCHv2 4/4] ARM: dma-mapping: remove custom consistent dma region References: <1337252085-22039-1-git-send-email-m.szyprowski@samsung.com> <1337252085-22039-5-git-send-email-m.szyprowski@samsung.com> <4FC5659D.6040805@gmail.com> <019401cd3e34$0c6af4d0$2540de70$%szyprowski@samsung.com> In-Reply-To: <019401cd3e34$0c6af4d0$2540de70$%szyprowski@samsung.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Marek Szyprowski Cc: 'KOSAKI Motohiro' , linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, 'Kyungmin Park' , 'Arnd Bergmann' , 'Russell King - ARM Linux' , 'Chunsang Jeong' , 'Krishna Reddy' , 'Konrad Rzeszutek Wilk' , 'Hiroshi Doyu' , 'Subash Patel' (5/30/12 3:15 AM), Marek Szyprowski wrote: > Hello, > > On Wednesday, May 30, 2012 2:11 AM KOSAKI Motohiro wrote: > >>> static void * >>> __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot, >>> const void *caller) >>> { >>> - struct arm_vmregion *c; >>> - size_t align; >>> - int bit; >>> + struct vm_struct *area; >>> + unsigned long addr; >>> >>> - if (!consistent_pte) { >>> - printk(KERN_ERR "%s: not initialised\n", __func__); >>> + area = get_vm_area_caller(size, VM_DMA | VM_USERMAP, caller); >> >> In this patch, VM_DMA is only used here. So, is this no effect? > > I introduced it mainly to let user know which areas have been allocated by the dma-mapping api. vma->flags are limited resource, it has only 32 (or 64) bits. Please don't use it for such unimportant thing. > I also plan to add a check suggested by Minchan Kim in __dma_free_remap() if the vmalloc area > have been in fact allocated with VM_DMA set. -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757027Ab2E3HW7 (ORCPT ); Wed, 30 May 2012 03:22:59 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:46474 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756937Ab2E3HW6 (ORCPT ); Wed, 30 May 2012 03:22:58 -0400 Message-ID: <4FC5CACD.6000105@gmail.com> Date: Wed, 30 May 2012 03:22:53 -0400 From: KOSAKI Motohiro User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Marek Szyprowski CC: "'KOSAKI Motohiro'" , linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "'Kyungmin Park'" , "'Arnd Bergmann'" , "'Russell King - ARM Linux'" , "'Chunsang Jeong'" , "'Krishna Reddy'" , "'Konrad Rzeszutek Wilk'" , "'Hiroshi Doyu'" , "'Subash Patel'" Subject: Re: [PATCHv2 4/4] ARM: dma-mapping: remove custom consistent dma region References: <1337252085-22039-1-git-send-email-m.szyprowski@samsung.com> <1337252085-22039-5-git-send-email-m.szyprowski@samsung.com> <4FC5659D.6040805@gmail.com> <019401cd3e34$0c6af4d0$2540de70$%szyprowski@samsung.com> In-Reply-To: <019401cd3e34$0c6af4d0$2540de70$%szyprowski@samsung.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (5/30/12 3:15 AM), Marek Szyprowski wrote: > Hello, > > On Wednesday, May 30, 2012 2:11 AM KOSAKI Motohiro wrote: > >>> static void * >>> __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot, >>> const void *caller) >>> { >>> - struct arm_vmregion *c; >>> - size_t align; >>> - int bit; >>> + struct vm_struct *area; >>> + unsigned long addr; >>> >>> - if (!consistent_pte) { >>> - printk(KERN_ERR "%s: not initialised\n", __func__); >>> + area = get_vm_area_caller(size, VM_DMA | VM_USERMAP, caller); >> >> In this patch, VM_DMA is only used here. So, is this no effect? > > I introduced it mainly to let user know which areas have been allocated by the dma-mapping api. vma->flags are limited resource, it has only 32 (or 64) bits. Please don't use it for such unimportant thing. > I also plan to add a check suggested by Minchan Kim in __dma_free_remap() if the vmalloc area > have been in fact allocated with VM_DMA set.