From patchwork Thu Nov 29 07:52:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 10704133 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 81A63109C for ; Thu, 29 Nov 2018 07:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78A8F295D6 for ; Thu, 29 Nov 2018 07:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CC9929856; Thu, 29 Nov 2018 07:53:39 +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.9 required=2.0 tests=BAYES_00,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 045FC295D6 for ; Thu, 29 Nov 2018 07:53:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ABE06B5179; Thu, 29 Nov 2018 02:53:35 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 232136B517A; Thu, 29 Nov 2018 02:53:35 -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 0FB9F6B517B; Thu, 29 Nov 2018 02:53:35 -0500 (EST) 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 CA6B36B5179 for ; Thu, 29 Nov 2018 02:53:34 -0500 (EST) Received: by mail-pf1-f200.google.com with SMTP id t72so875557pfi.21 for ; Wed, 28 Nov 2018 23:53:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=Vod9vCgp/hIsfnMxiYI/fehh33dItJbH/BNHsLTUt2E=; b=KxmyY/LaqFSJGvgOzf5H5oaKfvVX4ZMhcY+8JQPsROJ6ZEkFUkszAmz2YNfqspEwVn cDy7AJI/QsVAicC3hC2XumP63pHW69nfQJHcimXpWW1mS8Od7agphmO7m2P0KNaMz8Bm IGn8VxzOWHJaDdyvkFBMRIjjXZ47m9zMhkylZPFyxcUuDAmr+/byF4obWLv6540+8kSs JnT1Vi+4c6ZdaI+4ZmzCfnIEnW1uiaaWO9FYIERtH5NQ1h/gWH5S/FymX8cvH1cjfbee ESfBwfHbQEsII2qfhWHLYUXj6tCGgMT18dr8L/nXACU9YszX5nNKEAg8lRaOc4nqCrpP vv/w== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of nborisov@suse.com designates 195.135.220.15 as permitted sender) smtp.mailfrom=nborisov@suse.com X-Gm-Message-State: AA+aEWYtsK6h5e4YmwwwESVt+hsQOTZT+x9pjIL9HZTMawFNOSW1x9Os Do9T0HhB+p+H+f4QP5qwg2xK/Sy/uMxpTAiSgKzXUFojHtTzZqvPrWEts2zmHOdpqdcruJkD/hz 5i9LPJV8gWn92x/jo059BPti23h8cAGJXp1p618AXKCuEhNYYqj6RnOrpFipCXKXdsw== X-Received: by 2002:a63:1d1d:: with SMTP id d29mr377356pgd.49.1543478014390; Wed, 28 Nov 2018 23:53:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/WexvyiFdyXoglL7uqwZnEXY7eiHdIqdaiVl48QyivM5Quu+cY4Szy437jz/wyQSeNd5c8l X-Received: by 2002:a63:1d1d:: with SMTP id d29mr377329pgd.49.1543478013310; Wed, 28 Nov 2018 23:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543478013; cv=none; d=google.com; s=arc-20160816; b=NOSfS2SY0h7xfpT1fGO0g95yG1gxX6SMoQDqSxpxYOFUxQhIHZ1gvxJadlReWrx8bQ Zjvh9jQNCLkk8FXM7ExLlaJFMewNC7hgO7mnIMxjSIGGKT4mDrZJ+D7HuxZUByo3y/28 X6xXvKQNW4ebQXlSGunFUtJHUu0OWO/VHt4Jr92bfvz4595/7KUDYUiVvi3YsIbxXLuN 7gY2lszOxCuK2YvTSeZ9jYwqyaDqGV/KMn1XdoWxOW0yWD6hHN1JSjJ7Dul3Qly+AFuD VccjPptArnkdXE2pG0GAXDTD+zjHRAGKBsJygIwB4fXrXp5nBd3DatjumWk1JQJzHmBn P15Q== 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; bh=Vod9vCgp/hIsfnMxiYI/fehh33dItJbH/BNHsLTUt2E=; b=E+1XCtLrfh1Z1szhqUTx2OHbAePXEZHtikrbyYJrxcZR5eLm0u6g4CFJ4XmcdfCIKK s15tnkUHjqvnjRt5/GPsOiiaYzw7sHPgRYa/P1K4oohikUWY9UzfN9JxET0//hTVAy7f g75MGciylX335ePomVGoBJIyKMnjf6A7jweM1LRv/S+MSEvtmjPIQ7AwIEHWT2tCsMwk QLE31FZfPkr3meUbZlfYVkg5qvaSCfwHD/e6uS67XsmTNzdz4k2Fopr++S5xUp8ztPjd 85HPbd+3XAeGCkFqCOue5PMwudpqFajDJMJoih9voximk3v/gQb31MX3kXqD3BoBqnhp AjjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of nborisov@suse.com designates 195.135.220.15 as permitted sender) smtp.mailfrom=nborisov@suse.com Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id c191si1428121pfg.72.2018.11.28.23.53.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 23:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of nborisov@suse.com designates 195.135.220.15 as permitted sender) client-ip=195.135.220.15; Authentication-Results: mx.google.com; spf=pass (google.com: domain of nborisov@suse.com designates 195.135.220.15 as permitted sender) smtp.mailfrom=nborisov@suse.com X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 858A5ADE0; Thu, 29 Nov 2018 07:53:31 +0000 (UTC) From: Nikolay Borisov To: linux-kernel@vger.kernel.org Cc: Nikolay Borisov , Andrew Morton , Matthew Wilcox , Michal Hocko , Dan Williams , "Kirill A. Shutemov" , Pavel Tatashin , Souptick Joarder , Logan Gunthorpe , Keith Busch , Tony Luck , Ingo Molnar , linux-mm@kvack.org Subject: [PATCH 1/2] mm: Move lru_to_page to mm.h Date: Thu, 29 Nov 2018 09:52:56 +0200 Message-Id: <20181129075301.29087-1-nborisov@suse.com> X-Mailer: git-send-email 2.17.1 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 There are multiple places in the kernel which opencode this helper, this patch moves it to the more generic mm.h header in preparation for using it. No functional changes. Signed-off-by: Nikolay Borisov --- include/linux/mm.h | 2 ++ include/linux/mm_inline.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 5411de93a363..47b4aa5bba93 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -146,6 +146,8 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, /* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */ #define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)(addr), PAGE_SIZE) +#define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) + /* * Linux kernel virtual memory manager primitives. * The idea being to have a "virtual" mm in the same way diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 10191c28fc04..04ec454d44ce 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -124,7 +124,4 @@ static __always_inline enum lru_list page_lru(struct page *page) } return lru; } - -#define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) - #endif