From patchwork Thu Jun 13 10:44:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 10991559 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 8BE341398 for ; Thu, 13 Jun 2019 10:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 740111FFD9 for ; Thu, 13 Jun 2019 10:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 641D228AA2; Thu, 13 Jun 2019 10:45:44 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8ED951FFD9 for ; Thu, 13 Jun 2019 10:45:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39F426B0007; Thu, 13 Jun 2019 06:45:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 328E66B000A; Thu, 13 Jun 2019 06:45:42 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F05E6B000D; Thu, 13 Jun 2019 06:45:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id D9F036B0007 for ; Thu, 13 Jun 2019 06:45:41 -0400 (EDT) Received: by mail-pl1-f198.google.com with SMTP id 59so11696555plb.14 for ; Thu, 13 Jun 2019 03:45:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=YHBzv4ECslLKpMkzoxjS6aoXKy/SFXtprHmV+JrqNk0=; b=MoXgNcSkBfEC1euuXA0ZDOZSWwENwX9ralV3nU/ISMw/lvpCNRXDgfWDGBLx+TYu6z kSw52uWv5rTycvMb8ft0qDsmr8fixVegundROqbE/eto0qMo92cX78OMF0gnkxULKETu oVQVQU0CXW/pPkI9nUEUYHffwJEtpnUv+wFU9hbwVIu9ZVYIfSlXexqvCoL1NCK9VjHe 8xC+1RCGq13NDuzSZjXhxDBUp5/m5CSySSijR21jVfHnYjm/RjEh4+7/Mxv74baKmM2M IxHBpqKCJXz2Z9FJJhJWX2sIqPmn/fDaAGc7AKNNvlUTn4s3t7yIh18cO8Eua+Q80BjH q04A== X-Gm-Message-State: APjAAAXWlD3v4p7cZqN2z6RAO/Ki9+rm4hWV3TlEWoPRi/XPEP038FXk 0wtAq5Pnx9kZ8Ket1/ceD56PjVSw96aQDhWrbMGyu0jYiOVE0A1xXWYo5oPoSYebmuvnPyLs3n+ 4UtJuK3n0U5Lnlr8S3QvCvdVJkJrwYaVm0i3m643Dkj6/W5oqPGphBowFIenp6m9jBg== X-Received: by 2002:a62:a508:: with SMTP id v8mr90175246pfm.87.1560422741480; Thu, 13 Jun 2019 03:45:41 -0700 (PDT) X-Received: by 2002:a62:a508:: with SMTP id v8mr90175161pfm.87.1560422740780; Thu, 13 Jun 2019 03:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560422740; cv=none; d=google.com; s=arc-20160816; b=Ahk31MogOoH2WzYZmsd8VwxIo3abS7zb/O0eSHzDfR9bQOL6cUXeijzseXkUUxPOUk mxPmYSj90/VFZ/9cku/FJgqhQU4KOrjuW9dOa5ejit5hd//ZoLw18XrbZh9JY/RiF5oc 1JVU9Rpn94XzdsloVZlzVsxrDCNMnqiwNUy/hfXJ8SSnYSNa25I+NoyoQM8QTUkRiUoS THwYMLfrvqJQU9DyTB10NvQlukSQPXyWLMKwz7nvGg0Ztq6aEG66BUDJNNgM8Ju/eJI0 qFyvovhZB6yy5vz25YzzC99GtHs1DwaXO7upmnyWnEh2pCW9zkhCV+k94tcyZOEsI07b yQOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=YHBzv4ECslLKpMkzoxjS6aoXKy/SFXtprHmV+JrqNk0=; b=B2LlbC9ELG5tCQMARxjZIp6fEa/QICZ9LWIFyQGe5WIVHeSNVOQXmLSn6jjG4RgFK3 L6tmct5IfGc+BZTMUhMH0iATyM+hSXl0B0T/O5tuNLFQZa/IPsQeai7JGLy1VyKlvHHk TBXs4ck3EVVPJin8rls17X74k1/DKCFDqui/qltGZZ+orPk4qpHgsIwDxw2SLVu6LDGX 7XAmVVqqDLpoYR5vj/L8q1PfqJcdbJIJ+8QoX44cnMHPeIeonaML4TiR6k9+v+UGBB+8 6Iy7WvKxxSc0H0Fm3XTb4kusm974UhWWzocaRHAY6E22kLiBZ3fHS6ntczAWXl9Avmco QrTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gh2zOgr9; spf=pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kernelfans@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l7sor2073461pgm.25.2019.06.13.03.45.40 for (Google Transport Security); Thu, 13 Jun 2019 03:45:40 -0700 (PDT) Received-SPF: pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gh2zOgr9; spf=pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kernelfans@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YHBzv4ECslLKpMkzoxjS6aoXKy/SFXtprHmV+JrqNk0=; b=Gh2zOgr9bu+Tzr0HnGQ+mDT8OkUXS31CoKZCiImvLZkkl6q69mzX6Y9Hn3GwoO8JVf dtnKcxCHRIlz5+dyReJS5fGrudHhR1zZynm80yuqVFRbEs+OiEX3gEGuTDcheVRn8aAJ j02IfSd5WvBKV+C64bc+54++b3dRRFC/o446EASAeitsSlmTAJPqetf5dKkuiS8lch3L 6fVAuTFAbWTED9Nh4GT4TtWektafSz9Mn5YtET6Rvl1yoSmtTWSY2RZ2jBlZGpgqGWLU vlFi7+o/YSBV+eCdzjBvwXH3WKZtd9XhuPGcxgmX+QM2DfIhEkp9bl8pREA7G5383mYx Rvog== X-Google-Smtp-Source: APXvYqxCcyskfrhNoa8a6tvucCyA7BESJMT49IgekYmQ2ko0v0dbnBSjI4RkW++kqxhqfDThrA+ABQ== X-Received: by 2002:a65:42c3:: with SMTP id l3mr30267732pgp.372.1560422739999; Thu, 13 Jun 2019 03:45:39 -0700 (PDT) Received: from mylaptop.redhat.com ([2408:8207:7825:dd90:9051:d949:55f9:678b]) by smtp.gmail.com with ESMTPSA id a13sm2813285pgh.6.2019.06.13.03.45.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 03:45:39 -0700 (PDT) From: Pingfan Liu To: linux-mm@kvack.org Cc: Pingfan Liu , Ira Weiny , Andrew Morton , Mike Rapoport , Dan Williams , Matthew Wilcox , John Hubbard , "Aneesh Kumar K.V" , Keith Busch , Christoph Hellwig , Shuah Khan , linux-kernel@vger.kernel.org Subject: [PATCHv4 0/3] mm/gup: fix omission of check on FOLL_LONGTERM in gup fast path Date: Thu, 13 Jun 2019 18:44:59 +0800 Message-Id: <1560422702-11403-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP These three patches have no dependency of each other, but related with the same purpose to improve get_user_page_fast(), patch [2/3]. Put them together. v3->v4: Place the check on FOLL_LONGTERM in gup_pte_range() instead of get_user_page_fast() Cc: Ira Weiny Cc: Andrew Morton Cc: Mike Rapoport Cc: Dan Williams Cc: Matthew Wilcox Cc: John Hubbard Cc: "Aneesh Kumar K.V" Cc: Keith Busch Cc: Christoph Hellwig Cc: Shuah Khan Cc: linux-kernel@vger.kernel.org Pingfan Liu (3): mm/gup: rename nr as nr_pinned in get_user_pages_fast() mm/gup: fix omission of check on FOLL_LONGTERM in gup fast path mm/gup_benchemark: add LONGTERM_BENCHMARK test in gup fast path mm/gup.c | 46 +++++++++++++++++++++++------- mm/gup_benchmark.c | 11 +++++-- tools/testing/selftests/vm/gup_benchmark.c | 10 +++++-- 3 files changed, 52 insertions(+), 15 deletions(-)