Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1288458
| From | Vladimir Davydov <vdavydov@virtuozzo.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4/7] swap.h: move memcg related stuff to the end of the file |
| Date | 2015-12-10 12:40 +0100 |
| Message-ID | <qE7JM-5B8-7@gated-at.bofh.it> (permalink) |
| References | <qE7JM-5B8-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The following patches will add more functions to the memcg section of
include/linux/swap.h. Some of them will need values defined below the
current location of the section. So let's move the section to the end of
the file. No functional changes intended.
Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
---
include/linux/swap.h | 68 ++++++++++++++++++++++++++++------------------------
1 file changed, 37 insertions(+), 31 deletions(-)
diff --git a/include/linux/swap.h b/include/linux/swap.h
index f4b3ccdcba91..66ea62cf256d 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -350,38 +350,7 @@ extern void check_move_unevictable_pages(struct page **, int nr_pages);
extern int kswapd_run(int nid);
extern void kswapd_stop(int nid);
-#ifdef CONFIG_MEMCG
-static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)
-{
- /* root ? */
- if (mem_cgroup_disabled() || !memcg->css.parent)
- return vm_swappiness;
-
- return memcg->swappiness;
-}
-#else
-static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
-{
- return vm_swappiness;
-}
-#endif
-#ifdef CONFIG_MEMCG_SWAP
-extern void mem_cgroup_swapout(struct page *page, swp_entry_t entry);
-extern int mem_cgroup_charge_swap(struct page *page, swp_entry_t entry);
-extern void mem_cgroup_uncharge_swap(swp_entry_t entry);
-#else
-static inline void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
-{
-}
-static inline int mem_cgroup_charge_swap(struct page *page, swp_entry_t entry)
-{
- return 0;
-}
-static inline void mem_cgroup_uncharge_swap(swp_entry_t entry)
-{
-}
-#endif
#ifdef CONFIG_SWAP
/* linux/mm/page_io.c */
extern int swap_readpage(struct page *);
@@ -560,5 +529,42 @@ static inline swp_entry_t get_swap_page(void)
}
#endif /* CONFIG_SWAP */
+
+#ifdef CONFIG_MEMCG
+static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)
+{
+ /* root ? */
+ if (mem_cgroup_disabled() || !memcg->css.parent)
+ return vm_swappiness;
+
+ return memcg->swappiness;
+}
+
+#else
+static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
+{
+ return vm_swappiness;
+}
+#endif
+
+#ifdef CONFIG_MEMCG_SWAP
+extern void mem_cgroup_swapout(struct page *page, swp_entry_t entry);
+extern int mem_cgroup_charge_swap(struct page *page, swp_entry_t entry);
+extern void mem_cgroup_uncharge_swap(swp_entry_t entry);
+#else
+static inline void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
+{
+}
+
+static inline int mem_cgroup_charge_swap(struct page *page, swp_entry_t entry)
+{
+ return 0;
+}
+
+static inline void mem_cgroup_uncharge_swap(swp_entry_t entry)
+{
+}
+#endif
+
#endif /* __KERNEL__*/
#endif /* _LINUX_SWAP_H */
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/7] Add swap accounting to cgroup2 Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:40 +0100
[PATCH 4/7] swap.h: move memcg related stuff to the end of the file Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:40 +0100
Re: [PATCH 4/7] swap.h: move memcg related stuff to the end of the file Johannes Weiner <hannes@cmpxchg.org> - 2015-12-11 20:30 +0100
[PATCH 3/7] mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:40 +0100
Re: [PATCH 3/7] mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online Johannes Weiner <hannes@cmpxchg.org> - 2015-12-11 20:30 +0100
[PATCH 2/7] mm: vmscan: pass memcg to get_scan_count() Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:40 +0100
Re: [PATCH 2/7] mm: vmscan: pass memcg to get_scan_count() Johannes Weiner <hannes@cmpxchg.org> - 2015-12-11 20:30 +0100
[PATCH 1/7] mm: memcontrol: charge swap to cgroup2 Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:40 +0100
Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2 Johannes Weiner <hannes@cmpxchg.org> - 2015-12-10 17:10 +0100
Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2 Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 18:10 +0100
Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2 Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> - 2015-12-11 04:00 +0100
Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2 Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-11 08:50 +0100
[PATCH 7/7] Documentation: cgroup: add memory.swap.{current,max} description Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:50 +0100
Re: [PATCH 7/7] Documentation: cgroup: add memory.swap.{current,max} description Johannes Weiner <hannes@cmpxchg.org> - 2015-12-11 20:50 +0100
[PATCH 6/7] mm: free swap cache aggressively if memcg swap is full Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:50 +0100
Re: [PATCH 6/7] mm: free swap cache aggressively if memcg swap is full Johannes Weiner <hannes@cmpxchg.org> - 2015-12-11 20:40 +0100
csiph-web