From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753859AbdBPGty (ORCPT ); Thu, 16 Feb 2017 01:49:54 -0500 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:46118 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486AbdBPGtx (ORCPT ); Thu, 16 Feb 2017 01:49:53 -0500 X-RM-TRANSID: 2eec58a54b819ee-b9eb5 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee758a54b80697-a4c2f Subject: Re: [PATCH] uio: add UIO_MEM_CUSTOM support To: Andy Grover , Greg KH References: <1487133786-25545-1-git-send-email-lixiubo@cmss.chinamobile.com> <20170215171937.GA4705@kroah.com> <01c3f279-813a-cc66-0760-b7c1fbfd6857@redhat.com> Cc: mchristi@redhat.com, namei.unix@gmail.com, linux-kernel@vger.kernel.org From: Xiubo Li Message-ID: <6e0256fa-6366-229c-c18d-ea8cfb6ef52d@cmss.chinamobile.com> Date: Thu, 16 Feb 2017 14:49:40 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <01c3f279-813a-cc66-0760-b7c1fbfd6857@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> buffer(uio0 --> map0). Currently the TCMU will using the fixed small >> size map >> area as the ring buffer, but this will be the bottleneck for high iops. >> >> Without knowing how large it is enough, so the new scheme will use the >> fixed >> small ring buffer area(about 64M ~ 128M) + dynamically "growing" ring >> buffer >> area(about 1.5G). > The following code is in uio_mmap() in uio.c: > > if (idev->info->mmap) { > ret = idev->info->mmap(idev->info, vma); > return ret; > } > > switch (idev->info->mem[mi].memtype) { > case UIO_MEM_PHYS: > return uio_mmap_physical(vma); > case UIO_MEM_LOGICAL: > case UIO_MEM_VIRTUAL: > return uio_mmap_logical(vma); > default: > return -EINVAL; > } > > We already have the equivalent of a CUSTOM memtype because TCMU sets the > info->mmap fn, overriding uio's default handling choices in favor of its > own. For the driver like TCMU, the UIO_MEM_NONE could be used with implementing its own ->mmap() magic, instead of adding new UIO_MEM_CUSTOM. But will the semantic be clearer by using _CUSTOM instead of _NONE ? Thanks, BRs Xiubo > HTH -- Regards -- Andy >