All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Make count list_lru_one::nr_items lockless
@ 2017-08-22 12:29 ` Kirill Tkhai
  0 siblings, 0 replies; 20+ messages in thread
From: Kirill Tkhai @ 2017-08-22 12:29 UTC (permalink / raw)
  To: apolyakov, linux-kernel, linux-mm, ktkhai, vdavydov.dev, aryabinin, akpm

This series aims to improve scalability of list_lru shrinking
and to make list_lru_count_one() working more effective.

On RHEL7 3.10 kernel I observe high system time usage and time
spent in super_cache_count() during slab shrinking:

0,94%  mysqld         [kernel.vmlinux]  [k] _raw_spin_lock                [k] _raw_spin_lock
0,57%  mysqld         [kernel.vmlinux]  [k] shrink_slab                   [k] shrink_slab
0,51%  mysqld         [kernel.vmlinux]  [k] super_cache_count             [k] super_cache_count
0,32%  mysqld         [kernel.vmlinux]  [k] __list_lru_count_one.isra.2   [k] _raw_spin_lock
0,32%  mysqld         [kernel.vmlinux]  [k] list_lru_count_one            [k] __list_lru_count_one.isra.2

(percentage of all node time; collected via $perf record --call-graph fp -j k -a).
It's an example, how the processes traces look like. And many processes spend time
in the above.

There is a node with many containers (more, than 200), and (as it's usually happen)
containers have no free memory (cache is actively used). Since shrink_slab() iterates
all superblocks, and it happens frequently, the shrink scales badly, and node spends
in sys more than 90% of time.

The patchset makes list_lru_count_one() lockless via RCU technics. Patch [1/3]
adds a new rcu field to struct list_lru_memcg and makes functions account its
size during allocations. Patch [2/3] makes list_lru_node::memcg_lrus RCU-protected
and RCU-accessible. Patch [3/3] removes the lock and adds rcu read protection
into __list_lru_count_one().

---

Kirill Tkhai (3):
      mm: Add rcu field to struct list_lru_memcg
      mm: Make list_lru_node::memcg_lrus RCU protected
      mm: Count list_lru_one::nr_items lockless


 include/linux/list_lru.h |    3 +-
 mm/list_lru.c            |   77 ++++++++++++++++++++++++++++++----------------
 2 files changed, 53 insertions(+), 27 deletions(-)

--
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-08-26 17:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-22 12:29 [PATCH 0/3] Make count list_lru_one::nr_items lockless Kirill Tkhai
2017-08-22 12:29 ` Kirill Tkhai
2017-08-22 12:29 ` [PATCH 1/3] mm: Add rcu field to struct list_lru_memcg Kirill Tkhai
2017-08-22 12:29   ` Kirill Tkhai
2017-08-22 12:29 ` [PATCH 2/3] mm: Make list_lru_node::memcg_lrus RCU protected Kirill Tkhai
2017-08-22 12:29   ` Kirill Tkhai
2017-08-22 19:34   ` Vladimir Davydov
2017-08-22 19:34     ` Vladimir Davydov
2017-08-22 12:29 ` [PATCH 3/3] mm: Count list_lru_one::nr_items lockless Kirill Tkhai
2017-08-22 12:29   ` Kirill Tkhai
2017-08-22 19:47   ` Vladimir Davydov
2017-08-22 19:47     ` Vladimir Davydov
2017-08-23  8:00     ` Kirill Tkhai
2017-08-23  8:00       ` Kirill Tkhai
2017-08-23  8:27       ` Vladimir Davydov
2017-08-23  8:27         ` Vladimir Davydov
2017-08-23 12:26         ` Kirill Tkhai
2017-08-23 12:26           ` Kirill Tkhai
2017-08-26 17:57           ` Vladimir Davydov
2017-08-26 17:57             ` Vladimir Davydov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.