Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1617978imu; Tue, 20 Nov 2018 22:26:00 -0800 (PST) X-Google-Smtp-Source: AJdET5f+FAapk9+v63tDJLTsLG9pP1D48qpReRZseXyTTOMJrqvnG3KXxQWpw6JQkif8Z6bL3YLK X-Received: by 2002:a63:c64f:: with SMTP id x15mr4709872pgg.16.1542781560776; Tue, 20 Nov 2018 22:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542781560; cv=none; d=google.com; s=arc-20160816; b=0JYKnOEQ5yVfRkZAxUMu8w90fz2pWHmIXOgTamwoFVbK0gztq1nexhwwptkES6Gmnq f+ftbLerrQi5xRCCAEi31ejnTykLAFC3iZgjDztOkiBv2cvUmJDrIun5n9d1ACh9AkFy /ZIAvDzRPQGH1fWhMcc6UWkNaKrFn8pfrYGALXGgxI1aFT7fKOIunLYAfFickF1+1t2D n1vrcWGTTqSOmUVXhtN2NrHoOb062QHr95CAlVlJDxWBTjDqYIHaDc5zpwKtaZzUx8te dg30R2KgnbohhhqQrr4f2G+g2xWXfFJ8KAG7nIVoxLAULvcDk4/Toui6xXocOZo30LPg MxPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Ko9YARgAyRX78sxvri5f14/qXUZ8umuHqgdBI6JKvKQ=; b=TxskfID4Ood/j1Gul9T7MEKoeIvhHeIbY57AsStWYnxBre3KeZoewIQ3G/Au5TgPtF tbbvmdvUMvJqoFdgflhrnNmVYhTxJoU0Y9yEf0WMWxsBcnxw3CQ9DLLlEzFHFnEzd0l+ DsZ4HgKhH+2e3nW3qctVxudGNsZMvukoD7YkcWuN83JJZoIFmyopq4T6SWs2rf+UqcoM 7kxjtPRGZATh4cBRMBvDjx1QFBNFfIYq26ZbQlHfEqL/wDjClWydQ0XlGnVPoholtjyy BtkiQNWbegR9WyOCgDpT1xO79qXy9NvvmdKjzLkKS1pF3aCg0unK8pnioe5h0iXnhgS2 5RZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TPhAirnu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si22848137pgj.442.2018.11.20.22.25.45; Tue, 20 Nov 2018 22:26:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TPhAirnu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbeKUQ6P (ORCPT + 99 others); Wed, 21 Nov 2018 11:58:15 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44130 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbeKUQ6P (ORCPT ); Wed, 21 Nov 2018 11:58:15 -0500 Received: by mail-lj1-f193.google.com with SMTP id k19-v6so3763860lji.11; Tue, 20 Nov 2018 22:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ko9YARgAyRX78sxvri5f14/qXUZ8umuHqgdBI6JKvKQ=; b=TPhAirnuQVRxcsU9zhiqVoJsPisZdi0faYF7BAwY3KP7LCzu5UNMty21yxuwZlS0Rr +DTJowdJVhYAYOAQ6817knUEH9XUhsHoJIzcL4zLyqXcKIE3/d78gtGvh6/8YMWh9KTC 3b5r1YzebuWjfYw1kPy/socqJxOCBKe0cQJsQgl7XkqHZ+u2sSr5kpg1ggT8rAB+My1c p8NCR/aTd4kC103gmJODIXyqFNorBT0RGp8yRNUVEc+F7OecVTFQlNXC2Uamyl3v+dOQ yViz65XXunrK2isuSIP2jkgOGlZbbRIWQTTBgPJsT8uvj/oq2IUMepWIJbKafvIsuNX5 y/vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ko9YARgAyRX78sxvri5f14/qXUZ8umuHqgdBI6JKvKQ=; b=OdXTYRZKrf/emEzyWnM0ZS+fL0eFAA9SlE/9YzfY84OVg4wCTQZllRkOrKByRgDUBF GOhlWy3AicB/QJXlkTkySBIlwyB5hHRfksl1ACqb3x5ON5rlIHuji9T+ucz0iAkZzZIl kdueSqFJC15JH3B8IO/eKOQjO6wRakl7ryf+pAvV6TXT3EyJ23Et5CqvxTK2eqmeiNSC yuOAjfhdBC5tk12Cm0RiWqC+pxP5wefq61XKG50lyKTRvnCkma0/1J9pauPUINGEwksY XZxDGLVX1SMZ0QpYrRnyoTR11EoENJJvqVDlg7VMvajLI2hlhsn1bxdbha4FS4OXP62k LmPg== X-Gm-Message-State: AGRZ1gJlw2lamRKNDAnsPxtOXroN/mWWGtwUYQhQuhtE56RBTEflNgc8 43ge9tK7rpdpFZZtiJyvf72k0qEULcka4WNVw5I= X-Received: by 2002:a2e:9181:: with SMTP id f1-v6mr2989595ljg.64.1542781504802; Tue, 20 Nov 2018 22:25:04 -0800 (PST) MIME-Version: 1.0 References: <20181115154314.GA27850@jordon-HP-15-Notebook-PC> In-Reply-To: <20181115154314.GA27850@jordon-HP-15-Notebook-PC> From: Souptick Joarder Date: Wed, 21 Nov 2018 11:54:52 +0530 Message-ID: Subject: Re: [PATCH 0/9] Use vm_insert_range To: Andrew Morton , Matthew Wilcox , Michal Hocko , "Kirill A. Shutemov" , vbabka@suse.cz, Rik van Riel , Stephen Rothwell , rppt@linux.vnet.ibm.com, Peter Zijlstra , Russell King - ARM Linux , robin.murphy@arm.com, iamjoonsoo.kim@lge.com, treding@nvidia.com, Kees Cook , Marek Szyprowski , stefanr@s5r6.in-berlin.de, hjc@rock-chips.com, Heiko Stuebner , airlied@linux.ie, oleksandr_andrushchenko@epam.com, joro@8bytes.org, pawel@osciak.com, Kyungmin Park , mchehab@kernel.org, Boris Ostrovsky , Juergen Gross Cc: linux-kernel@vger.kernel.org, Linux-MM , linux-arm-kernel@lists.infradead.org, linux1394-devel@lists.sourceforge.net, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, xen-devel@lists.xen.org, iommu@lists.linux-foundation.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 9:09 PM Souptick Joarder wrote: > > Previouly drivers have their own way of mapping range of > kernel pages/memory into user vma and this was done by > invoking vm_insert_page() within a loop. > > As this pattern is common across different drivers, it can > be generalized by creating a new function and use it across > the drivers. > > vm_insert_range is the new API which will be used to map a > range of kernel memory/pages to user vma. > > All the applicable places are converted to use new vm_insert_range > in this patch series. > > Souptick Joarder (9): > mm: Introduce new vm_insert_range API > arch/arm/mm/dma-mapping.c: Convert to use vm_insert_range > drivers/firewire/core-iso.c: Convert to use vm_insert_range > drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range > drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range > iommu/dma-iommu.c: Convert to use vm_insert_range > videobuf2/videobuf2-dma-sg.c: Convert to use vm_insert_range > xen/gntdev.c: Convert to use vm_insert_range > xen/privcmd-buf.c: Convert to use vm_insert_range Any further comment on driver changes ? > > arch/arm/mm/dma-mapping.c | 21 ++++++----------- > drivers/firewire/core-iso.c | 15 ++---------- > drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 20 ++-------------- > drivers/gpu/drm/xen/xen_drm_front_gem.c | 20 +++++----------- > drivers/iommu/dma-iommu.c | 12 ++-------- > drivers/media/common/videobuf2/videobuf2-dma-sg.c | 23 ++++++------------- > drivers/xen/gntdev.c | 11 ++++----- > drivers/xen/privcmd-buf.c | 8 ++----- > include/linux/mm_types.h | 3 +++ > mm/memory.c | 28 +++++++++++++++++++++++ > mm/nommu.c | 7 ++++++ > 11 files changed, 70 insertions(+), 98 deletions(-) > > -- > 1.9.1 >