From patchwork Fri May 4 18:33:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10381351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF86760353 for ; Fri, 4 May 2018 18:59:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F1762958D for ; Fri, 4 May 2018 18:59:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91E3D2957C; Fri, 4 May 2018 18:59:05 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID 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 57B2E2958D for ; Fri, 4 May 2018 18:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 910146B0269; Fri, 4 May 2018 14:33:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8985E6B026B; Fri, 4 May 2018 14:33:25 -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 7AE166B026C; Fri, 4 May 2018 14:33:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 399EA6B0269 for ; Fri, 4 May 2018 14:33:25 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id u10-v6so4559856pgp.8 for ; Fri, 04 May 2018 11:33:25 -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; bh=r8Ms7U04nfkNuFb8hrHqNkcG+4+NyOwJOLMcvWQt04o=; b=AoJ4K12TqV1sUvnhv5+cSJnVDB9mJhYsGFaBGWZTuWdJw75WIEfiphwrSP5HIxwSzK YyqKXh/holUAiMvk2UlPzpsuFBEcHGbUHdo9sn1b1f6q4Xc3iuroxwp95ytFgJD6hZJb yeEcv2hPO8ugyqvXsLulwtAAm/CJc5Y70Q1cgyFHLjW3P4N5cayeRozOsNYIbn0oxh4J t3kdcP1jLlL6IB3Bdx0AHKiqz6azRsBS/ns79G1CawyBWoQJa4mC98WlMDH5S6VeC2m1 +DizKARRFFDu6WjFdQpldLQzEhNvbAMb6AtEX4Lg78eADtXQgRJkO3jImtnx98dWfQJM 5XIA== X-Gm-Message-State: ALQs6tBYiCNhgezuW6x05TYK2ur405eDRb7CCAV2/9fWDclnar/k2n8V nWW2Hac7ciYf1awKAbqQd5A7/rkMHokoF3Kl7gGVs29B8eMzDRtYZQK7ulwFWIUPbhI3dUSn5sV v3GC5aUGU2oqe8mtMQb+YfKaORh6ylq4CBP/flcwWSAju+f+sdDnonRyCh0QTKcpPIg== X-Received: by 2002:a63:b306:: with SMTP id i6-v6mr23050124pgf.434.1525458804922; Fri, 04 May 2018 11:33:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZppXbSLn6JM8MuV8v24mQy1LpcXN0f6kOWO9crshaD4clObBjTps4RJEBt/DLXuXyrcyIaw X-Received: by 2002:a63:b306:: with SMTP id i6-v6mr23050090pgf.434.1525458804010; Fri, 04 May 2018 11:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525458803; cv=none; d=google.com; s=arc-20160816; b=jEIKXSbq9u70FjTHiDHcX2vN45S1hOWn65ULorlm+0PJx5RcRaYxoKS17YPSOQorVv RsbAa6SuaH4erxK1XDpbndNDQ6vPRx3cWbX/AOKdu+PfZuFsDpWeg5aCNmXMNPRoLqan ubQNaoe0GfcuqpThZX58473vTiyAhPTeUXx/bxt9H5ka+N5nDtJdvi/JRu6Xwt1Evzq3 +6BpKSQTP7HCeB2zClftt+uUPj0N4wdo/7CMJD7EsA0TDAhx72Jeg4iYtx1JR8csH9wI 8S/XDAeN1sKfogg5anXqyKD6ZLchkN8eXwX020fRXPnECEkhMZTZFH3B2O4A/TfeMkEm V4Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=r8Ms7U04nfkNuFb8hrHqNkcG+4+NyOwJOLMcvWQt04o=; b=Eq8zm91iSVqJE249sLuNkBxOst5NJL9pqJJhE5/KAvIvJ/j/QJuVaGtNKihVCgFIRm SLDPqUox0PeTlBL0JLtCvAZIEezfbJS2gSenopHmDNlIxOWFvst0aAy1V4xu5jnnbwkQ 2+bq6AVr6dSDgqclUELix3HYhgLOqXTe2FZPYNT8Zcrv4PIXbiacVcioLoLq0wEfGbWT 4OmnbHVpyOTnD7hQ9BwTm3x7BLT12OpO2A668h1OrR8SEPfgbqrlFm4B4sKiPM4UlJ27 76ej0PsnMbEGHrrdzEFPTFKv/i6lKM3sfliz7KqdarDcdFvq9P4klXBX0YeKSAmRa7n4 xCFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=Wz7STx6t; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id i73si17274597pfe.27.2018.05.04.11.33.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 May 2018 11:33:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=Wz7STx6t; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=r8Ms7U04nfkNuFb8hrHqNkcG+4+NyOwJOLMcvWQt04o=; b=Wz7STx6tNmzgx8hB6Z6ItwGKE kqSBvI9aFL2jGf6N9jDUGknNR0dZ2kNwoYBRrY2yjTknyi7s860/JSolZ1pEyRQMxfo5uOHSYkL/G Dyrjk9oc7pzN86xsYqv5O5jA2uBzyIB3BrJKUNppUK7l/EezcRU6xJA7ZWiQoCWgYOvZiHvfBFA0A p4LAzpV3vnHSU7nqItLIxtjIuJQIAuLvPMH2YrGDHGSXa+7iYkqXJsElAVXpwkYqtIp2zFZszU5p/ zWZPtqPHWGkb8MROrYZ8Y5AuQmua9LN/OGAJ/vT1oqzUQvM+RFLOdgsFyJDjvUH7ljSfEMt3kBvDl K5oA9C8fg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEfWF-0003mJ-6c; Fri, 04 May 2018 18:33:23 +0000 From: Matthew Wilcox To: linux-mm@kvack.org Cc: Matthew Wilcox , Andrew Morton , "Kirill A . Shutemov" , Christoph Lameter , Lai Jiangshan , Pekka Enberg , Vlastimil Babka , Dave Hansen , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= Subject: [PATCH v5 08/17] mm: Use page->deferred_list Date: Fri, 4 May 2018 11:33:09 -0700 Message-Id: <20180504183318.14415-9-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180504183318.14415-1-willy@infradead.org> References: <20180504183318.14415-1-willy@infradead.org> 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 From: Matthew Wilcox Now that we can represent the location of 'deferred_list' in C instead of comments, make use of that ability. Signed-off-by: Matthew Wilcox Acked-by: Vlastimil Babka Acked-by: Kirill A. Shutemov --- mm/huge_memory.c | 7 ++----- mm/page_alloc.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index a3a1815f8e11..cb0954a6de88 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -483,11 +483,8 @@ pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma) static inline struct list_head *page_deferred_list(struct page *page) { - /* - * ->lru in the tail pages is occupied by compound_head. - * Let's use ->mapping + ->index in the second tail page as list_head. - */ - return (struct list_head *)&page[2].mapping; + /* ->lru in the tail pages is occupied by compound_head. */ + return &page[2].deferred_list; } void prep_transhuge_page(struct page *page) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index da3eb2236ba1..1a0149c4f672 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -933,7 +933,7 @@ static int free_tail_pages_check(struct page *head_page, struct page *page) case 2: /* * the second tail page: ->mapping is - * page_deferred_list().next -- ignore value. + * deferred_list.next -- ignore value. */ break; default: