linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-kernel@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	Michal Hocko <mhocko@suse.com>,
	Dan Williams <dan.j.williams@intel.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Pavel Tatashin <pasha.tatashin@oracle.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	Keith Busch <keith.busch@intel.com>,
	Tony Luck <tony.luck@intel.com>, Ingo Molnar <mingo@kernel.org>,
	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	[thread overview]
Message-ID: <20181129075301.29087-1-nborisov@suse.com> (raw)

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 <nborisov@suse.com>
---
 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
-- 
2.17.1

             reply	other threads:[~2018-11-29  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29  7:52 Nikolay Borisov [this message]
2018-11-29  7:52 ` [PATCH 2/2] fs: Don't open-code lru_to_page Nikolay Borisov
2018-11-29  8:18   ` Michal Hocko
2018-11-29  8:50     ` Nikolay Borisov
2018-11-29  9:04       ` Michal Hocko
2018-11-29 11:17       ` Mike Rapoport
2018-11-29 11:38       ` Pankaj Gupta
2018-11-29 10:12     ` David Hildenbrand
2018-11-30  9:11   ` Yan, Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181129075301.29087-1-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=jrdr.linux@gmail.com \
    --cc=keith.busch@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=logang@deltatee.com \
    --cc=mhocko@suse.com \
    --cc=mingo@kernel.org \
    --cc=pasha.tatashin@oracle.com \
    --cc=tony.luck@intel.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox