From patchwork Wed Nov 28 23:55:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 10703661 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 1601913AD for ; Wed, 28 Nov 2018 23:55:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEC602D6ED for ; Wed, 28 Nov 2018 23:55:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDC772D73C; Wed, 28 Nov 2018 23:55:35 +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=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL 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 5E6142D6ED for ; Wed, 28 Nov 2018 23:55:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45BED6B4F9B; Wed, 28 Nov 2018 18:55:34 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 431C36B4F9C; Wed, 28 Nov 2018 18:55:34 -0500 (EST) 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 321AF6B4F9D; Wed, 28 Nov 2018 18:55:34 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-it1-f198.google.com (mail-it1-f198.google.com [209.85.166.198]) by kanga.kvack.org (Postfix) with ESMTP id 0A3436B4F9B for ; Wed, 28 Nov 2018 18:55:34 -0500 (EST) Received: by mail-it1-f198.google.com with SMTP id j202so3967414itj.1 for ; Wed, 28 Nov 2018 15:55:34 -0800 (PST) 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:content-transfer-encoding; bh=rAo7eNFTAOvntn7w4xkOfgHD9+s+0OjB6lQm+RJmv0M=; b=HpISjkmGzk3b++MAr3tzAoCK5d8V3npPgKoZ5vP3uJibWS72FbCkFi0lN2qnQtwo3C bbtdjtxqGq6a44TbQoBYX3v8t/1kzC2a3jBwrAOhyt0OLOM24OArZ9NKs89JwhmnCMSC y3Smz34ldrMFKBpQo5tC38d7vMJsPZk/L7L+XxGAkZZJohocPsZL+6pfnxGYUc3L16mc C5TiyZz2+1EUF7dfNZSoy82ZHzJreIgZkOxbt4uQuT3qZmXMBVMtO5RXxpQbCsDrfqER an9VcJRsQQ3S56jujK0VFagO1iaNX6/14cZYWvS2usl8Ja5CXoouKXImmmc48UpcK0qp GUxw== X-Gm-Message-State: AA+aEWbyxbnbLhLKW5qJSC0kBbRzggYeeIXsYP8fOAbOhtm6rr4CGJhF 0vu7cRCIAHL3tzxg3zFBH8BLgmRJnQcNmj9xCdd/6h8otapq1gIh0csc3Hd/rWViGMGtmfVDSwR agjlU8scqWZYXNsboaoq/nYiTM4cBgop6nCVgEKCi2r+l0dek+2kRBk4M6cESIE8Qj4/6Ci1u/W rsrzAV8cU02wFDcHke6UHyWVECQo2e/mn5jcQA5i41GW3djsv2+4fNNPILxMbbvvaOnZp2UWlJT aThZ+zp5ql9lQj27Yz7jG2+a10CxyYSCZX4e7BSMVYFnZSB2JeGyerufF+Rrj2Qs5onPslg+Jr6 AJFIZ/zhLNQG9VTxeTcJPRlXbPgWSABtw0Rb/f0Ge8iK08Kga0BKQ9A6vJ7aAnjB8MILeB6dhF4 O X-Received: by 2002:a6b:db17:: with SMTP id t23mr9548280ioc.262.1543449333740; Wed, 28 Nov 2018 15:55:33 -0800 (PST) X-Received: by 2002:a6b:db17:: with SMTP id t23mr9548252ioc.262.1543449333123; Wed, 28 Nov 2018 15:55:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543449333; cv=none; d=google.com; s=arc-20160816; b=cGaVLNwDtLYL6qQZfP35HE4L/xxrchVeOT8fSo16iRyXgV+18xs1wXF0XkgIg1Z8Zy dLNW0cKFg+gCH1mRu783t8OmHWa/IS953XG5xnED4JtTa5Ami/RCKdHMzaAXdD6eJSso MPo4zHIzT2vQQLTjObzehIlgdNgYDgsrb6vHR4MK7AkoUnLJSROM9QYF0UgCs6egXx1F ikA5VH7qM2OE8lV4iBNGfkWoc+B0EKKlE9ELaX2VXwpG04xEW0rYRbzJmdAHye15QFsH O3pO4eD3JXOQdgFiXy36sb+Uc7pS7IH3dBvKF/ZjwCWvAU3fPoCSzbNg+4dj82oTcFS/ 58Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=rAo7eNFTAOvntn7w4xkOfgHD9+s+0OjB6lQm+RJmv0M=; b=AXh/2xxS2OYnv+CLkeFOQwFUWlcsTme7o/feKmcJmzIqET6e3bTUkhtbhqu29hVAKU 7BZ3XHYAJ3h3jgRN8ZaHmerKGy6RABZPfOUSjDVvxecaHnskLUAP06i/i5XpmWQZ+3lE 2W3Ey6ectvALmNYp/3ZKJgqxZXDm7Uf8vR6991j7lmjrwQTQr+p/yapHLKLjpfnzd/g/ 9wH/xvzMzJ7A/iK1VDHviAsSJ46ppAlKWB9ElaARoTYfifYcbdK9Rzsg9fcNXRDe/O/c B/lfuvDrRBy/xW1namWwyJ1is2NpVqYjo7RXXUgiOSE7nluN7/vitguLUUpRPec5X23m fcjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="RceGW/dM"; spf=pass (google.com: domain of yuzhao@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id t187sor39446iod.103.2018.11.28.15.55.33 for (Google Transport Security); Wed, 28 Nov 2018 15:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of yuzhao@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="RceGW/dM"; spf=pass (google.com: domain of yuzhao@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rAo7eNFTAOvntn7w4xkOfgHD9+s+0OjB6lQm+RJmv0M=; b=RceGW/dMCsIwSzYA+BCKQ1hPAic0MmXHH+Bv0oTZETuq4mDi/PquDGa55gM5fSMHdI VggyxXmDiNCUZApj6Aa7kRoygHXYQF5YMN57Zv/OhtBPUQFbQ8qC0nqm7U/yRxyAogNs oYWGXdGnIHOnnwtELU8mANCh3oA7uAMQjKwjyJusY1F1BFEhHr6QbzbV5YKknxfyEC0o SuiPg2FegoRjiG/vAkDb02ZHgOokJWJ3n8js30hgJqDhdrKaNji0fAJnz9AFytVRoGhM V42oVDTBcL47YUrOM7/2YtutndQUU7kfU8jDC8LENEngUgbeKBtmaVPo+vXfHLM6EgRk o1GQ== X-Google-Smtp-Source: AFSGD/V9Qm30w/cfBPWe/3jTX2s8WyRXBQcuuMg/+p6yAp8qU54L97a8I7BrkKDHRow//lmJohx4NQ== X-Received: by 2002:a6b:6a02:: with SMTP id x2mr18551104iog.204.1543449332685; Wed, 28 Nov 2018 15:55:32 -0800 (PST) Received: from yuzhao.bld.corp.google.com ([2620:15c:183:0:a0c3:519e:9276:fc96]) by smtp.gmail.com with ESMTPSA id y13sm31490ioa.56.2018.11.28.15.55.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 15:55:31 -0800 (PST) From: Yu Zhao To: Andrew Morton Cc: Hugh Dickins , "Kirill A . Shutemov" , Matthew Wilcox , Michal Hocko , Dan Williams , Pavel Tatashin , Souptick Joarder , Logan Gunthorpe , Keith Busch , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao Subject: [PATCH] mm: remove pte_lock_deinit() Date: Wed, 28 Nov 2018 16:55:25 -0700 Message-Id: <20181128235525.58780-1-yuzhao@google.com> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog MIME-Version: 1.0 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 Pagetable page doesn't touch page->mapping or have any used field that overlaps with it. No need to clear mapping in dtor. In fact, doing so might mask problems that otherwise would be detected by bad_page(). Signed-off-by: Yu Zhao Reviewed-by: Matthew Wilcox Acked-by: Michal Hocko --- include/linux/mm.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 5411de93a363..7c8f4fc9244e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1900,13 +1900,6 @@ static inline bool ptlock_init(struct page *page) return true; } -/* Reset page->mapping so free_pages_check won't complain. */ -static inline void pte_lock_deinit(struct page *page) -{ - page->mapping = NULL; - ptlock_free(page); -} - #else /* !USE_SPLIT_PTE_PTLOCKS */ /* * We use mm->page_table_lock to guard all pagetable pages of the mm. @@ -1917,7 +1910,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) } static inline void ptlock_cache_init(void) {} static inline bool ptlock_init(struct page *page) { return true; } -static inline void pte_lock_deinit(struct page *page) {} +static inline void ptlock_free(struct page *page) {} #endif /* USE_SPLIT_PTE_PTLOCKS */ static inline void pgtable_init(void) @@ -1937,7 +1930,7 @@ static inline bool pgtable_page_ctor(struct page *page) static inline void pgtable_page_dtor(struct page *page) { - pte_lock_deinit(page); + ptlock_free(page); __ClearPageTable(page); dec_zone_page_state(page, NR_PAGETABLE); }