linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Severe performance regression w/ 4.4+ on Android due to cgroup locking changes
@ 2016-07-13  0:00 John Stultz
  2016-07-13  8:21 ` Peter Zijlstra
  2016-07-13 18:21 ` Tejun Heo
  0 siblings, 2 replies; 67+ messages in thread
From: John Stultz @ 2016-07-13  0:00 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Ingo Molnar, Peter Zijlstra, lkml, Dmitry Shmidt, Rom Lemarchand,
	Colin Cross, Todd Kjos

Hey Tejun,

  So Dmitry Shmidt recently noticed that with 4.4 based systems we're
seeing quite a bit of performance overhead from
__cgroup_procs_write().

With 4.4 tree as it stands, we're seeing __cgroup_procs_write() quite
often take 10s of miliseconds to execute (with max times up in the
80ms range).

While with 4.1 it was quite often in the single usec range, and max
time values still in in sub-milisecond range.

The majority of these performance regressions seem to come from the
locking changes in:

3014dde762f6 ("cgroup: simplify threadgroup locking")
and
1ed1328792ff  ("sched, cgroup: replace signal_struct->group_rwsem with
a global percpu_rwsem")

Dmitry has found that by reverting these two changes (which don't
revert easiliy), we can get back down to tens 10-100 usec range for
most calls, with max values occasionally spiking to ~18ms.

Those two commits do talk about performance regressions, that were
supposedly alleviated by percpu_rwsem changes, but I'm not sure we are
seeing this.

In 1ed1328792ff, the commit talks about the write path being a fairly
cold path, but with Android I worry this may not actually be the case,
as Android uses cpuset cgroups to group tasks into foreground and
background tasks, but this means when switching applications, tasks
are migrated between cgroups. Putting an additional 80 milisecond
delay on this adds potentially visible latencies on task switching.

Reverting those two changes in the Android common.git tree doesn't
feel like a good long term solution here, so I was wondering if you
had any thoughts on how to further reduce the performance regression
here?

All the credit for finding this goes to Dmitry, I just was able to
reproduce his results and thoguht we should bring it up for discussion
here.

thanks
-john

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

end of thread, other threads:[~2016-07-14 19:35 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13  0:00 Severe performance regression w/ 4.4+ on Android due to cgroup locking changes John Stultz
2016-07-13  8:21 ` Peter Zijlstra
2016-07-13 14:42   ` Paul E. McKenney
2016-07-13 18:13     ` Dmitry Shmidt
2016-07-13 18:32       ` Paul E. McKenney
2016-07-13 18:21 ` Tejun Heo
2016-07-13 18:33   ` Tejun Heo
2016-07-13 20:13     ` John Stultz
2016-07-13 20:18       ` Tejun Heo
2016-07-13 20:26         ` Peter Zijlstra
2016-07-13 20:39           ` Tejun Heo
2016-07-13 20:51             ` Peter Zijlstra
2016-07-13 21:01               ` Tejun Heo
2016-07-13 21:03               ` Paul E. McKenney
2016-07-13 21:05                 ` Tejun Heo
2016-07-13 21:18                   ` Paul E. McKenney
2016-07-13 21:42                     ` Paul E. McKenney
2016-07-13 21:46                       ` John Stultz
2016-07-13 22:17                         ` Paul E. McKenney
2016-07-13 22:39                           ` John Stultz
2016-07-13 23:02                             ` Paul E. McKenney
2016-07-13 23:04                               ` Paul E. McKenney
2016-07-14 11:35                                 ` Tejun Heo
2016-07-14 12:04                                   ` Peter Zijlstra
2016-07-14 12:08                                     ` Tejun Heo
2016-07-14 12:20                                       ` Peter Zijlstra
2016-07-14 15:07                                         ` Tejun Heo
2016-07-14 15:24                                           ` Tejun Heo
2016-07-14 16:32                                           ` Peter Zijlstra
2016-07-14 17:34                                             ` Oleg Nesterov
2016-07-14 16:54                               ` John Stultz
2016-07-13 22:25                       ` John Stultz
2016-07-13 22:01                     ` Tejun Heo
2016-07-13 22:33                       ` Paul E. McKenney
2016-07-14  6:49                       ` Peter Zijlstra
2016-07-14 11:20                         ` Tejun Heo
2016-07-14 12:11                           ` Peter Zijlstra
2016-07-14 15:14                             ` Tejun Heo
2016-07-14 13:18               ` Peter Zijlstra
2016-07-14 14:14                 ` Peter Zijlstra
2016-07-14 14:58                 ` Oleg Nesterov
2016-07-14 16:14                   ` Peter Zijlstra
2016-07-14 16:37                   ` Peter Zijlstra
2016-07-14 17:05                     ` Oleg Nesterov
2016-07-14 16:23                 ` Paul E. McKenney
2016-07-14 16:45                   ` Peter Zijlstra
2016-07-14 17:15                     ` Paul E. McKenney
2016-07-14 16:43                 ` John Stultz
2016-07-14 16:49                   ` Peter Zijlstra
2016-07-14 17:02                     ` John Stultz
2016-07-14 17:13                       ` Oleg Nesterov
2016-07-14 17:30                         ` John Stultz
2016-07-14 17:41                           ` Oleg Nesterov
2016-07-14 17:51                             ` John Stultz
2016-07-14 18:09                 ` Oleg Nesterov
2016-07-14 18:36                   ` Peter Zijlstra
2016-07-14 19:35                     ` Peter Zijlstra
2016-07-13 20:57             ` John Stultz
2016-07-13 20:52           ` Paul E. McKenney
2016-07-13 20:57             ` Peter Zijlstra
2016-07-13 21:08               ` Paul E. McKenney
2016-07-13 21:01             ` Dmitry Shmidt
2016-07-13 21:03               ` John Stultz
2016-07-13 21:05               ` Paul E. McKenney
2016-07-13 20:31     ` Dmitry Shmidt
2016-07-13 20:44   ` Colin Cross
2016-07-13 20:54     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).