All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: PV drivers for HVM guests
@ 2006-10-04 18:42 Ky Srinivasan
  2006-10-05 14:59 ` Andrew D. Ball
  0 siblings, 1 reply; 22+ messages in thread
From: Ky Srinivasan @ 2006-10-04 18:42 UTC (permalink / raw)
  To: aball; +Cc: xen-devel

Andrew,

The I/O performance of HVM guests with PV drivers is SIGNIFICANTLY better than what we get without PV drivers. I will post the patches after some additional testing and code cleanup.

Regards,

K. Y

>>> On Tue, Oct 3, 2006 at  6:19 PM, in message
<1159913996.27206.37.camel@localhost>, "Andrew D. Ball" <aball@us.ibm.com>
wrote: 
> Interesting!  Ideally, there would be better performance in the base HVM
> device model.  I think I know of some people that are working hard on
> that.
> 
> I'm curious to see what you've done for (1) and (2).
> 
> Peace.
> Andrew
> 
> On Tue, 2006-  10-  03 at 16:31 -  0400, Ky Srinivasan wrote:
>> I am trying to build PV drivers for SLES9 HVM guests. SLES 9 is based on the 
> 2.6.5 kernel. Since the PV driver code is really designed for the latest 
> kernel release, I have had many issues/problems in building the PV drivers 
> for older Linux OS targets -   I have only been looking at the issues with 2.6.5 
> kernel base and I suspect the problem will be even worse if one were to look 
> at older Linux kernels. This is unfortunate since PV drivers are so critical 
> for HVM guests and there is considerable interest in supporting legacy Linux 
> environments as HVM guests. The problems I have had to deal with can be 
> broadly classified into:
>> 
>> a) Compiler related issues
>> b) Missing functionality in the legacy kernel -   this includes features as 
> well as changed data structures
>> c) Implementation differences of a given feature
>> 
>> These differences can be dealt with in a couple of different ways:
>> 1) Modify the code in the PV drivers under appropriate compilation switches 
> to deal with the differences in the base kernels.
>> 2)  Introduce  a compatibility component that bridges the gap between the 
> current PV code and a given Linux target and leave much of the PV driver  
> code untouched.
>> 
>> I have implemented both these schemes for the sles9 kernel and would like to 
> get your input on your preference. I personally like option 2. Going forward, 
> the evolution of PV drivers needs to be constrained by the required support 
> for legacy Linux environments. 
>> 
>> Regards,
>> 
>> K. Y. Srinivasan 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Xen-  devel mailing list
>> Xen-  devel@lists.xensource.com
>> http://lists.xensource.com/xen-  devel
> 
> 
> _______________________________________________
> Xen-  devel mailing list
> Xen-  devel@lists.xensource.com
> http://lists.xensource.com/xen-  devel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: PV drivers for HVM guests
@ 2006-10-04 18:50 Ky Srinivasan
  0 siblings, 0 replies; 22+ messages in thread
From: Ky Srinivasan @ 2006-10-04 18:50 UTC (permalink / raw)
  To: Steven Smith; +Cc: xen-devel, sos22



>>> Steven Smith <sos22-xen@srcf.ucam.org> 10/04/06 6:24 AM >>> 
>> These differences can be dealt with in a couple of different ways:
>> 1) Modify the code in the PV drivers under appropriate compilation
>> switches to deal with the differences in the base kernels.
>> 2) Introduce a compatibility component that bridges the gap between
>> the current PV code and a given Linux target and leave much of the
>> PV driver code untouched.
>How much code is actually required in this abstraction layer?

Not a whole lot. The shim layer I currently have is about 80 lines (about 40 lines in a header file and about 40 lines in a c file). Along with this I have a few ifdefs in the PV driver code to deal with non-existent header files and non-existent fields in data structures such as struct bus_type, struct device etc. 

Regards,

K. Y

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: PV drivers for HVM guests
@ 2006-10-04 18:47 Ky Srinivasan
  0 siblings, 0 replies; 22+ messages in thread
From: Ky Srinivasan @ 2006-10-04 18:47 UTC (permalink / raw)
  To: Keir Fraser, Muli Ben-Yehuda; +Cc: xen-devel



>>> On Wed, Oct 4, 2006 at  4:15 AM, in message
<20061004081551.GC6274@rhun.haifa.ibm.com>, Muli Ben-Yehuda <muli@il.ibm.com>
wrote: 
> On Wed, Oct 04, 2006 at 08:56:45AM +0100, Keir Fraser wrote:
> 
>> > I have implemented both these schemes for the sles9 kernel and
>> > would like to get your input on your preference. I personally like
>> > option 2. Going forward, the evolution of PV drivers needs to be
>> > constrained by the required support for legacy Linux environments.
>> 
>> A shim layer (i.e., a set of compat macros) that avoids ifdef'ing
>> the core driver code is definitely the way to go.
> 
> FWIW, neither option has a chance of being accepted upstream. For
> upstream acceptance (assuming that it is a goal -   it should be,
> otherwise you forever chase the latest kernel API change, multiplied
> by the number of different distro kernel trees you support) just write
> the latest version of the driver to the latest kernel version. But I
> suspect you already know this :-  )
Agreed. Having a clean shim should help in getting the PV driver code upstream. 

Regards,

K. Y

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: PV drivers for HVM guests
@ 2006-10-04 18:45 Ky Srinivasan
  0 siblings, 0 replies; 22+ messages in thread
From: Ky Srinivasan @ 2006-10-04 18:45 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel



>>> On Wed, Oct 4, 2006 at  3:56 AM, in message
<C14927CD.2084%Keir.Fraser@cl.cam.ac.uk>, Keir Fraser
<Keir.Fraser@cl.cam.ac.uk> wrote: 
> On 3/10/06 9:31 pm, "Ky Srinivasan" <ksrinivasan@novell.com> wrote:
> 
>> These differences can be dealt with in a couple of different ways:
>> 1) Modify the code in the PV drivers under appropriate compilation switches 
> to
>> deal with the differences in the base kernels.
>> 2)  Introduce  a compatibility component that bridges the gap between the
>> current PV code and a given Linux target and leave much of the PV driver  
> code
>> untouched.
>> 
>> I have implemented both these schemes for the sles9 kernel and would like to
>> get your input on your preference. I personally like option 2. Going 
> forward,
>> the evolution of PV drivers needs to be constrained by the required support
>> for legacy Linux environments.
> 
> A shim layer (i.e., a set of compat macros) that avoids ifdef'ing the core
> driver code is definitely the way to go.
> 
>  --   Keir

Thanks Kier; this is also my preference. To keep the shim layer small, we may still have some ifdefs in the driver code  though(to deal with non-existent header files that are included etc).

Regards,

K. Y 

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: PV drivers for HVM guests
@ 2006-10-04 18:40 Ky Srinivasan
  0 siblings, 0 replies; 22+ messages in thread
From: Ky Srinivasan @ 2006-10-04 18:40 UTC (permalink / raw)
  To: Steve Ofsthun; +Cc: xen-devel



>>> On Tue, Oct 3, 2006 at  6:31 PM, in message <4522E4AA.4020700@virtualiron.com>,
Steve Ofsthun <sofsthun@virtualiron.com> wrote: 
> Ky Srinivasan wrote:
>> I am trying to build PV drivers for SLES9 HVM guests. SLES 9 is based on the 
> 2.6.5 kernel. Since the PV driver code is really designed for the latest 
> kernel release, I have had many issues/problems in building the PV drivers 
> for older Linux OS targets -   I have only been looking at the issues with 2.6.5 
> kernel base and I suspect the problem will be even worse if one were to look 
> at older Linux kernels. This is unfortunate since PV drivers are so critical 
> for HVM guests and there is considerable interest in supporting legacy Linux 
> environments as HVM guests. The problems I have had to deal with can be 
> broadly classified into:
>> 
>> a) Compiler related issues
>> b) Missing functionality in the legacy kernel -   this includes features as 
> well as changed data structures
>> c) Implementation differences of a given feature
>> 
>> These differences can be dealt with in a couple of different ways:
>> 1) Modify the code in the PV drivers under appropriate compilation switches 
> to deal with the differences in the base kernels.
>> 2)  Introduce  a compatibility component that bridges the gap between the 
> current PV code and a given Linux target and leave much of the PV driver  
> code untouched.
>> 
>> I have implemented both these schemes for the sles9 kernel and would like to 
> get your input on your preference. I personally like option 2. Going forward, 
> the evolution of PV drivers needs to be constrained by the required support 
> for legacy Linux environments.
> 
> We have generally taken approach 1, for supporting SLES9 32/64 & RHEL4 32/64, 
> with others 
> under development.  While the code is uglier, it is also more obvious to a 
> maintainer when 
> they run across something like the following:
> 
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
>          elevator_init(rq, "noop");
> #else
>          elevator_init(rq, &elevator_noop);
> #endif
> 
> or
> 
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
>                          end_that_request_last(
>                                  req, (bret-  >status == BLKIF_RSP_OKAY));
> #else
>                          end_that_request_last(req);
> #endif
> 
> In this way, the sensitive areas of the code are obvious.  As the PV drivers 
> move forward, 
> new kernel interface changes require similar changes.  As you mention, which 
> ever method 
> is used, some level of discipline is required in maintaining the PV drivers.
> 
> With your suggested option 2, does this require separate "compatibility 
> component" code 
> for each supported kernel version?  Or do you envision a single 
> compatibility layer that 
> would hide the conditionally compiled code from the PV drivers proper?

Based on the nature and extent of the changes we may either go with one compatibility component for all legacy kernel targets or one for each. 
> 
> There is also the issue of whether the PV drivers can/should support 
> multiple hypervisor 
> versions moving forward.
Good point. 
> 
> Steve

^ permalink raw reply	[flat|nested] 22+ messages in thread
* PV drivers for HVM guests
@ 2006-10-03 20:31 Ky Srinivasan
  2006-10-03 22:19 ` Andrew D. Ball
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Ky Srinivasan @ 2006-10-03 20:31 UTC (permalink / raw)
  To: xen-devel

I am trying to build PV drivers for SLES9 HVM guests. SLES 9 is based on the 2.6.5 kernel. Since the PV driver code is really designed for the latest kernel release, I have had many issues/problems in building the PV drivers for older Linux OS targets - I have only been looking at the issues with 2.6.5 kernel base and I suspect the problem will be even worse if one were to look at older Linux kernels. This is unfortunate since PV drivers are so critical for HVM guests and there is considerable interest in supporting legacy Linux environments as HVM guests. The problems I have had to deal with can be broadly classified into:

a) Compiler related issues
b) Missing functionality in the legacy kernel - this includes features as well as changed data structures
c) Implementation differences of a given feature

These differences can be dealt with in a couple of different ways:
1) Modify the code in the PV drivers under appropriate compilation switches to deal with the differences in the base kernels.
2)  Introduce  a compatibility component that bridges the gap between the current PV code and a given Linux target and leave much of the PV driver  code untouched.

I have implemented both these schemes for the sles9 kernel and would like to get your input on your preference. I personally like option 2. Going forward, the evolution of PV drivers needs to be constrained by the required support for legacy Linux environments. 

Regards,

K. Y. Srinivasan 

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

end of thread, other threads:[~2006-10-13  6:55 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-04 18:42 PV drivers for HVM guests Ky Srinivasan
2006-10-05 14:59 ` Andrew D. Ball
2006-10-05 15:13   ` Ky Srinivasan
  -- strict thread matches above, loose matches on Subject: below --
2006-10-04 18:50 Ky Srinivasan
2006-10-04 18:47 Ky Srinivasan
2006-10-04 18:45 Ky Srinivasan
2006-10-04 18:40 Ky Srinivasan
2006-10-03 20:31 Ky Srinivasan
2006-10-03 22:19 ` Andrew D. Ball
2006-10-03 22:31 ` Steve Ofsthun
2006-10-04  7:56 ` Keir Fraser
2006-10-04  8:15   ` Muli Ben-Yehuda
2006-10-04  8:17     ` Keir Fraser
2006-10-04 11:02     ` Gerd Hoffmann
2006-10-04 15:54       ` Andi Kleen
2006-10-04 10:24 ` Steven Smith
2006-10-05 15:21 ` Ian Campbell
2006-10-05 16:47   ` Ky Srinivasan
2006-10-10  8:00   ` DOI Tsunehisa
2006-10-11 10:46     ` DOI Tsunehisa
2006-10-13  2:00       ` DOI Tsunehisa
2006-10-13  6:55         ` Ian Campbell

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.