From patchwork Thu Sep 6 10:22:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 10590409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E387F112B for ; Thu, 6 Sep 2018 10:22:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE6C82A3BB for ; Thu, 6 Sep 2018 10:22:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B28122A5AA; Thu, 6 Sep 2018 10:22:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 422FF2A3BB for ; Thu, 6 Sep 2018 10:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bjc54HFbC2g7yDYWFJKgLvOISXGmj1kEnu17qf/hchg=; b=c9NW6El6Echoy9 3iQU4xTkc4vsH2TmmL1V0Tebj5B69miw2d0g9NXj9L3z9C/HdC/KXHU79oUAg23YiMa+NP7/0iqFi 5e5vKyOqNF8q7/yCpY5J+5VbGHJpiVVOfVWjqLRYInJxMLC+24417ahAdxklZOpLlHu6p48ApZayV WuO2f5R1c8/OGKiIrGHHYuvgDmwGqMWGe757qQ6rqk7L2XkFVDf676OthMWZcmSCtih4731Jnv1dM pRcxFIGLck3WBDc01D2Es8SWV0DkEIHI4PcIy9RldWmdyH53RHOLh+vXxTSL5Rph3K4LMPQJ0/aE0 4OVFdEoWf5pY7fFCKY1w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxrQx-0003Wc-Gv; Thu, 06 Sep 2018 10:22:43 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxrQu-0003K4-Ab for linux-arm-kernel@lists.infradead.org; Thu, 06 Sep 2018 10:22:41 +0000 Received: by mail-pf1-x442.google.com with SMTP id x17-v6so5064332pfh.5 for ; Thu, 06 Sep 2018 03:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oUV3jnVtIfcmlpjpbZ7tv+73twNtVA8egCP+4hxOgSQ=; b=ZaMmXxyF8ITJN+h/1LiB3qwm7g69o/xFjx9rRzlANmjeJ66jhHwNJq2ZWoIuUEKxBK PpmjYAwWTaYckSzF5Pv8IWvPlgeTSGw4b1uV51swJ6uoZIrRVHDIQKc2e5mM3BZT7szF G2/ooObiiIxJ85bBy+04DRz/l7qjMjU9Zpo8ZEI9AR6uRUPqxKQ671sSEgsyQ97Y6wLK 66J9gwK/6EZnT4TFFL1xCUeovwRmAxu9kZ4zsTbocFCVhEwgP2UrNy960XsYHbF5rOQm 3/bxqGREvzymCULSXf1v0ZAoZbc5k0owGq4CsU7izRE0NpYZ84g5U00/8zJnpYD8LUXr vYig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=oUV3jnVtIfcmlpjpbZ7tv+73twNtVA8egCP+4hxOgSQ=; b=i/ZFbNglgvS9CEhUMsXtTcVhiELNOGIdqzd5ztsj3XTiqsNROcfOxP/xsg5yaaegeI CVnuLFDT5x08w9gw83zvtcNKeNxM8YC8/hLc8dXNd6Be3XsIjqkMzeZZtM/5tl8YNajD ffEmKM9PgW9UGusyEazUrAGFPjGNxmAmXcNQh0/+PMecwr9yj0RKKY6crzjevpGTrsmt J9DXhwXDRXSPN2vgO/n2l0pqzH+ni3USZPKHo95GSPNuNzZZBhH9ug5jcYB4SnKuuYw5 18Gu4uYwLjU5wP5ymbPJjq/yNY1oA0LUJrRdL/AvXBPFkULpZST72VHGNRnNJJXIFPMY QCQA== X-Gm-Message-State: APzg51AghAcmGzs+B3odZS3YcU2KYUWZN/CA01++iut7xo7DSIYN3hyR TzseMV87cO5Trj6b3tHY0IU= X-Google-Smtp-Source: ANB0VdamdUG0YGTN2sft+92C4x3kBY7vCWEhwpLLYSvCQK6hBoxWzKAv8vExC5qAYgW2iTPqUF93zQ== X-Received: by 2002:a63:706:: with SMTP id 6-v6mr1948594pgh.137.1536229348392; Thu, 06 Sep 2018 03:22:28 -0700 (PDT) Received: from bbox-2.seo.corp.google.com ([2401:fa00:d:10:affa:813f:5380:6613]) by smtp.gmail.com with ESMTPSA id h82-v6sm7909555pfa.173.2018.09.06.03.22.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Sep 2018 03:22:26 -0700 (PDT) From: Minchan Kim To: Andrew Morton , linux@armlinux.org.uk Subject: [RFC 0/3] arm: support get_user_pages_fast Date: Thu, 6 Sep 2018 19:22:09 +0900 Message-Id: <20180906102212.218294-1-minchan@kernel.org> X-Mailer: git-send-email 2.19.0.rc1.350.ge57e33dbd1-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180906_032240_393617_3093A1BA X-CRM114-Status: GOOD ( 12.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: steve.capper@linaro.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, Minchan Kim , android-treble-mediatek-ext@partner.android.com, kernel-team@android.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Recently, I got a report get_user_pages_fast helps app's launching time due to reducing uninterruptible sleep time because it could reduce mmap_sem lock contentions when app is launching. To support gupf in ARM-non-LPAE, first patch reorders memory type table to use 5th bit of the page table. It seems we don't use the bit in ARMv6+ but it needs double check from maintainers. Second patch introduces L_PTE_SPECIAL for arm so that last patch can support get_user_pags_fast. I would greatly appreciate if guys review that I screw up something, especially, architecture stuffs. Thanks. Minchan Kim (3): arm: mm: reordering memory type table arm: mm: introduce L_PTE_SPECIAL arm: mm: support get_user_pages_fast arch/arm/Kconfig | 2 +- arch/arm/include/asm/pgtable-2level.h | 16 +- arch/arm/include/asm/pgtable-3level.h | 6 - arch/arm/include/asm/pgtable.h | 13 ++ arch/arm/mm/Makefile | 6 + arch/arm/mm/gup.c | 221 ++++++++++++++++++++++++++ arch/arm/mm/proc-macros.S | 16 +- 7 files changed, 261 insertions(+), 19 deletions(-) create mode 100644 arch/arm/mm/gup.c