linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Paul Turner <pjt@google.com>, Tejun Heo <tj@kernel.org>
Cc: Austin S Hemmelgarn <ahferroin7@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	lizefan@huawei.com, cgroups <cgroups@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-team <kernel-team@fb.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy
Date: Tue, 25 Aug 2015 11:36:25 +0900	[thread overview]
Message-ID: <55DBD4A9.7080603@jp.fujitsu.com> (raw)
In-Reply-To: <CAPM31RKr5K0F6b70wJronTcvXRLBYRuOvH+aFeDTVeZiDVZz=Q@mail.gmail.com>

On 2015/08/25 8:15, Paul Turner wrote:
> On Mon, Aug 24, 2015 at 3:49 PM, Tejun Heo <tj@kernel.org> wrote:
>> Hello,
>>
>> On Mon, Aug 24, 2015 at 03:03:05PM -0700, Paul Turner wrote:
>>>> Hmm... I was hoping for an actual configurations and usage scenarios.
>>>> Preferably something people can set up and play with.
>>>
>>> This is much easier to set up and play with synthetically.  Just
>>> create the 10 threads and 100 threads above then experiment with
>>> configurations designed at guaranteeing the set of 100 threads
>>> relatively uniform throughput regardless of how many are active.   I
>>> don't think trying to run a VM stack adds anything except complexity
>>> of reproduction here.
>>
>> Well, but that loses most of details and why such use cases matter to
>> begin with.  We can imagine up stuff to induce arbitrary set of
>> requirements.
>
> All that's being proved or disproved here is that it's difficult to
> coordinate the consumption of asymmetric thread pools using nice.  The
> constraints here were drawn from a real-world example.
>
>>
>>>> I take that the
>>>> CPU intensive helper threads are usually IO workers?  Is the scenario
>>>> where the VM is set up with a lot of IO devices and different ones may
>>>> consume large amount of CPU cycles at any given point?
>>>
>>> Yes, generally speaking there are a few major classes of IO (flash,
>>> disk, network) that a guest may invoke.  Each of these backends is
>>> separate and chooses its own threading.
>>
>> Hmmm... if that's the case, would limiting iops on those IO devices
>> (or classes of them) work?  qemu already implements IO limit mechanism
>> after all.
>
> No.
>
> 1) They should proceed at the maximum rate that they can that's still
> within their provisioning budget.
> 2) The cost/IO is both inconsistent and changes over time.  Attempting
> to micro-optimize every backend for this is infeasible, this is
> exactly the type of problem that the scheduler can usefully help
> arbitrate.
> 3) Even pretending (2) is fixable, dynamically dividing these
> right-to-work tokens between different I/O device backends is
> extremely complex.
>

I think I should explain my customer's use case of qemu + cpuset/cpu (via libvirt)

(1) Isolating hypervisor thread.
    As already discussed, hypervisor threads are isolated by cpuset. But their purpose
    is to avoid _latency_ spike caused by hypervisor behavior. So, "nice" cannot be solution
    as already discussed.

(2) Fixed rate vcpu service.
    With using cpu controller's quota/period feature, my customer creates  vcpu models like
    Low(1GHz), Mid(2GHz), High(3GHz) for IaaS system.

    To do this, each vcpus should be quota-limited independently, with per-thread cpu control.

Especially, the method (1) is used in several enterprise customers for stabilizing their system.

Sub-process control should be provided by some way.

Thanks,
-Kame



>>
>> Anyways, a point here is that threads of the same process competing
>> isn't a new problem.  There are many ways to make those threads play
>> nice as the application itself often has to be involved anyway,
>> especially for something like qemu which is heavily involved in
>> provisioning resources.
>
> It's certainly not a new problem, but it's a real one, and it's
> _hard_.  You're proposing removing the best known solution.
>
>>
>> cgroups can be a nice brute-force add-on which lets sysadmins do wild
>> things but it's inherently hacky and incomplete for coordinating
>> threads.  For example, what is it gonna do if qemu cloned vcpus and IO
>> helpers dynamically off of the same parent thread?
>
> We're talking about sub-process usage here.  This is the application
> coordinating itself, NOT the sysadmin.  Processes are becoming larger
> and larger, we need many of the same controls within them that we have
> between them.
>
>>   It requires
>> application's cooperation anyway but at the same time is painful to
>> actually interact from those applications.
>
> As discussed elsewhere on thread this is really not a problem if you
> define consistent rules with respect to which parts are managed by
> who.  The argument of potential interference is no different to
> messing with an application's on-disk configuration behind its back.
> Alternate strawmen which greatly improve this from where we are today
> have also been proposed.
>
>>
>> Thanks.
>>
>> --
>> tejun
> --
> 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/
>



  reply	other threads:[~2015-08-25  2:37 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 22:41 [PATCHSET sched,cgroup] sched: Implement interface for cgroup unified hierarchy Tejun Heo
2015-08-03 22:41 ` [PATCH 1/3] cgroup: define controller file conventions Tejun Heo
2015-08-04  8:42   ` Peter Zijlstra
2015-08-04 14:51     ` Tejun Heo
2015-08-04  8:48   ` Peter Zijlstra
2015-08-04 14:53     ` Tejun Heo
2015-08-04 19:31   ` [PATCH v2 " Tejun Heo
2015-08-05  0:39     ` Kamezawa Hiroyuki
2015-08-05  7:47       ` Michal Hocko
2015-08-06  2:30         ` Kamezawa Hiroyuki
2015-08-07 18:17           ` Michal Hocko
2015-08-17 22:04             ` Johannes Weiner
2015-08-17 21:34     ` Johannes Weiner
2015-08-03 22:41 ` [PATCH 2/3] sched: Misc preps for cgroup unified hierarchy interface Tejun Heo
2015-08-03 22:41 ` [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy Tejun Heo
2015-08-04  9:07   ` Peter Zijlstra
2015-08-04 15:10     ` Tejun Heo
2015-08-05  9:10       ` Peter Zijlstra
2015-08-05 14:31         ` Tejun Heo
2015-08-17 20:35           ` Tejun Heo
     [not found]           ` <CAPM31RJTf0v=2v90kN6-HM9xUGab_k++upO0Ym=irmfO9+BbFw@mail.gmail.com>
2015-08-18  4:03             ` Paul Turner
2015-08-18 20:31               ` Tejun Heo
2015-08-18 23:39                 ` Kamezawa Hiroyuki
2015-08-19 16:23                   ` Tejun Heo
2015-08-19  3:23                 ` Mike Galbraith
2015-08-19 16:41                   ` Tejun Heo
2015-08-20  4:00                     ` Mike Galbraith
2015-08-20  7:52                       ` Tejun Heo
2015-08-20  8:47                         ` Mike Galbraith
2015-08-21 19:26                 ` Paul Turner
2015-08-22 18:29                   ` Tejun Heo
2015-08-24 15:47                     ` Austin S Hemmelgarn
2015-08-24 17:04                       ` Tejun Heo
2015-08-24 19:18                         ` Mike Galbraith
2015-08-24 20:00                         ` Austin S Hemmelgarn
2015-08-24 20:25                           ` Tejun Heo
2015-08-24 21:00                             ` Paul Turner
2015-08-24 21:12                               ` Tejun Heo
2015-08-24 21:15                                 ` Paul Turner
2015-08-24 20:54                         ` Paul Turner
2015-08-24 21:02                           ` Tejun Heo
2015-08-24 21:10                             ` Paul Turner
2015-08-24 21:17                               ` Tejun Heo
2015-08-24 21:19                                 ` Paul Turner
2015-08-24 21:40                                   ` Tejun Heo
2015-08-24 22:03                                     ` Paul Turner
2015-08-24 22:49                                       ` Tejun Heo
2015-08-24 23:15                                         ` Paul Turner
2015-08-25  2:36                                           ` Kamezawa Hiroyuki [this message]
2015-08-25 21:13                                             ` Tejun Heo
2015-08-25  9:24                                           ` Ingo Molnar
2015-08-25 10:00                                             ` Peter Zijlstra
2015-08-25 19:18                                           ` Tejun Heo
2015-08-24 20:52                     ` Paul Turner
2015-08-24 21:36                       ` Tejun Heo
2015-08-24 21:58                         ` Paul Turner
2015-08-24 22:19                           ` Tejun Heo
2015-08-24 23:06                             ` Paul Turner
2015-08-25 21:02                               ` Tejun Heo
2015-09-02 17:03                                 ` Tejun Heo
2015-09-09 12:49                                 ` Paul Turner
2015-09-12 14:40                                   ` Tejun Heo
2015-09-17 14:35                                     ` Peter Zijlstra
2015-09-17 14:53                                       ` Tejun Heo
2015-09-17 15:42                                         ` Peter Zijlstra
2015-09-17 15:10                                       ` Peter Zijlstra
2015-09-17 15:52                                         ` Tejun Heo
2015-09-17 15:53                                           ` Peter Zijlstra
2015-09-17 23:29                                     ` Tejun Heo
2015-09-18 11:27                                     ` Paul Turner
2015-10-01 18:46                                       ` Tejun Heo
2015-10-15 11:42                                         ` Paul Turner
2015-10-23 22:21                                           ` Tejun Heo
2015-10-24  4:36                                             ` Mike Galbraith
2015-10-25  2:18                                               ` Tejun Heo
2015-10-25  3:43                                                 ` Mike Galbraith
2015-10-27  3:16                                                   ` Tejun Heo
2015-10-27  5:42                                                     ` Mike Galbraith
2015-10-27  5:46                                                       ` Tejun Heo
2015-10-27  5:56                                                         ` Mike Galbraith
2015-10-27  6:00                                                           ` Tejun Heo
2015-10-27  6:08                                                             ` Mike Galbraith
2015-10-25  3:54                                                 ` Linus Torvalds
2015-10-25  9:33                                                   ` Ingo Molnar
2015-10-25 10:41                                                     ` Theodore Ts'o
2015-10-25 10:47                                                       ` Florian Weimer
2015-10-25 11:58                                                         ` Theodore Ts'o
2015-10-25 13:17                                                           ` Florian Weimer
2015-10-25 13:40                                                             ` Getrandom wrapper Theodore Ts'o
2015-10-26 13:32                                                               ` Florian Weimer
2015-10-26 14:10                                                             ` [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy Peter Zijlstra
2015-08-04 19:32   ` [PATCH v2 " Tejun Heo

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=55DBD4A9.7080603@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=ahferroin7@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).