kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Improving scheduler for KVM
@ 2013-10-29  2:20 R
  2013-10-29  7:16 ` Raghavendra KT
  2013-10-29  7:51 ` Gleb Natapov
  0 siblings, 2 replies; 6+ messages in thread
From: R @ 2013-10-29  2:20 UTC (permalink / raw)
  To: kvm

Hi, everyone

I am a graduate student. And now I have some spare time.
I notice that KVM uses kernel scheduler to schedule VCPUs.
But there exists many problem beyond the capability of current
scheduler. (e.g. Lock Waiter Preemption problem)

And I don't want to reinvent the wheel. So I want to implement a
module which can be used by the scheduler to schedule VCPUs more
efficient.

Is there any documentation about any problem that I should pay attention to?
Any comment is welcome.

-- 
Thanks
Rui Wu

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

* Re: Improving scheduler for KVM
  2013-10-29  2:20 Improving scheduler for KVM R
@ 2013-10-29  7:16 ` Raghavendra KT
  2013-10-29  7:51 ` Gleb Natapov
  1 sibling, 0 replies; 6+ messages in thread
From: Raghavendra KT @ 2013-10-29  7:16 UTC (permalink / raw)
  To: R; +Cc: kvm, Raghavendra KT

On Tue, Oct 29, 2013 at 7:50 AM, R <19890121wr@gmail.com> wrote:
> Hi, everyone
>
> I am a graduate student. And now I have some spare time.
> I notice that KVM uses kernel scheduler to schedule VCPUs.
> But there exists many problem beyond the capability of current
> scheduler. (e.g. Lock Waiter Preemption problem)
>
> And I don't want to reinvent the wheel. So I want to implement a
> module which can be used by the scheduler to schedule VCPUs more
> efficient.
>
> Is there any documentation about any problem that I should pay attention to?
> Any comment is welcome.
>

We have some scheduling decision (specifically directed yield
decisions) taken by PLE handler
(kvm_vcpu_on_spin()). It uses some heuristic, but we cannot say it
complete eliminates lockwaiter preemption.
(paravirt-spinlocks tries to address that a bit though). Welcome any
ideas on reducing lockwaiter preemption.

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

* Re: Improving scheduler for KVM
  2013-10-29  2:20 Improving scheduler for KVM R
  2013-10-29  7:16 ` Raghavendra KT
@ 2013-10-29  7:51 ` Gleb Natapov
  2013-10-30  5:24   ` R
  1 sibling, 1 reply; 6+ messages in thread
From: Gleb Natapov @ 2013-10-29  7:51 UTC (permalink / raw)
  To: R; +Cc: kvm

On Tue, Oct 29, 2013 at 10:20:37AM +0800, R wrote:
> Hi, everyone
> 
> I am a graduate student. And now I have some spare time.
> I notice that KVM uses kernel scheduler to schedule VCPUs.
> But there exists many problem beyond the capability of current
> scheduler. (e.g. Lock Waiter Preemption problem)
> 
> And I don't want to reinvent the wheel. So I want to implement a
> module which can be used by the scheduler to schedule VCPUs more
> efficient.
> 
> Is there any documentation about any problem that I should pay attention to?
> Any comment is welcome.
> 
If you are thinking about gang scheduler it was done before, but it will
never be accepted upstream. And IIRC pvticketlock result was close if
not better than gang scheduling. If you are thinking about something
else then implement it in Linux scheduler directly. Linux scheduler is
not pluggable, so you cannot change it from a module.

--
			Gleb.

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

* Re: Improving scheduler for KVM
  2013-10-29  7:51 ` Gleb Natapov
@ 2013-10-30  5:24   ` R
  2013-11-01  6:51     ` R
  0 siblings, 1 reply; 6+ messages in thread
From: R @ 2013-10-30  5:24 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: kvm

Hi
Not only lock waiter preemption, but the scheduler may affect VMs' IO
throughput.
Experiments must be taken to figure out the reason.

I am trying to use preempt_notifier and vmexit handler to build a more
efficient scheduler.
Something like priority boosting.

2013/10/29 Gleb Natapov <gleb@redhat.com>:
> On Tue, Oct 29, 2013 at 10:20:37AM +0800, R wrote:
>> Hi, everyone
>>
>> I am a graduate student. And now I have some spare time.
>> I notice that KVM uses kernel scheduler to schedule VCPUs.
>> But there exists many problem beyond the capability of current
>> scheduler. (e.g. Lock Waiter Preemption problem)
>>
>> And I don't want to reinvent the wheel. So I want to implement a
>> module which can be used by the scheduler to schedule VCPUs more
>> efficient.
>>
>> Is there any documentation about any problem that I should pay attention to?
>> Any comment is welcome.
>>
> If you are thinking about gang scheduler it was done before, but it will
> never be accepted upstream. And IIRC pvticketlock result was close if
> not better than gang scheduling. If you are thinking about something
> else then implement it in Linux scheduler directly. Linux scheduler is
> not pluggable, so you cannot change it from a module.
>
> --
>                         Gleb.



-- 
Thanks
Rui Wu

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

* Re: Improving scheduler for KVM
  2013-10-30  5:24   ` R
@ 2013-11-01  6:51     ` R
  2013-11-01 11:03       ` Gleb Natapov
  0 siblings, 1 reply; 6+ messages in thread
From: R @ 2013-11-01  6:51 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: kvm

Hi,

Another quick question.

Is there any benchmark that is used to measure the performance of a VM
scheduler?


2013/10/30 R <19890121wr@gmail.com>:
> Hi
> Not only lock waiter preemption, but the scheduler may affect VMs' IO
> throughput.
> Experiments must be taken to figure out the reason.
>
> I am trying to use preempt_notifier and vmexit handler to build a more
> efficient scheduler.
> Something like priority boosting.
>
> 2013/10/29 Gleb Natapov <gleb@redhat.com>:
>> On Tue, Oct 29, 2013 at 10:20:37AM +0800, R wrote:
>>> Hi, everyone
>>>
>>> I am a graduate student. And now I have some spare time.
>>> I notice that KVM uses kernel scheduler to schedule VCPUs.
>>> But there exists many problem beyond the capability of current
>>> scheduler. (e.g. Lock Waiter Preemption problem)
>>>
>>> And I don't want to reinvent the wheel. So I want to implement a
>>> module which can be used by the scheduler to schedule VCPUs more
>>> efficient.
>>>
>>> Is there any documentation about any problem that I should pay attention to?
>>> Any comment is welcome.
>>>
>> If you are thinking about gang scheduler it was done before, but it will
>> never be accepted upstream. And IIRC pvticketlock result was close if
>> not better than gang scheduling. If you are thinking about something
>> else then implement it in Linux scheduler directly. Linux scheduler is
>> not pluggable, so you cannot change it from a module.
>>
>> --
>>                         Gleb.
>
>
>
> --
> Thanks
> Rui Wu



-- 
Thanks
Rui Wu

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

* Re: Improving scheduler for KVM
  2013-11-01  6:51     ` R
@ 2013-11-01 11:03       ` Gleb Natapov
  0 siblings, 0 replies; 6+ messages in thread
From: Gleb Natapov @ 2013-11-01 11:03 UTC (permalink / raw)
  To: R; +Cc: kvm

On Fri, Nov 01, 2013 at 02:51:28PM +0800, R wrote:
> Hi,
> 
> Another quick question.
> 
> Is there any benchmark that is used to measure the performance of a VM
> scheduler?
> 
I am not sure what do you mean by "performance of a VM scheduler". Since
you are the one who wants to improve scheduler I would have assumed that
you know what aspects of it you are going to improve and know how to
show current inefficiency.

> 
> 2013/10/30 R <19890121wr@gmail.com>:
> > Hi
> > Not only lock waiter preemption, but the scheduler may affect VMs' IO
> > throughput.
> > Experiments must be taken to figure out the reason.
> >
> > I am trying to use preempt_notifier and vmexit handler to build a more
> > efficient scheduler.
> > Something like priority boosting.
> >
> > 2013/10/29 Gleb Natapov <gleb@redhat.com>:
> >> On Tue, Oct 29, 2013 at 10:20:37AM +0800, R wrote:
> >>> Hi, everyone
> >>>
> >>> I am a graduate student. And now I have some spare time.
> >>> I notice that KVM uses kernel scheduler to schedule VCPUs.
> >>> But there exists many problem beyond the capability of current
> >>> scheduler. (e.g. Lock Waiter Preemption problem)
> >>>
> >>> And I don't want to reinvent the wheel. So I want to implement a
> >>> module which can be used by the scheduler to schedule VCPUs more
> >>> efficient.
> >>>
> >>> Is there any documentation about any problem that I should pay attention to?
> >>> Any comment is welcome.
> >>>
> >> If you are thinking about gang scheduler it was done before, but it will
> >> never be accepted upstream. And IIRC pvticketlock result was close if
> >> not better than gang scheduling. If you are thinking about something
> >> else then implement it in Linux scheduler directly. Linux scheduler is
> >> not pluggable, so you cannot change it from a module.
> >>
> >> --
> >>                         Gleb.
> >
> >
> >
> > --
> > Thanks
> > Rui Wu
> 
> 
> 
> -- 
> Thanks
> Rui Wu

--
			Gleb.

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

end of thread, other threads:[~2013-11-01 11:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29  2:20 Improving scheduler for KVM R
2013-10-29  7:16 ` Raghavendra KT
2013-10-29  7:51 ` Gleb Natapov
2013-10-30  5:24   ` R
2013-11-01  6:51     ` R
2013-11-01 11:03       ` Gleb Natapov

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).