From patchwork Mon Apr 8 02:37:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 10888751 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 8E75C922 for ; Mon, 8 Apr 2019 02:38:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7380A28619 for ; Mon, 8 Apr 2019 02:38:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6781A2861C; Mon, 8 Apr 2019 02:38:20 +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,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 B5FAB26E55 for ; Mon, 8 Apr 2019 02:38:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 419DA6B0266; Sun, 7 Apr 2019 22:38:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3CA416B0269; Sun, 7 Apr 2019 22:38:18 -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 2B96B6B026A; Sun, 7 Apr 2019 22:38:18 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by kanga.kvack.org (Postfix) with ESMTP id EB5706B0266 for ; Sun, 7 Apr 2019 22:38:17 -0400 (EDT) Received: by mail-pf1-f200.google.com with SMTP id y2so9394323pfn.13 for ; Sun, 07 Apr 2019 19:38:17 -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:mime-version; bh=tzoD7/UP5hn6NP3TTucEhZEEXF13u+yP12/csDZED9Y=; b=aBwiZ3BEcLp/rPDHgxg06oKNk8mJmfvU5/jB3bjFPKEu9r9RqTbXCIAIctwA8TflEs 5Q9/1TouryNJzobRqymFeYdh/nrQ2DKrpWbxDlJouNhtteWHVaDFjVBkT/fei2piBc/j choVbqduFsgagj5YEIleMoA4x6Mtjw2o3U3TOeW08WrVLEz8GN1PREvujnCyLIGdDYBP 8d7DEB0rEAoL9/GkkxpaPlDi7uneDbaOLXnEmZXnS/SqQCIsmRXXdpmMPFyhmUgrfnui 4jtNwutF7MVJPwr6oGjoc4qMSXsLpRT5fT05j0ZRAKqihoQmCPD7/pkc2rE50g16KYrG uSyQ== X-Gm-Message-State: APjAAAUu/YBNBsTBUfjlPvmw1aRTcjQd9FCZVNTd+DQc3VrryZwg1wOV OcL9q8fReHofuws57t/jg9Ex02VzGIL7KFxqxRXJFlJkVfHqObFd62vV9zfcLynem2y7mMSsz5I q1GYf6C0qGpPgrfg0Vb5/97kro0SUye+bnBPMG4NFPkY1eSNQUnM1if/25RjYYFVIUA== X-Received: by 2002:aa7:8c13:: with SMTP id c19mr26844971pfd.225.1554691097380; Sun, 07 Apr 2019 19:38:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRO9UG2ABxMnbKaMk39cINYojoi8LUtbVNUjt+pEOmAFCrXWC18dWpgqYlUwulau6x9A8l X-Received: by 2002:aa7:8c13:: with SMTP id c19mr26844909pfd.225.1554691096493; Sun, 07 Apr 2019 19:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554691096; cv=none; d=google.com; s=arc-20160816; b=jJtekN6yJn158GGjL1zbq3iIW3VRVpHO8soQpHlDwbVSMgjkjuRerTkpHhIQ7Bkz66 XW4mDeHKm9bNO2AJhrJufjTFIHV/upKJQzBu4lyfedOOWmzMEalJWFru6a91qIKcdcVF 811T8Ll6Uu+T/rDV3O6kmmOrdOb5U5BUvBbqeI3wdhPlOlo7YVwtHWhT6JK/Xng/HO2E uChYSpGaHnd5MqUum30/h40LUVEBbIeE1muIFuA0n7/JvHJUdGhwonAaw2lgJX0MdXwv Pu0FjdSZXBQm9FdC+Evfp5YectAtSjF2KXzfmdWoD/9fpjEKzHfNM8hf+bCgmybE3BKY /ggw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=tzoD7/UP5hn6NP3TTucEhZEEXF13u+yP12/csDZED9Y=; b=erh7xPJ0Z1PTMZNkcdXHnTVRkW6lJfH6DtciFdsyXUJhneywO559mjQ/uItxExLNv8 UeKOR8g/3k1Oi0tvgW4y6CpQWEVdsKbnUPQpOrWYoOXGl71Ox+uspKqPpZtLFMka3xEV msMXHyHdXo/wKFAwNjmty1fHNMwDcJX0uXn0j5vXhIfjHufjCYu5NwnZQfaGjHSCQb2q 94J48oN59xHyVSm2E9Bztuu5MvlvxjcfgARCFIAnwJofYM6qD4Vx4JDU4Xiw7jZt3gE0 4W6A/JsvuWZk4BDukKKsy4SHRxjJPsXtLHMpTB5GjHKeOW6Zd7ek+Po3iC4CjqjyCxEi IgBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@iluvatar.ai header.s=key_2018 header.b=BsYKWOSx; spf=pass (google.com: domain of sjhuang@iluvatar.ai designates 103.91.158.24 as permitted sender) smtp.mailfrom=sjhuang@iluvatar.ai; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=iluvatar.ai Received: from smg.iluvatar.ai (owa.iluvatar.ai. [103.91.158.24]) by mx.google.com with ESMTP id y70si23704049pgd.359.2019.04.07.19.38.15 for ; Sun, 07 Apr 2019 19:38:16 -0700 (PDT) Received-SPF: pass (google.com: domain of sjhuang@iluvatar.ai designates 103.91.158.24 as permitted sender) client-ip=103.91.158.24; Authentication-Results: mx.google.com; dkim=pass header.i=@iluvatar.ai header.s=key_2018 header.b=BsYKWOSx; spf=pass (google.com: domain of sjhuang@iluvatar.ai designates 103.91.158.24 as permitted sender) smtp.mailfrom=sjhuang@iluvatar.ai; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=iluvatar.ai X-AuditID: 0a650161-78bff700000078a3-e6-5caab416f80f Received: from owa.iluvatar.ai (s-10-101-1-102.iluvatar.local [10.101.1.102]) by smg.iluvatar.ai (Symantec Messaging Gateway) with SMTP id 18.E3.30883.614BAAC5; Mon, 8 Apr 2019 10:38:14 +0800 (HKT) DKIM-Signature: v=1; a=rsa-sha256; d=iluvatar.ai; s=key_2018; c=relaxed/relaxed; t=1554691094; h=from:subject:to:date:message-id; bh=tzoD7/UP5hn6NP3TTucEhZEEXF13u+yP12/csDZED9Y=; b=BsYKWOSxOXzNpyWhKBsZ8PghVoln3efa5ivV1tuSkkiQm8YFTJay0XANorprR+Rzw790+iJRc0N sfs7a1RYeVx86aoORubAeds/CVpzfubkijCsZDshgj/+IhJS8AZvi0NOgs+GpKKGCbQDY5soOuKNo DAKqtoEAqrLTfCTXFM4= Received: from hsj-Precision-5520.iluvatar.local (10.101.199.253) by S-10-101-1-102.iluvatar.local (10.101.1.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Mon, 8 Apr 2019 10:38:14 +0800 From: Huang Shijie To: CC: , , , , , , , Huang Shijie Subject: [PATCH 1/2] mm/gup.c: fix the wrong comments Date: Mon, 8 Apr 2019 10:37:45 +0800 Message-ID: <20190408023746.16916-1-sjhuang@iluvatar.ai> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.101.199.253] X-ClientProxiedBy: S-10-101-1-105.iluvatar.local (10.101.1.105) To S-10-101-1-102.iluvatar.local (10.101.1.102) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsXClcqYpiu2ZVWMwakl2hZz1q9hs1h9t5/N Yv/T5ywWZ7pzLS7vmsNmcW/Nf1aLzRMWAInFXUwOHB6zGy6yeCze85LJ4/LZUo9Nnyaxe5yY 8ZvF4+PTWywel5qvs3t83iQXwBHFZZOSmpNZllqkb5fAlXF2nljBXr6Ks7ubmRoYD3N3MXJy SAiYSLycd5q5i5GLQ0jgBKPErysN7CAJZgEJiYMvXoAlWATeMklca/8MVdXKJHFu6ySwKjYB DYm5J+4yg9giAvISTV8esYMUMQvcYpTYMeEJC0hCWMBUYvXCrawgNouAisSp3U1sIDavgIXE uvaFjBB3yEus3nCAGSIuKHFyJkgvB9A2BYkXK7UgSpQkluydxQRhF0rMmLiCcQKjwCwkx85C 0r2AkWkVI39xbrpeZk5pWWJJYpFeYuYmRkiYJ+5gvNH5Uu8QowAHoxIP743sVTFCrIllxZW5 hxglOJiVRHh3TgUK8aYkVlalFuXHF5XmpBYfYpTmYFES5y2baBIjJJCeWJKanZpakFoEk2Xi 4JRqYJouIcXQe+yH0/Y9LvEL78nlMFkEtvP1WJ4unR2kHTZTL6/LOv1q8NdNlVwee822Ten5 vCys9Xaho3lIiZLgyd5qNgvFhL9blXapRt5bOkvi6ZSz1/P8tytKcOx3r7H8tynr+6q4Caev TZM9dzCp7diNWhfNPRJHtuUu3HeM9cGctzH3Jhz5G31QVXfj1oyp9asMUta6RV9JO+Rfyq7B eWqvnfRTpV/vXvKfSuj1N2898f2nRsmJLdbuETyV3j2px9U/XHvKN3PhrR/iTDE7Qqu+NfzZ YaD3y7bbYBbHvIY3ljJXTzD2WfArJeW28bgq14nvU1oz+2HZRhVPp2e99vVrmUK8FVaK/OFm X5EYpsRSnJFoqMVcVJwIAJl6forwAgAA 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 When CONFIG_HAVE_GENERIC_GUP is defined, the kernel will use its own get_user_pages_fast(). In the following scenario, we will may meet the bug in the DMA case: ..................... get_user_pages_fast(start,,, pages); ...... sg_alloc_table_from_pages(, pages, ...); ..................... The root cause is that sg_alloc_table_from_pages() requires the page order to keep the same as it used in the user space, but get_user_pages_fast() will mess it up. So change the comments, and make it more clear for the driver users. Signed-off-by: Huang Shijie --- mm/gup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 22acdd0f79ff..fb11ff90ba3b 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1129,10 +1129,6 @@ EXPORT_SYMBOL(get_user_pages_locked); * with: * * get_user_pages_unlocked(tsk, mm, ..., pages); - * - * It is functionally equivalent to get_user_pages_fast so - * get_user_pages_fast should be used instead if specific gup_flags - * (e.g. FOLL_FORCE) are not required. */ long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, struct page **pages, unsigned int gup_flags) @@ -2147,6 +2143,10 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, * If not successful, it will fall back to taking the lock and * calling get_user_pages(). * + * Note this routine may fill the pages array with entries in a + * different order than get_user_pages_unlocked(), which may cause + * issues for callers expecting the routines to be equivalent. + * * Returns number of pages pinned. This may be fewer than the number * requested. If nr_pages is 0 or negative, returns 0. If no pages * were pinned, returns -errno. From patchwork Mon Apr 8 02:37:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 10888753 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 5C4FE922 for ; Mon, 8 Apr 2019 02:38:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44DB926E55 for ; Mon, 8 Apr 2019 02:38:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38FF628619; Mon, 8 Apr 2019 02:38:23 +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,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 D63B226E55 for ; Mon, 8 Apr 2019 02:38:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C585D6B0269; Sun, 7 Apr 2019 22:38:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C071A6B026A; Sun, 7 Apr 2019 22:38:18 -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 ACE876B026B; Sun, 7 Apr 2019 22:38:18 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by kanga.kvack.org (Postfix) with ESMTP id 779996B0269 for ; Sun, 7 Apr 2019 22:38:18 -0400 (EDT) Received: by mail-pf1-f200.google.com with SMTP id j1so9414104pff.1 for ; Sun, 07 Apr 2019 19:38:18 -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:in-reply-to:references:mime-version; bh=+Ok9chkdp27Y5YtmQeTDw961jkYIka3EJirxsNMqBYg=; b=uMCWpYcrIktjgHK3fgmsZ64a4ID69F6LcGvXlBettqzUC+GahQg0h3nB8ZT4NuoyHx IMlWEUJkm7WQ6DNyGllIF2ZPakYsEZm4UuDe3lPqO3q2h9yonySYAnyvaWMqZ7HpW5fN JMhekzCDBB6/1uaPV6PY60ruu/UhKBrI5+GX7pfMUfAmrT2V/FXMmwIM9cAIHB6LuvpA Wq7GIpyoJev1mnrN2J6iWIFYhZhaIq+63ie8A4LKpKjfPDToPe8t7xDR3DWE1idQwL29 ngpt9omXJXjXq9QM4tyHGuPKTRssY6b6wFMRn1TDfWNFMrBlYskA5FKDVlzDJaiHmOHc h/5A== X-Gm-Message-State: APjAAAVDsCTSAwQYAvCfwiljI59TMB3qbcHjBZPRSigijCiL5g2noeHz DLZO2i57RtrZXpf4/VAc3abcl9/NgtYm6d5wQ/qIYEd4ztygcruy+5d+b+jRFlKvAv0pIIYuiuh IWd1ZUSIC6JcJalkeCSg1D2+3DdxET3R5ml/uNCg/2gqY/utUdT/pXbQPNY/hmg39mg== X-Received: by 2002:a63:3185:: with SMTP id x127mr26055276pgx.299.1554691098138; Sun, 07 Apr 2019 19:38:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwri8WdRaJJn1RU+XLcaHNKTsGkP7hDDunUHH1XRXlxHoON17oZbGmiePvPk6LJjLVVJt+b X-Received: by 2002:a63:3185:: with SMTP id x127mr26055220pgx.299.1554691097354; Sun, 07 Apr 2019 19:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554691097; cv=none; d=google.com; s=arc-20160816; b=smPrgH4V18qJRIJ+2GIFKc0Cj758EuSGX6HKO65KVu9zPLnI6gAJ7TGvcQ/rSYCZdX KGhzzTe55d6o5CzFlVp6H0sWtfQJLsSjus7XbZzfca0oOkuiPQBJ62UgO2toCSU49C7S zoLFBDzzWWwpes3e/DfwaBBkxu86jLS31M7QcPBmn3WODu0Fyq/NXqm+7StrjFjS3nrK sNSqLVbSQkPZA++0kKZT7bPTZw6VzZUUGev0aSrXHIBiITMkd84wsxzUrtuj4Apm8rXs efVPVeRnE8dFPxu4NuPf6Fu/fPgrZLj1MinMQYb/FBE8DF501Df1wU/L4Ph/7etYdFzj U29Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+Ok9chkdp27Y5YtmQeTDw961jkYIka3EJirxsNMqBYg=; b=dWULldL9uB0LBkbDIoo8a6EGbtBIGawV0xjY9jC4SYIhX08N7w6Fhl+jo+EzHWCThO nCFE4xly4boRsqYn4qpFfI9Occ78qB1NKVufbba3fbKW1Gdd7AjY2oMjn/YSDypZJhT7 uCL8j8kAlVo0AYth/fDCW/lkW/3noxOc6xKINhR+mi3D8KEjkrmSSEqE8anu87TdDWGE TB0kkz3XTKPXbK0lwcfzw2ZdsOAR0fp6WGEOly8cwNssl/H5vCadYOHu2h0fp4RnbJdS y8vp+XMoEiPrPiJ4e884ZZtAYbFCbemFyl+qHMuLOsMDdWrtlE8KrRMWG848OgrSCv8K DixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@iluvatar.ai header.s=key_2018 header.b=AU1KUwf+; spf=pass (google.com: domain of sjhuang@iluvatar.ai designates 103.91.158.24 as permitted sender) smtp.mailfrom=sjhuang@iluvatar.ai; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=iluvatar.ai Received: from smg.iluvatar.ai (owa.iluvatar.ai. [103.91.158.24]) by mx.google.com with ESMTP id y70si23704049pgd.359.2019.04.07.19.38.16 for ; Sun, 07 Apr 2019 19:38:17 -0700 (PDT) Received-SPF: pass (google.com: domain of sjhuang@iluvatar.ai designates 103.91.158.24 as permitted sender) client-ip=103.91.158.24; Authentication-Results: mx.google.com; dkim=pass header.i=@iluvatar.ai header.s=key_2018 header.b=AU1KUwf+; spf=pass (google.com: domain of sjhuang@iluvatar.ai designates 103.91.158.24 as permitted sender) smtp.mailfrom=sjhuang@iluvatar.ai; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=iluvatar.ai X-AuditID: 0a650161-773ff700000078a3-e7-5caab4179207 Received: from owa.iluvatar.ai (s-10-101-1-102.iluvatar.local [10.101.1.102]) by smg.iluvatar.ai (Symantec Messaging Gateway) with SMTP id A8.E3.30883.714BAAC5; Mon, 8 Apr 2019 10:38:15 +0800 (HKT) DKIM-Signature: v=1; a=rsa-sha256; d=iluvatar.ai; s=key_2018; c=relaxed/relaxed; t=1554691095; h=from:subject:to:date:message-id; bh=+Ok9chkdp27Y5YtmQeTDw961jkYIka3EJirxsNMqBYg=; b=AU1KUwf+Zui5EhUQvq/QC5qbPp2q+T2lBS/6sJVrspxov87D9kSQiQTtkeRNZDwrFsdHElnMip0 msK+EKc5CzFQ1Os1AWLZC2dgi84GzzQes1HRpchaESdHRPLMBD06hu85Y43J1ph1MmMa4YAnVaQea 8w9znxLNchlW8ECK9DM= Received: from hsj-Precision-5520.iluvatar.local (10.101.199.253) by S-10-101-1-102.iluvatar.local (10.101.1.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Mon, 8 Apr 2019 10:38:14 +0800 From: Huang Shijie To: CC: , , , , , , , Huang Shijie Subject: [PATCH 2/2] lib/scatterlist.c: add more commit for sg_alloc_table_from_pages Date: Mon, 8 Apr 2019 10:37:46 +0800 Message-ID: <20190408023746.16916-2-sjhuang@iluvatar.ai> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190408023746.16916-1-sjhuang@iluvatar.ai> References: <20190408023746.16916-1-sjhuang@iluvatar.ai> MIME-Version: 1.0 X-Originating-IP: [10.101.199.253] X-ClientProxiedBy: S-10-101-1-105.iluvatar.local (10.101.1.105) To S-10-101-1-102.iluvatar.local (10.101.1.102) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsXClcqYpiu+ZVWMwal/bBZz1q9hs1h9t5/N Yv/T5ywWZ7pzLS7vmsNmcW/Nf1aLzRMWAInFXUwOHB6zGy6yeCze85LJ4/LZUo9Nnyaxe5yY 8ZvF4+PTWywel5qvs3t83iQXwBHFZZOSmpNZllqkb5fAlbH3ymrmgv1sFae7WtkaGHtZuxg5 OCQETCRevzTuYuTiEBI4wShx4s80xi5GTg5mAQmJgy9eMIMkWATeMkk0n77MBlHVyiRxbusk dpAqNgENibkn7jKD2CIC8hJNXx6xgxQxC9xilNgx4QkLSEJYIFRi68IWNhCbRUBFovfMRbAG XgELiemT21lBbAmg5tUbDjCDnMQpYCkxfTrYFUJAJa0Nk9khygUlTs4EGckBFFeQeLFSC6JT SWLJ3llMEHahxIyJKxgnMArNQvLDLCTdCxiZVjHyF+em62XmlJYlliQW6SVmbmKEREXiDsYb nS/1DjEKcDAq8fDeyF4VI8SaWFZcmXuIUYKDWUmEd+dUoBBvSmJlVWpRfnxRaU5q8SFGaQ4W JXHesokmMUIC6YklqdmpqQWpRTBZJg5OqQYmMyeFFTPbMndc+FGjLTqdYfrC2WlefY1/3ft7 12Q0HT2zenHP354/fBq6U/5teXVvP0uVwc5tMw/d/h1VdCG8uTykRkfz5/r5RT94tV5Wa5cX vA8Tn2z9m6l0w7579ldfNjyac311R4+FU9lX+9DynSqzhKU26OcuKK/+wyoY0vZMLPT7EY+w HEflldcXvtnP9jv5YP0mzTsMO5J2a0dcOx3bv//dJM9W7uadu94wZDlXzK5gOvG6ouSNRqF4 gpbcyftRtZefvubq2L2SfbZj9sTnxaEuu/tmztZ8/6vvmFJoDpfTghwXd418u5h7IXunptU/ Tt1sevXh4tOVn55N/s/xMGWd6eGnEz5eNhJzUmIpzkg01GIuKk4EAOJRwDIHAwAA 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 The get_user_pages_fast() may mess up the page order in @pages array, We will get the wrong DMA results in this case. Add more commit to clarify it. Signed-off-by: Huang Shijie --- lib/scatterlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 739dc9fe2c55..c170afb1a25e 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -450,6 +450,9 @@ EXPORT_SYMBOL(__sg_alloc_table_from_pages); * specified by the page array. The returned sg table is released by * sg_free_table. * + * Note: Do not use get_user_pages_fast() to pin the pages for @pages array, + * it may mess up the page order, and we will get the wrong DMA results. + * Returns: * 0 on success, negative error on failure */