From patchwork Mon Aug 5 22:20:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: john.hubbard@gmail.com X-Patchwork-Id: 11077811 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 D2F1314E5 for ; Mon, 5 Aug 2019 22:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF2DA28981 for ; Mon, 5 Aug 2019 22:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC5C528988; Mon, 5 Aug 2019 22:20:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30AAA28970 for ; Mon, 5 Aug 2019 22:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730906AbfHEWUY (ORCPT ); Mon, 5 Aug 2019 18:20:24 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33828 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727928AbfHEWUX (ORCPT ); Mon, 5 Aug 2019 18:20:23 -0400 Received: by mail-pl1-f196.google.com with SMTP id i2so37019075plt.1; Mon, 05 Aug 2019 15:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H0Etnn7JHR8H7TocLV05oLauZ77NAi3PGTTr9FTaKTw=; b=UDZlgD2PuMBL9wl0f5xLH0x3A9s2q8HxsLrdHjkNK3SOB297SiXK4eDKAmDpzpVl0F w7RtBptvOSgkgei6aCHdJWFPpiqgXwXMNIebxu8QlDbK5Z8t4BrWzhYzunccIgMaW8sK sJyVIrDqI91Tqqq6buzI8UfXtB++A6hs6LheT/4+zFBgv64RCVjx8Owi0ChVufpwkbpZ 2LuojDoYd+Vezc8faHDhkX/SZFHfkDc9OvfLKQ1u3UmYn4TNLMhIXBDbIlyGr5GhOr/h 91/w2XsHFuoxIezqA/+us5UPVxiek/AM5+fz4RZ2lX85C4K/JJ/R/Pbt2SvrRyWhAfUi 723Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H0Etnn7JHR8H7TocLV05oLauZ77NAi3PGTTr9FTaKTw=; b=RhUtVZJF52BiwxCWc1F5ogKyE48XR3LPnV4pjn49OK2UmwY1VHRFQel0spPMTgVRoH ag8976+zMVPA7uASSDH81yGDgB6o6ujoveIaL1KCoAwaVZPYXmMKeex/zlPYhlrrYUaS 61pYAtoRUzGpmTRx6uAxcDAYr/BcJTPYbpiZkuShKqav0JqGXXcnvTcd5QbRwBD3Wcq0 b3vw2h4zAHXq0VgnmQzjkxV5TDHjKfrnY9Xx8IozL0WUqcQp6fVWEDYLtRXhgHA9hb71 e6/hs+cqejRQ27M4MRz8wggyzkonUf4Flyx3H969TyMZyt2/nbHLBmGaywv2vpnQl9om oMVg== X-Gm-Message-State: APjAAAWfgRFlG8Q5lQgPzlqLN1+KoY0pO103ZE1IsPyiL/D8as/gsAtv FL9YPQTqJa+jdEQ+nSyTYck= X-Google-Smtp-Source: APXvYqzK4StBi4Z2q8H3xlbnqk9w5/yLbcwYtlETk2LVzUgJMZXcQMZS+fz6Zg+ZAAI3Y1k3oX59Ow== X-Received: by 2002:a17:902:324:: with SMTP id 33mr34877pld.340.1565043622624; Mon, 05 Aug 2019 15:20:22 -0700 (PDT) Received: from blueforge.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id 185sm85744057pfd.125.2019.08.05.15.20.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 15:20:22 -0700 (PDT) From: john.hubbard@gmail.com X-Google-Original-From: jhubbard@nvidia.com To: Andrew Morton Cc: Christoph Hellwig , Ira Weiny , Jan Kara , Jason Gunthorpe , Jerome Glisse , LKML , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, John Hubbard , Dan Williams , Daniel Black , Matthew Wilcox , Mike Kravetz Subject: [PATCH 1/3] mm/mlock.c: convert put_page() to put_user_page*() Date: Mon, 5 Aug 2019 15:20:17 -0700 Message-Id: <20190805222019.28592-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805222019.28592-1-jhubbard@nvidia.com> References: <20190805222019.28592-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: John Hubbard For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions"). Cc: Dan Williams Cc: Daniel Black Cc: Jan Kara Cc: Jérôme Glisse Cc: Matthew Wilcox Cc: Mike Kravetz Signed-off-by: John Hubbard --- mm/mlock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/mlock.c b/mm/mlock.c index a90099da4fb4..b980e6270e8a 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -345,7 +345,7 @@ static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone) get_page(page); /* for putback_lru_page() */ __munlock_isolated_page(page); unlock_page(page); - put_page(page); /* from follow_page_mask() */ + put_user_page(page); /* from follow_page_mask() */ } } } @@ -467,7 +467,7 @@ void munlock_vma_pages_range(struct vm_area_struct *vma, if (page && !IS_ERR(page)) { if (PageTransTail(page)) { VM_BUG_ON_PAGE(PageMlocked(page), page); - put_page(page); /* follow_page_mask() */ + put_user_page(page); /* follow_page_mask() */ } else if (PageTransHuge(page)) { lock_page(page); /* @@ -478,7 +478,7 @@ void munlock_vma_pages_range(struct vm_area_struct *vma, */ page_mask = munlock_vma_page(page); unlock_page(page); - put_page(page); /* follow_page_mask() */ + put_user_page(page); /* follow_page_mask() */ } else { /* * Non-huge pages are handled in batches via From patchwork Mon Aug 5 22:20:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john.hubbard@gmail.com X-Patchwork-Id: 11077815 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 EF6B413B1 for ; Mon, 5 Aug 2019 22:20:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E026728970 for ; Mon, 5 Aug 2019 22:20:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D479E2897E; Mon, 5 Aug 2019 22:20:27 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 844A528980 for ; Mon, 5 Aug 2019 22:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730917AbfHEWUZ (ORCPT ); Mon, 5 Aug 2019 18:20:25 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33830 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730893AbfHEWUY (ORCPT ); Mon, 5 Aug 2019 18:20:24 -0400 Received: by mail-pl1-f195.google.com with SMTP id i2so37019096plt.1; Mon, 05 Aug 2019 15:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A5i3Rg5kn+067MlNxvjupwCb7OvZHoHIUYxhc992JlI=; b=pKuvlg2hwoarkpfTNR6KpixqG4Wg34fPCZG//9C6ep56sknR9I6vumm0Lj3xNQ1iy7 An0z5XnlgimFQqRa05txx12NevWhyV2Lb7x7p2vHSDc/vJyL1UMYh04P9z/8PeBlcmof KbVsF4kxEcmAWh81dDR0kLUU+u0G+IpIho0ZKDYJ6YObrCosO+58QStFqlNQi3Rqxkwj mXW60Rl4Ow9n9Sdcj6VEbxH9m4Ri+EM2o4zS9fB6QgzhPUmrUTRomPfxUofSeQEGClbH C3e21QDeVMlfxyNkwOcnJ77HHrUIJvK4WErEgQY92HF4We5BbAHaiz5aLeeZQO3yjwBd vyIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A5i3Rg5kn+067MlNxvjupwCb7OvZHoHIUYxhc992JlI=; b=UdScv5nHKQmjLtQFZPKe7e96q2dya7kQYstp0D7/0yvAP6L0uzWSfpw8CZs7GqUTgX rWO3HigKH7JVRe7THjM01KeFtrHL4KKnkMG0viTA1CyByocKjsestLgylIeIT589vodm XAAqEVnZaHpEGif/zL9jIwwUIiUN3f9mqzlqlBcVd4uwpMuGanfCNa6cd3ktzY/2s5Qa TZULpEphkB8w55NLSztbHQi7KeZExDU3Kab1vtqh2JzwfkdIYIL9RgY3oYr3NXdAZ0RC U4E+Xm9MMcJFylzgbBiMXpRzEoR8GIyXo77d/D7hHY6fPFIeFnXwgf399QmoJGLjgKtR Bg6g== X-Gm-Message-State: APjAAAXf0rsAT80Krtb86pAsXRpUDEu03pHKSj+YxV2OZ3/hGZfX24yT VIbt0hX5ehfwOD7Pf+mp49I= X-Google-Smtp-Source: APXvYqym5DWO2ynioA/LXqxbhVbEGp7NF1n1NiggZv5NF8aTVSRSKOlyn+2cbWlflhCbI+qCdy/2Cw== X-Received: by 2002:a17:902:6b0c:: with SMTP id o12mr24420plk.113.1565043623671; Mon, 05 Aug 2019 15:20:23 -0700 (PDT) Received: from blueforge.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id 185sm85744057pfd.125.2019.08.05.15.20.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 15:20:23 -0700 (PDT) From: john.hubbard@gmail.com X-Google-Original-From: jhubbard@nvidia.com To: Andrew Morton Cc: Christoph Hellwig , Ira Weiny , Jan Kara , Jason Gunthorpe , Jerome Glisse , LKML , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, John Hubbard , Andrea Arcangeli , Anshuman Khandual , David Rientjes , Dominik Brodowski , "Kirill A . Shutemov" , Michal Hocko , Vlastimil Babka , zhong jiang Subject: [PATCH 2/3] mm/mempolicy.c: convert put_page() to put_user_page*() Date: Mon, 5 Aug 2019 15:20:18 -0700 Message-Id: <20190805222019.28592-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805222019.28592-1-jhubbard@nvidia.com> References: <20190805222019.28592-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: John Hubbard For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions"). Cc: Andrea Arcangeli Cc: Anshuman Khandual Cc: David Rientjes Cc: Dominik Brodowski Cc: Kirill A. Shutemov Cc: Michal Hocko Cc: Vlastimil Babka Cc: zhong jiang Signed-off-by: John Hubbard --- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index f48693f75b37..76a8e935e2e6 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -832,7 +832,7 @@ static int lookup_node(struct mm_struct *mm, unsigned long addr) err = get_user_pages_locked(addr & PAGE_MASK, 1, 0, &p, &locked); if (err >= 0) { err = page_to_nid(p); - put_page(p); + put_user_page(p); } if (locked) up_read(&mm->mmap_sem); From patchwork Mon Aug 5 22:20:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: john.hubbard@gmail.com X-Patchwork-Id: 11077823 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 D571414E5 for ; Mon, 5 Aug 2019 22:20:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAA4A2866C for ; Mon, 5 Aug 2019 22:20:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA1AD2875A; Mon, 5 Aug 2019 22:20:38 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 405792866C for ; Mon, 5 Aug 2019 22:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730996AbfHEWUe (ORCPT ); Mon, 5 Aug 2019 18:20:34 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43225 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730909AbfHEWUZ (ORCPT ); Mon, 5 Aug 2019 18:20:25 -0400 Received: by mail-pg1-f193.google.com with SMTP id r26so4479715pgl.10; Mon, 05 Aug 2019 15:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iyBF/TunLLNE9m64WGZW5xnvl+XVp1Tkb/4cWK4Q28U=; b=fznpo+A/CwxRLIpM6ZFeQpQfbkwnXpV6MuOXxJtZ2Ve009RQdttmK51WGcum5QprYM AZQ7iviUpS0sDa6G1kPFVIds247iKuX80oSi8PYrG+Pz5HqI59Mr3aKQtGX7pDi7o4RM RWmp5UtwQ1cDvdrDvxECL3XMDq4qYx1FWnuPOJcQNsZrf6hsFTq4Xs2nIFRial0iIn3j 3r8qecmsdUZFU0thRgD2fb91wcvPi1mWP2+4yCICzHHq6R6yoN35mdoA+M+YlUBaQjwP 07wXykKNUg8r+Z9HQlNi01R18SqGl82U9FDKRed0aaErkd94vNQLksFmYUD5sjigWhBQ 0FIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iyBF/TunLLNE9m64WGZW5xnvl+XVp1Tkb/4cWK4Q28U=; b=jFxQjqUpjZ4pzmAxttdoVWnE9+MYQFNXuNgeSSVcQZuLSIVddwMIq3AJd5nSxt2yoS pc71juhLUJxOy7M0Y19wQWPzm8YPNgqsfnT+iBKypL/NJBja0JT72nhbF1+4Pwlw+CSP ZGLA4sQRwwAJLECMTO2s8DuljKz4+4fA/QQZOl5A9qqvJo2JhTcuThg1fOnnKsAk8d0v y176Szp8NTRkLAOMHPK5XiX0ORSUvjyCbKx+j6IELj3+Zjmp0ZqRTjscDu1hacMqc4gF n9DJRl/jnyszwLL3iIAc0YycBJJdEeyJdLGxgBPQgF9mFOtOucogzB9tZSmqJMb4yqwo xbSA== X-Gm-Message-State: APjAAAV6MqcJuqNsDvtMZ7Pf1De2t1JFI0/nCNaiaKrIDljfRiPSDFpN KpPL0L9c/bgOSv48RgRZolQ= X-Google-Smtp-Source: APXvYqzEcxttqkABL1O/lcCnkyPEMLulzfgv4nN04dLirBIxyXJLvEBAWtWhQxnW9RRVVqiC+jWtUA== X-Received: by 2002:aa7:914e:: with SMTP id 14mr284735pfi.136.1565043624587; Mon, 05 Aug 2019 15:20:24 -0700 (PDT) Received: from blueforge.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id 185sm85744057pfd.125.2019.08.05.15.20.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 15:20:24 -0700 (PDT) From: john.hubbard@gmail.com X-Google-Original-From: jhubbard@nvidia.com To: Andrew Morton Cc: Christoph Hellwig , Ira Weiny , Jan Kara , Jason Gunthorpe , Jerome Glisse , LKML , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, John Hubbard , Dan Williams , Daniel Black , Matthew Wilcox , Mike Kravetz Subject: [PATCH 3/3] mm/ksm: convert put_page() to put_user_page*() Date: Mon, 5 Aug 2019 15:20:19 -0700 Message-Id: <20190805222019.28592-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805222019.28592-1-jhubbard@nvidia.com> References: <20190805222019.28592-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: John Hubbard For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions"). Cc: Dan Williams Cc: Daniel Black Cc: Jan Kara Cc: Jérôme Glisse Cc: Matthew Wilcox Cc: Mike Kravetz Signed-off-by: John Hubbard --- mm/ksm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 3dc4346411e4..e10ee4d5fdd8 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -456,7 +456,7 @@ static inline bool ksm_test_exit(struct mm_struct *mm) * We use break_ksm to break COW on a ksm page: it's a stripped down * * if (get_user_pages(addr, 1, 1, 1, &page, NULL) == 1) - * put_page(page); + * put_user_page(page); * * but taking great care only to touch a ksm page, in a VM_MERGEABLE vma, * in case the application has unmapped and remapped mm,addr meanwhile. @@ -483,7 +483,7 @@ static int break_ksm(struct vm_area_struct *vma, unsigned long addr) FAULT_FLAG_WRITE | FAULT_FLAG_REMOTE); else ret = VM_FAULT_WRITE; - put_page(page); + put_user_page(page); } while (!(ret & (VM_FAULT_WRITE | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | VM_FAULT_OOM))); /* * We must loop because handle_mm_fault() may back out if there's @@ -568,7 +568,7 @@ static struct page *get_mergeable_page(struct rmap_item *rmap_item) flush_anon_page(vma, page, addr); flush_dcache_page(page); } else { - put_page(page); + put_user_page(page); out: page = NULL; } @@ -1974,10 +1974,10 @@ struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item, parent = *new; if (ret < 0) { - put_page(tree_page); + put_user_page(tree_page); new = &parent->rb_left; } else if (ret > 0) { - put_page(tree_page); + put_user_page(tree_page); new = &parent->rb_right; } else if (!ksm_merge_across_nodes && page_to_nid(tree_page) != nid) { @@ -1986,7 +1986,7 @@ struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item, * it will be flushed out and put in the right unstable * tree next time: only merge with it when across_nodes. */ - put_page(tree_page); + put_user_page(tree_page); return NULL; } else { *tree_pagep = tree_page; @@ -2328,7 +2328,7 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page) &rmap_item->rmap_list; ksm_scan.address += PAGE_SIZE; } else - put_page(*page); + put_user_page(*page); up_read(&mm->mmap_sem); return rmap_item; }