Enhance perf to collect KVM guest os statistics from host side
Subsystems (5)
PATCH 1/1 Enhance perf to collect KVM guest os statistics from host side
From: Zhang, Yanmin <[email protected]>
Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical bug and provided good suggestions with other guys. I really appreciate their kind help.
The patch adds new subcommand kvm to perf.
perf kvm top
perf kvm record
perf kvm report
perf kvm diff
The new perf could profile guest os kernel except guest os user space, but it could summarize guest os user space utilization per guest os.
Below are some examples.
1) perf kvm top
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules top
--------------------------------------------------------------------------------------------------------------------------
PerfTop: 16010 irqs/sec kernel:59.1% us: 1.5% guest kernel:31.9% guest us: 7.5% exact: 0.0% [1000Hz cycles], (all, 16 CPUs)
--------------------------------------------------------------------------------------------------------------------------
samples pcnt function DSO
_______ _____ _________________________ _______________________
38770.00 20.4% __ticket_spin_lock [guest.kernel.kallsyms]
22560.00 11.9% ftrace_likely_update [kernel.kallsyms]
9208.00 4.8% __lock_acquire [kernel.kallsyms]
5473.00 2.9% trace_hardirqs_off_caller [kernel.kallsyms]
5222.00 2.7% copy_user_generic_string [guest.kernel.kallsyms]
4450.00 2.3% validate_chain [kernel.kallsyms]
4262.00 2.2% trace_hardirqs_on_caller [kernel.kallsyms]
4239.00 2.2% do_raw_spin_lock [kernel.kallsyms]
3548.00 1.9% do_raw_spin_unlock [kernel.kallsyms]
2487.00 1.3% lock_release [kernel.kallsyms]
2165.00 1.1% __local_bh_disable [kernel.kallsyms]
1905.00 1.0% check_chain_key [kernel.kallsyms]
1737.00 0.9% lock_acquire [kernel.kallsyms]
1604.00 0.8% tcp_recvmsg [kernel.kallsyms]
1524.00 0.8% mark_lock [kernel.kallsyms]
1464.00 0.8% schedule [kernel.kallsyms]
1423.00 0.7% __d_lookup [guest.kernel.kallsyms]If you want to just show host data, pls. don't use parameter --guest. The headline includes guest os kernel and userspace percentage.
2) perf kvm record
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules record -f -a sleep 60
[ perf record: Woken up 15 times to write data ]
[ perf record: Captured and wrote 29.385 MB perf.data.kvm (~1283837 samples) ]
3) perf kvm report
3.1) [root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms
--guestmodules=/home/ymzhang/guest/modules report --sort pid --showcpuutilization>norm.host.guest.report.pid # Samples: 2453796285126
#
# Overhead sys us guest sys guest us Command: Pid
# ........ .....................
#
43.67% 1.35% 0.01% 39.06% 3.26% qemu-system-x86: 3913
3.78% 3.58% 0.20% 0.00% 0.00% tbench:13519
3.69% 3.66% 0.03% 0.00% 0.00% tbench_srv:13526Some performance guys require perf to show sys/us/guest_sys/guest_us per KVM guest instance which is actually just a multi-threaded process. Above sub parameter --showcpuutilization does so.
3.2) [root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms
--guestmodules=/home/ymzhang/guest/modules report >norm.host.guest.report # Samples: 2466991384118
#
# Overhead Command Shared Object Symbol
# ........ ............... ........................................................................ ......
#
29.11% qemu-system-x86 [guest.kernel.kallsyms] [g] __ticket_spin_lock
5.88% tbench_srv [kernel.kallsyms] [k] ftrace_likely_update
5.76% tbench [kernel.kallsyms] [k] ftrace_likely_update
3.88% qemu-system-x86 34c3255482 [u] 0x000034c3255482
1.83% tbench [kernel.kallsyms] [k] __lock_acquire
1.81% tbench_srv [kernel.kallsyms] [k] __lock_acquire
1.38% tbench_srv [kernel.kallsyms] [k] trace_hardirqs_off_caller
1.37% tbench [kernel.kallsyms] [k] trace_hardirqs_off_caller
1.13% qemu-system-x86 [guest.kernel.kallsyms] [g] copy_user_generic_string
1.04% tbench_srv [kernel.kallsyms] [k] validate_chain
1.00% tbench [kernel.kallsyms] [k] trace_hardirqs_on_caller
1.00% tbench_srv [kernel.kallsyms] [k] trace_hardirqs_on_caller
0.95% tbench [kernel.kallsyms] [k] do_raw_spin_lock[u] means it's in guest os user space. [g] means in guest os kernel. Other info is very direct. If it shows a module such like [ext4], it means guest kernel module, because native host kernel's modules are start from something like /lib/modules/XXX.
Below is the patch against tip/master tree of 15th March.
---
arch/x86/include/asm/perf_event.h +4 -11
@@ -143,17 +143,10 @@ extern void perf_events_lapic_init(void)*/ #define PERF_EFLAGS_EXACT (1UL << 3) -#define perf_misc_flags (regs) \ -({ int misc = 0; \ - if (user_mode(regs)) \ - misc |= PERF_RECORD_MISC_USER; \ - else \ - misc |= PERF_RECORD_MISC_KERNEL; \ - if (regs->flags & PERF_EFLAGS_EXACT) \ - misc |= PERF_RECORD_MISC_EXACT; \ - misc; }) - -#define perf_instruction_pointer (regs) ((regs)->ip) +struct pt_regs ; +extern unsigned long perf_instruction_pointer (struct pt_regs *regs); +extern unsigned long perf_misc_flags (struct pt_regs *regs); +#define perf_misc_flags (regs) perf_misc_flags(regs)#else static inline void init_hw_perf_events (void ) { }
arch/x86/include/asm/ptrace.h +9 -0
@@ -167,6 +167,15 @@ static inline int user_mode(struct pt_re#endif } +static inline int user_mode_cs (u16 cs) +{ +#ifdef CONFIG_X86_32 +return (cs &SEGMENT_RPL_MASK ) ==USER_RPL ; +#else +return !!(cs &3 ); +#endif +} +static inline int user_mode_vm (struct pt_regs *regs) {#ifdef CONFIG_X86_32
arch/x86/kernel/cpu/perf_event.c +27 -0
@@ -1707,3 +1707,30 @@ void perf_arch_fetch_caller_regs(structlocal_save_flags (regs->flags); }EXPORT_SYMBOL_GPL (perf_arch_fetch_caller_regs); + +unsigned long perf_instruction_pointer (struct pt_regs *regs) +{ +unsigned long ip; +if (perf_guest_cbs && perf_guest_cbs->is_in_guest ()) { + ip = perf_guest_cbs->get_guest_ip (); + }else + ip =instruction_pointer (regs); +return ip; +} + +unsigned long perf_misc_flags (struct pt_regs *regs) +{ +int misc =0 ; +if (perf_guest_cbs && perf_guest_cbs->is_in_guest ()) { + misc |= perf_guest_cbs->is_user_mode () ? +PERF_RECORD_MISC_GUEST_USER : +PERF_RECORD_MISC_GUEST_KERNEL ; + }else + misc |=user_mode (regs) ?PERF_RECORD_MISC_USER : +PERF_RECORD_MISC_KERNEL ; +if (regs->flags &PERF_EFLAGS_EXACT ) + misc |=PERF_RECORD_MISC_EXACT ; + +return misc; +} +
arch/x86/kvm/vmx.c +46 -1
78 lines not on this page · raw message
include/linux/perf_event.h +21 -1
@@ -288,11 +288,13 @@ struct perf_event_mmap_page {__u64 data_tail;/* user-space written tail */ }; -#define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) +#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)#define PERF_RECORD_MISC_KERNEL (1 << 0)#define PERF_RECORD_MISC_USER (2 << 0)#define PERF_RECORD_MISC_HYPERVISOR (3 << 0) +#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0) +#define PERF_RECORD_MISC_GUEST_USER (5 << 0)#define PERF_RECORD_MISC_EXACT (1 << 14)/*
@@ -446,6 +448,13 @@ enum perf_callchain_context {# include <asm/perf_event.h> #endif +struct perf_guest_info_callbacks { +int (*is_in_guest) (void ); +int (*is_user_mode) (void ); +unsigned long (*get_guest_ip) (void ); +void (*reset_in_guest) (void ); +}; +#ifdef CONFIG_HAVE_HW_BREAKPOINT #include <asm/hw_breakpoint.h> #endif
@@ -913,6 +922,12 @@ static inline void perf_event_mmap(struc__perf_event_mmap (vma); } +extern struct perf_guest_info_callbacks *perf_guest_cbs; +extern int perf_register_guest_info_callbacks ( +struct perf_guest_info_callbacks *); +extern int perf_unregister_guest_info_callbacks ( +struct perf_guest_info_callbacks *); +extern void perf_event_comm (struct task_struct *tsk);extern void perf_event_fork (struct task_struct *tsk);
@@ -982,6 +997,11 @@ perf_sw_event(u32 event_id, u64 nr, intstatic inline void perf_bp_event (struct perf_event *event,void *data) { } +static inline int perf_register_guest_info_callbacks +(struct perf_guest_info_callbacks *) {return 0 ; } +static inline int perf_unregister_guest_info_callbacks +(struct perf_guest_info_callbacks *) {return 0 ; } +static inline void perf_event_mmap (struct vm_area_struct *vma) { }static inline void perf_event_comm (struct task_struct *tsk) { }static inline void perf_event_fork (struct task_struct *tsk) { }
kernel/perf_event.c +22 -1
@@ -2796,6 +2796,27 @@ void perf_arch_fetch_caller_regs(struct }/* +* We assume there is only KVM supporting the callbacks. +* Later on, we might change it to a list if there is +* another virtualization implementation supporting the callbacks. +*/ +struct perf_guest_info_callbacks *perf_guest_cbs; + +int perf_register_guest_info_callbacks (struct perf_guest_info_callbacks * cbs) +{ + perf_guest_cbs = cbs; +return 0 ; +} +EXPORT_SYMBOL_GPL (perf_register_guest_info_callbacks); + +int perf_unregister_guest_info_callbacks (struct perf_guest_info_callbacks * cbs) +{ + perf_guest_cbs =NULL ; +return 0 ; +} +EXPORT_SYMBOL_GPL (perf_unregister_guest_info_callbacks); + +/* * Output */ static bool perf_output_space(struct perf_mmap_data *data, unsigned long tail,
@@ -3738,7 +3759,7 @@ void __perf_event_mmap(struct vm_area_st .event_id = { .header = { .type = PERF_RECORD_MMAP, - .misc = 0, + .misc = PERF_RECORD_MISC_USER, /* .size */ },/* .pid */
tools/perf/builtin-diff.c +4 -1
@@ -33,7 +33,7 @@ static int perf_session__add_hist_entry(return -ENOMEM ;if (hit) - he->count += count; +__perf_session__add_count (he, al, count);return 0 ; }
@@ -225,6 +225,9 @@ int cmd_diff(int argc, const char **argv input_new = argv[1 ]; }else input_new = argv[0 ]; + }else if (symbol_conf.guest_vmlinux_name || symbol_conf.guest_kallsyms) { + input_old ="perf.data.host" ; + input_new ="perf.data.guest" ; } symbol_conf.exclude_other = false;
tools/perf/builtin.h +1 -0
@@ -32,5 +32,6 @@ extern int cmd_version(int argc, const cextern int cmd_probe (int argc,const char **argv,const char *prefix);extern int cmd_kmem (int argc,const char **argv,const char *prefix);extern int cmd_lock (int argc,const char **argv,const char *prefix); +extern int cmd_kvm (int argc,const char **argv,const char *prefix);#endif
tools/perf/builtin-kvm.c +123 -0
123 lines not on this page · raw message
tools/perf/builtin-record.c +42 -2
60 lines not on this page · raw message
tools/perf/builtin-report.c +3 -1
@@ -104,7 +104,7 @@ static int perf_session__add_hist_entry(return -ENOMEM ;if (hit) - he->count += data->period; +__perf_session__add_count (he, al, data->period);if (symbol_conf.use_callchain) {if (!hit)
@@ -428,6 +428,8 @@ static const struct option options[] = { "sort by key(s): pid, comm, dso, symbol, parent"),OPT_BOOLEAN ('P' ,"full-paths" , &symbol_conf.full_paths,"Don't shorten the pathnames taking into account the cwd" ), +OPT_BOOLEAN (0 ,"showcpuutilization" , &symbol_conf.show_cpu_utilization, +"Show sample percentage for different cpu modes" ),OPT_STRING ('p' ,"parent" , &parent_pattern,"regex" ,"regex filter to identify parent, see: '--sort parent'" ), OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
tools/perf/builtin-top.c +34 -7
75 lines not on this page · raw message
tools/perf/Makefile +1 -0
@@ -462,6 +462,7 @@ BUILTIN_OBJS += builtin-trace.o BUILTIN_OBJS += builtin-probe.o BUILTIN_OBJS += builtin-kmem.o BUILTIN_OBJS += builtin-lock.o +BUILTIN_OBJS += builtin-kvm.o PERFLIBS = $(LIB_FILE)
tools/perf/perf.c +1 -0
@@ -308,6 +308,7 @@ static void handle_internal_command(int { "probe", cmd_probe, 0 }, { "kmem", cmd_kmem, 0 }, { "lock", cmd_lock, 0 }, + { "kvm", cmd_kvm, 0 }, };unsigned int i;static const char ext[] =STRIP_EXTENSION ;
tools/perf/perf.h +2 -0
@@ -133,4 +133,6 @@ struct ip_callchain { u64 ips[0]; }; +extern int perf_host, perf_guest; +#endif
tools/perf/util/event.c +151 -40
293 lines not on this page · raw message
tools/perf/util/event.h +10 -3
@@ -119,10 +119,17 @@ int event__synthesize_thread(pid_t pid,void event__synthesize_threads (event__handler_t process,struct perf_session *session);int event__synthesize_kernel_mmap (event__handler_t process, -struct perf_session *session, -const char *symbol_name); +struct perf_session *session, +const char *kallsyms_name, +const char *mmap_name, +struct map **maps, +const char *symbol_name, +unsigned int misc); +int event__synthesize_modules (event__handler_t process, -struct perf_session *session); +struct perf_session *session, +struct map_groups *kmaps, +unsigned int misc);int event__process_comm (event_t *self,struct perf_session *session);int event__process_lost (event_t *self,struct perf_session *session);
tools/perf/util/hist.c +63 -4
110 lines not on this page · raw message
tools/perf/util/hist.h +3 -0
@@ -12,6 +12,9 @@ struct addr_location;struct symbol ;struct rb_root ; +void __perf_session__add_count (struct hist_entry *he, +struct addr_location *al, +u64 count); struct hist_entry *__perf_session__add_hist_entry(struct rb_root *hists, struct addr_location *al, struct symbol *parent,
tools/perf/util/session.c +23 -9
@@ -54,7 +54,12 @@ out_close:static inline int perf_session__create_kernel_maps (struct perf_session *self) { -return map_groups__create_kernel_maps (&self->kmaps, self->vmlinux_maps); +int ret; + ret =map_groups__create_kernel_maps (&self->kmaps, self->vmlinux_maps); +if (ret >=0 ) + ret =map_groups__create_guest_kernel_maps (&self->guest_kmaps, + self->guest_vmlinux_maps); +return ret; }struct perf_session *perf_session__new (const char *filename,int mode,bool force)
@@ -77,6 +82,7 @@ struct perf_session *perf_session__new(c self->cwdlen =0 ; self->unknown_events =0 ;map_groups__init (&self->kmaps); +map_groups__init (&self->guest_kmaps);if (mode ==O_RDONLY ) {if (perf_session__open (self, force) <0 )
@@ -356,7 +362,8 @@ int perf_header__read_build_ids(struct pif (read (input, filename, len) != len) goto out; -if (bev.header.misc &PERF_RECORD_MISC_KERNEL ) +if ((bev.header.misc &PERF_RECORD_MISC_CPUMODE_MASK ) + ==PERF_RECORD_MISC_KERNEL ) head = &dsos__kernel; dso =__dsos__findnew (head, filename);
@@ -519,26 +526,33 @@ bool perf_session__has_traces(struct perreturn true; } -int perf_session__set_kallsyms_ref_reloc_sym (struct perf_session *self, +int perf_session__set_kallsyms_ref_reloc_sym (struct map ** maps,const char *symbol_name,u64 addr) {char *bracket;enum map_type i; +struct ref_reloc_sym *ref; - self->ref_reloc_sym.name =strdup (symbol_name); -if (self->ref_reloc_sym.name ==NULL ) + ref =zalloc (sizeof (struct ref_reloc_sym )); +if (ref ==NULL )return -ENOMEM ; - bracket =strchr (self->ref_reloc_sym.name,']' ); + ref->name =strdup (symbol_name); +if (ref->name ==NULL ) { +free (ref); +return -ENOMEM ; + } + + bracket =strchr (ref->name,']' );if (bracket) *bracket ='\0' ; - self->ref_reloc_sym.addr = addr; + ref->addr = addr;for (i =0 ; i <MAP__NR_TYPES ; ++i) { -struct kmap *kmap =map__kmap (self->vmlinux_maps[i]); - kmap->ref_reloc_sym = &self->ref_reloc_sym; +struct kmap *kmap =map__kmap (maps[i]); + kmap->ref_reloc_sym = ref; }return 0 ;
tools/perf/util/session.h +3 -16
@@ -16,16 +16,17 @@ struct perf_session {unsigned long size;unsigned long mmap_window;struct map_groups kmaps; +struct map_groups guest_kmaps;struct rb_root threads;struct thread *last_match;struct map *vmlinux_maps[MAP__NR_TYPES ]; +struct map *guest_vmlinux_maps[MAP__NR_TYPES ];struct events_stats events_stats;struct rb_root stats_by_id;unsigned long event_total[PERF_RECORD_MAX ];unsigned long unknown_events;struct rb_root hists;u64 sample_type; -struct ref_reloc_sym ref_reloc_sym;int fd;int cwdlen;char *cwd;
@@ -67,26 +68,12 @@ bool perf_session__has_traces(struct perint perf_header__read_build_ids (struct perf_header *self,int input,u64 offset,u64 file_size); -int perf_session__set_kallsyms_ref_reloc_sym (struct perf_session *self, +int perf_session__set_kallsyms_ref_reloc_sym (struct map ** maps,const char *symbol_name,u64 addr);void mem_bswap_64 (void *src,int byte_size); -static inline int __perf_session__create_kernel_maps (struct perf_session *self, -struct dso *kernel) -{ -return __map_groups__create_kernel_maps (&self->kmaps, - self->vmlinux_maps, kernel); -} - -static inline struct map * -perf_session__new_module_map (struct perf_session *self, -u64 start,const char *filename) -{ -return map_groups__new_module (&self->kmaps, start, filename); -} -#ifdef NO_NEWT_SUPPORT static inline void perf_session__browse_hists(struct rb_root *hists __used, u64 session_total __used,
tools/perf/util/sort.h +4 -0
@@ -44,6 +44,10 @@ extern enum sort_type sort__first_dimensstruct hist_entry {struct rb_node rb_node;u64 count; +u64 count_sys; +u64 count_us; +u64 count_guest_sys; +u64 count_guest_us;struct thread *thread;struct map *map;struct symbol *sym;
tools/perf/util/symbol.c +156 -21
345 lines not on this page · raw message
tools/perf/util/symbol.h +18 -4
@@ -63,10 +63,14 @@ struct symbol_conf { show_nr_samples, use_callchain, exclude_other, - full_paths; + full_paths, + show_cpu_utilization;const char *vmlinux_name, *field_sep; -char *dso_list_str, +const char *guest_vmlinux_name, + *guest_kallsyms, + *guest_modules; +char *dso_list_str, *comm_list_str, *sym_list_str, *col_width_list_str;
@@ -95,6 +99,13 @@ struct addr_location {u64 addr;char level;bool filtered; +unsigned int cpumode; +}; + +enum dso_kernel_type { +DSO_TYPE_USER =0 , +DSO_TYPE_KERNEL , +DSO_TYPE_GUEST_KERNEL };struct dso {
@@ -104,7 +115,7 @@ struct dso { u8 adjust_symbols:1; u8 slen_calculated:1; u8 has_build_id:1; - u8 kernel:1; +enum dso_kernel_type kernel; u8 hit:1; u8 annotate_warned:1;unsigned char origin;
@@ -119,6 +130,7 @@ struct dso {struct dso *dso__new (const char *name);struct dso *dso__new_kernel (const char *name); +struct dso *dso__new_guest_kernel (const char *name);void dso__delete (struct dso *self);bool dso__loaded (const struct dso *self,enum map_type type);
@@ -131,7 +143,7 @@ static inline void dso__set_loaded(strucvoid dso__sort_by_name (struct dso *self,enum map_type type); -extern struct list_head dsos__user, dsos__kernel; +extern struct list_head dsos__user, dsos__kernel, dsos__guest_user, dsos__guest_kernel;struct dso *__dsos__findnew (struct list_head *head,const char *name);
@@ -160,6 +172,8 @@ enum dso_origin {DSO__ORIG_BUILDID ,DSO__ORIG_DSO ,DSO__ORIG_KMODULE , +DSO__ORIG_GUEST_KERNEL , +DSO__ORIG_GUEST_KMODULE , DSO__ORIG_NOT_FOUND, };
tools/perf/util/thread.h +4 -1
@@ -82,6 +82,9 @@ int __map_groups__create_kernel_maps(strint map_groups__create_kernel_maps (struct map_groups *self,struct map *vmlinux_maps[MAP__NR_TYPES ]); +int map_groups__create_guest_kernel_maps (struct map_groups *self, +struct map *vmlinux_maps[MAP__NR_TYPES ]); +struct map *map_groups__new_module (struct map_groups *self,u64 start, -const char *filename); +const char *filename,int guest);#endif /* __PERF_THREAD_H */
Quoted 15 lines · Yanmin
From: Zhang, Yanmin<[email protected]>
Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical bug and provided good suggestions with other guys. I really appreciate their kind help.
The patch adds new subcommand kvm to perf.
perf kvm top
perf kvm record
perf kvm report
perf kvm diff
Quoted 9 lines
The new perf could profile guest os kernel except guest os user space, but it could summarize guest os user space utilization per guest os.
Below are some examples.
1) perf kvm top
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules top
Excellent, support for guest kernel != host kernel is critical (I can't remember the last time I ran same kernels).
How would we support multiple guests with different kernels? Perhaps a symbol server that perf can connect to (and that would connect to guests in turn)?
Quoted 17 lines
diff -Nraup
linux-2.6_tipmaster0315/arch/x86/kvm/vmx.clinux-2.6_tipmaster0315_perfkvm/arch/x86/kvm/vmx.carch/x86/kvm/vmx.c +3
-0@@ -26,6 +26,7 @@#include <linux/sched.h> #include <linux/moduleparam.h> #include <linux/ftrace_event.h> +#include <linux/perf_event.h> #include "kvm_cache_regs.h" #include "x86.h" @@ -3632,6 +3633,43 @@ static void update_cr8_intercept(structvmcs_write32 (TPR_THRESHOLD , irr); } +DEFINE_PER_CPU(int, kvm_in_guest) = {0}; +
arch/x86/kvm/vmx.c static void update_cr8_intercept(struct · line 3647
Quoted 10 lines
arch/x86/kvm/vmx.c +9
-0+static void kvm_set_in_guest (void ) +{ +percpu_write (kvm_in_guest,1 ); +} + +static int kvm_is_in_guest (void ) +{ +return percpu_read (kvm_in_guest); +}
There is already PF_VCPU for this.
arch/x86/kvm/vmx.c static void update_cr8_intercept(struct
Quoted 7 lines
arch/x86/kvm/vmx.c +6
-0+static struct perf_guest_info_callbacks kvm_guest_cbs = { + .is_in_guest = kvm_is_in_guest, + .is_user_mode = kvm_is_user_mode, + .get_guest_ip = kvm_get_guest_ip, + .reset_in_guest = kvm_reset_in_guest, +};
Should be in common code, not vmx specific.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 25 lines · Avi Kivity
Quoted 15 lines · Yanmin
From: Zhang, Yanmin<[email protected]>
Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical bug and provided good suggestions with other guys. I really appreciate their kind help.
The patch adds new subcommand kvm to perf.
perf kvm top
perf kvm record
perf kvm report
perf kvm diffQuoted 8 lines
The new perf could profile guest os kernel except guest os user space, but it could summarize guest os user space utilization per guest os.
Below are some examples.
1) perf kvm top
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules top
Quoted 6 lines
Excellent, support for guest kernel != host kernel is critical (I can't remember the last time I ran same kernels).
How would we support multiple guests with different kernels? Perhaps a symbol server that perf can connect to (and that would connect to guests in turn)?
The highest quality solution would be if KVM offered a 'guest extension' to the guest kernel's /proc/kallsyms that made it easy for user-space to get this information from an authorative source.
That's the main reason why the host side /proc/kallsyms is so popular and so
useful: while in theory it's mostly redundant information which can be gleaned from the System.map and other sources of symbol information, it's easily available and is _always_ trustable to come from the host kernel.
Separate System.map's have a tendency to go out of sync (or go missing when a devel kernel gets rebuilt, or if a devel package is not installed), and server ports (be that a TCP port space server or an UDP port space mount-point) are both a configuration hassle and are not guest-transparent.
So for instrumentation infrastructure (such as perf) we have a large and well founded preference for intrinsic, built-in, kernel-provided information: i.e. a largely 'built-in' and transparent mechanism to get to guest symbols.
Thanks,
Ingo
Quoted 45 lines · Ingo Molnar
Quoted 26 lines · Avi Kivity
Quoted 15 lines · Yanmin
From: Zhang, Yanmin<[email protected]>
Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical bug and provided good suggestions with other guys. I really appreciate their kind help.
The patch adds new subcommand kvm to perf.
perf kvm top
perf kvm record
perf kvm report
perf kvm diffQuoted 9 lines
The new perf could profile guest os kernel except guest os user space, but it could summarize guest os user space utilization per guest os.
Below are some examples.
1) perf kvm top
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules topQuoted 7 lines
Excellent, support for guest kernel != host kernel is critical (I can't remember the last time I ran same kernels).
How would we support multiple guests with different kernels? Perhaps a symbol server that perf can connect to (and that would connect to guests in turn)?
The highest quality solution would be if KVM offered a 'guest extension' to the guest kernel's
/proc/kallsymsthat made it easy for user-space to get this information from an authorative source.That's the main reason why the host side
/proc/kallsymsis so popular and so
useful: while in theory it's mostly redundant information which can be gleaned from the System.map and other sources of symbol information, it's easily available and is _always_ trustable to come from the host kernel.
Quoted 9 lines
Separate System.map's have a tendency to go out of sync (or go missing when a devel kernel gets rebuilt, or if a devel package is not installed), and server ports (be that a TCP port space server or an UDP port space mount-point) are both a configuration hassle and are not guest-transparent.
So for instrumentation infrastructure (such as perf) we have a large and well founded preference for intrinsic, built-in, kernel-provided information: i.e. a largely 'built-in' and transparent mechanism to get to guest symbols.
The symbol server's client can certainly access the bits through vmchannel.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 47 lines · Avi Kivity
Quoted 46 lines · Ingo Molnar
Quoted 24 lines · Avi Kivity
Quoted 15 lines · Yanmin
From: Zhang, Yanmin<[email protected]>
Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical bug and provided good suggestions with other guys. I really appreciate their kind help.
The patch adds new subcommand kvm to perf.
perf kvm top
perf kvm record
perf kvm report
perf kvm diffQuoted 8 lines
The new perf could profile guest os kernel except guest os user space, but it could summarize guest os user space utilization per guest os.
Below are some examples.
1) perf kvm top
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules topQuoted 6 lines
Excellent, support for guest kernel != host kernel is critical (I can't remember the last time I ran same kernels).
How would we support multiple guests with different kernels? Perhaps a symbol server that perf can connect to (and that would connect to guests in turn)?
The highest quality solution would be if KVM offered a 'guest extension' to the guest kernel's
/proc/kallsymsthat made it easy for user-space to get this information from an authorative source.That's the main reason why the host side
/proc/kallsymsis so popular and so
useful: while in theory it's mostly redundant information which can be gleaned from the System.map and other sources of symbol information, it's easily available and is _always_ trustable to come from the host kernel.Separate System.map's have a tendency to go out of sync (or go missing when a devel kernel gets rebuilt, or if a devel package is not installed), and server ports (be that a TCP port space server or an UDP port space mount-point) are both a configuration hassle and are not guest-transparent.
Quoted 5 lines
Quoted 3 lines
So for instrumentation infrastructure (such as perf) we have a large and well founded preference for intrinsic, built-in, kernel-provided information: i.e. a largely 'built-in' and transparent mechanism to get to guest symbols.
The symbol server's client can certainly access the bits through vmchannel.
Ok, that would work i suspect.
Would be nice to have the symbol server in tools/perf/ and also make it easy to add it to the initrd via a .config switch or so.
That would have basically all of the advantages of being built into the kernel (availability, configurability, transparency, hackability), while having all the advantages of a user-space approach as well (flexibility, extensibility, robustness, ease of maintenance, etc.).
If only we had tools/xorg/ integrated via the initrd that way ;-)
Thanks,
Ingo
Quoted 65 lines · Ingo Molnar
Quoted 54 lines · Avi Kivity
Quoted 52 lines · Ingo Molnar
Quoted 26 lines · Avi Kivity
Quoted 15 lines · Yanmin
From: Zhang, Yanmin<[email protected]>
Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical bug and provided good suggestions with other guys. I really appreciate their kind help.
The patch adds new subcommand kvm to perf.
perf kvm top
perf kvm record
perf kvm report
perf kvm diffQuoted 9 lines
The new perf could profile guest os kernel except guest os user space, but it could summarize guest os user space utilization per guest os.
Below are some examples.
1) perf kvm top
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules topQuoted 7 lines
Excellent, support for guest kernel != host kernel is critical (I can't remember the last time I ran same kernels).
How would we support multiple guests with different kernels? Perhaps a symbol server that perf can connect to (and that would connect to guests in turn)?
The highest quality solution would be if KVM offered a 'guest extension' to the guest kernel's
/proc/kallsymsthat made it easy for user-space to get this information from an authorative source.That's the main reason why the host side
/proc/kallsymsis so popular and so
useful: while in theory it's mostly redundant information which can be gleanedfrom the System.map and other sources of symbol information, it's easily
available and is _always_ trustable to come from the host kernel.
Separate System.map's have a tendency to go out of sync (or go missing when a devel kernel gets rebuilt, or if a devel package is not installed), and server ports (be that a TCP port space server or an UDP port space mount-point) are both a configuration hassle and are not guest-transparent.
Quoted 6 lines
Quoted 4 lines
So for instrumentation infrastructure (such as perf) we have a large and well founded preference for intrinsic, built-in, kernel-provided information: i.e. a largely 'built-in' and transparent mechanism to get to guest symbols.
The symbol server's client can certainly access the bits through vmchannel.
Ok, that would work i suspect.
Quoted 8 lines
Would be nice to have the symbol server in
tools/perf/and also make it easy to add it to the initrd via a .config switch or so.That would have basically all of the advantages of being built into the kernel (availability, configurability, transparency, hackability), while having all the advantages of a user-space approach as well (flexibility, extensibility, robustness, ease of maintenance, etc.).
Note, I am not advocating building the vmchannel client into the host kernel. While that makes everything simpler for the user, it increases the kernel footprint with all the disadvantages that come with that (any bug is converted into a host DoS or worse).
So, perf would connect to qemu via (say) a well-known unix domain socket, which would then talk to the guest kernel.
I know you won't like it, we'll continue to disagree on this unfortunately.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 59 lines · Avi Kivity
Quoted 58 lines · Ingo Molnar
Quoted 47 lines · Avi Kivity
Quoted 46 lines · Ingo Molnar
Quoted 24 lines · Avi Kivity
Quoted 15 lines · Yanmin
From: Zhang, Yanmin<[email protected]>
Based on the discussion in KVM community, I worked out the patch to support perf to collect guest os statistics from host side. This patch is implemented with Ingo, Peter and some other guys' kind help. Yang Sheng pointed out a critical bug and provided good suggestions with other guys. I really appreciate their kind help.
The patch adds new subcommand kvm to perf.
perf kvm top
perf kvm record
perf kvm report
perf kvm diffQuoted 8 lines
The new perf could profile guest os kernel except guest os user space, but it could summarize guest os user space utilization per guest os.
Below are some examples.
1) perf kvm top
[root@lkp-ne01 norm]# perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms --guestmodules=/home/ymzhang/guest/modules topQuoted 6 lines
Excellent, support for guest kernel != host kernel is critical (I can't remember the last time I ran same kernels).
How would we support multiple guests with different kernels? Perhaps a symbol server that perf can connect to (and that would connect to guests in turn)?
The highest quality solution would be if KVM offered a 'guest extension' to the guest kernel's
/proc/kallsymsthat made it easy for user-space to get this information from an authorative source.That's the main reason why the host side
/proc/kallsymsis so popular and so
useful: while in theory it's mostly redundant information which can be gleaned from the System.map and other sources of symbol information, it's easily available and is _always_ trustable to come from the host kernel.Separate System.map's have a tendency to go out of sync (or go missing when a devel kernel gets rebuilt, or if a devel package is not installed), and server ports (be that a TCP port space server or an UDP port space mount-point) are both a configuration hassle and are not guest-transparent.
Quoted 4 lines
Quoted 3 lines
So for instrumentation infrastructure (such as perf) we have a large and well founded preference for intrinsic, built-in, kernel-provided information: i.e. a largely 'built-in' and transparent mechanism to get to guest symbols.
The symbol server's client can certainly access the bits through vmchannel.
Ok, that would work i suspect.
Would be nice to have the symbol server in
tools/perf/and also make it easy to add it to the initrd via a .config switch or so.
Quoted 7 lines
Quoted 4 lines
That would have basically all of the advantages of being built into the kernel (availability, configurability, transparency, hackability), while having all the advantages of a user-space approach as well (flexibility, extensibility, robustness, ease of maintenance, etc.).
Note, I am not advocating building the vmchannel client into the host kernel. [...]
Neither am i. What i suggested was a user-space binary/executable built in tools/perf and put into the initrd.
That approach has the advantages i listed above, without having the disadvantages of in-kernel code you listed.
Thanks,
Ingo
Quoted 13 lines · Ingo Molnar
Quoted 13 lines
Quoted 13 lines
Quoted 3 lines
The symbol server's client can certainly access the bits through vmchannel.
Ok, that would work i suspect.
Would be nice to have the symbol server in
tools/perf/and also make it easy to add it to the initrd via a .config switch or so.That would have basically all of the advantages of being built into the kernel (availability, configurability, transparency, hackability), while having all the advantages of a user-space approach as well (flexibility, extensibility, robustness, ease of maintenance, etc.).
Quoted 6 lines
Quoted 3 lines
Note, I am not advocating building the vmchannel client into the host kernel. [...]
Neither am i. What i suggested was a user-space binary/executable built in
tools/perfand put into the initrd.
I'm confused - initrd seems to be guest-side. I was talking about the host side.
For the guest, placing the symbol server in tools/ is reasonable.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Ingo Molnar
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
The symbol server's client can certainly access the bits through vmchannel.
Ok, that would work i suspect.
Would be nice to have the symbol server in
tools/perf/and also make it easy to add it to the initrd via a .config switch or so.That would have basically all of the advantages of being built into the kernel (availability, configurability, transparency, hackability), while having all the advantages of a user-space approach as well (flexibility, extensibility, robustness, ease of maintenance, etc.).
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Note, I am not advocating building the vmchannel client into the host kernel. [...]
Neither am i. What i suggested was a user-space binary/executable built in
tools/perfand put into the initrd.I'm confused - initrd seems to be guest-side. I was talking about the host side.
host side doesnt need much support - just some client capability in perf itself. I suspect vmchannels are sufficiently flexible and configuration-free for such purposes? (i.e. like a filesystem in essence)
Ingo
Quoted 8 lines · Ingo Molnar
Quoted 4 lines
I'm confused - initrd seems to be guest-side. I was talking about the host side.
host side doesnt need much support - just some client capability in perf itself. I suspect vmchannels are sufficiently flexible and configuration-free for such purposes? (i.e. like a filesystem in essence)
I haven't followed vmchannel closely, but I think it is. vmchannel is terminated in qemu on the host side, not in the host kernel. So perf would need to connect to qemu.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 11 lines · Avi Kivity
Quoted 6 lines · Ingo Molnar
Quoted 3 lines
I'm confused - initrd seems to be guest-side. I was talking about the host side.
host side doesnt need much support - just some client capability in perf itself. I suspect vmchannels are sufficiently flexible and configuration-free for such purposes? (i.e. like a filesystem in essence)
I haven't followed vmchannel closely, but I think it is. vmchannel is terminated in qemu on the host side, not in the host kernel. So perf would need to connect to qemu.
Hm, that sounds rather messy if we want to use it to basically expose kernel functionality in a guest/host unified way. Is the qemu process discoverable in some secure way? Can we trust it? Is there some proper tooling available to do it, or do we have to push it through 2-3 packages to get such a useful feature done?
( That is the general thought process how many cross-discipline useful
desktop/server features hit the bit bucket before having had any chance of being vetted by users, and why Linux sucks so much when it comes to feature integration and application usability. )
Ingo
Quoted 8 lines · Ingo Molnar
Quoted 5 lines
I haven't followed vmchannel closely, but I think it is. vmchannel is terminated in qemu on the host side, not in the host kernel. So perf would need to connect to qemu.
Hm, that sounds rather messy if we want to use it to basically expose kernel functionality in a guest/host unified way. Is the qemu process discoverable in some secure way?
We know its pid.
Quoted 1 line
Can we trust it?
No choice, it contains the guest address space.
Quoted 4 lines
Is there some proper tooling available to do
it, or do we have to push it through 2-3 packages to get such a useful feature done?
libvirt manages qemu processes, but I don't think this should go through libvirt. qemu can do this directly by opening a unix domain socket in a well-known place.
Quoted 5 lines
( That is the general thought process how many cross-discipline useful
desktop/server features hit the bit bucket before having had any chance of being vetted by users, and why Linux sucks so much when it comes to feature integration and application usability. )
You can't solve everything in the kernel, even with a well populated tools/.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 10 lines · Avi Kivity
Quoted 7 lines · Ingo Molnar
Quoted 4 lines
I haven't followed vmchannel closely, but I think it is. vmchannel is terminated in qemu on the host side, not in the host kernel. So perf would need to connect to qemu.
Hm, that sounds rather messy if we want to use it to basically expose kernel functionality in a guest/host unified way. Is the qemu process discoverable in some secure way?
We know its pid.
How do i get a list of all 'guest instance PIDs', and what is the way to talk to Qemu?
Quoted 3 lines
Quoted 1 line
Can we trust it?
No choice, it contains the guest address space.
I mean, i can trust a kernel service and i can trust /proc/kallsyms.
Can perf trust a random process claiming to be Qemu? What's the trust mechanism here?
Quoted 6 lines
Quoted 2 lines
Is there some proper tooling available to do it, or do we have to push it through 2-3 packages to get such a useful feature done?
libvirt manages qemu processes, but I don't think this should go through libvirt. qemu can do this directly by opening a unix domain socket in a well-known place.
So Qemu has never run into such problems before?
( Sounds weird - i think Qemu configuration itself should be done via a
unix domain socket driven configuration protocol as well. )
Quoted 6 lines
Quoted 4 lines
( That is the general thought process how many cross-discipline useful
desktop/server features hit the bit bucket before having had any chance of being vetted by users, and why Linux sucks so much when it comes to feature integration and application usability. )You can't solve everything in the kernel, even with a well populated
tools/.
Certainly not, but this is a technical problem in the kernel's domain, so it's a fair (and natural) expectation to be able to solve this within the kernel project.
Ingo
Quoted 10 lines · Ingo Molnar
Quoted 7 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Quoted 5 lines
I haven't followed vmchannel closely, but I think it is. vmchannel is terminated in qemu on the host side, not in the host kernel. So perf would need to connect to qemu.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Hm, that sounds rather messy if we want to use it to basically expose kernel functionality in a guest/host unified way. Is the qemu process discoverable in some secure way?
We know its pid.
How do i get a list of all 'guest instance PIDs',
Libvirt manages all qemus, but this should be implemented independently of libvirt.
Quoted 3 lines
and what is the way to talk
to Qemu?
In general qemu exposes communication channels (such as the monitor) as tcp connections, unix-domain sockets, stdio, etc. It's very flexible.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Can we trust it?
No choice, it contains the guest address space.
I mean, i can trust a kernel service and i can trust
/proc/kallsyms.Can perf trust a random process claiming to be Qemu? What's the trust mechanism here?
Obviously you can't trust anything you get from a guest, no matter how you get it.
How do you trust a userspace program's symbols? you don't. How do you get them? they're on a well-known location.
Quoted 12 lines
Quoted 7 lines
Quoted 3 lines
Is there some proper tooling available to do it, or do we have to push it through 2-3 packages to get such a useful feature done?
libvirt manages qemu processes, but I don't think this should go through libvirt. qemu can do this directly by opening a unix domain socket in a well-known place.
So Qemu has never run into such problems before?
( Sounds weird - i think Qemu configuration itself should be done via a
unix domain socket driven configuration protocol as well. )
That's exactly what happens. You invoke qemu with -monitor unix:blah,server (or -qmp for a machine-readable format) and have your management application connect to that. You can redirect guest serial ports, console, parallel port, etc. to unix-domain or tcp sockets. vmchannel is an extension of that mechanism.
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
( That is the general thought process how many cross-discipline useful
desktop/server features hit the bit bucket before having had any chance of being vetted by users, and why Linux sucks so much when it comes to feature integration and application usability. )You can't solve everything in the kernel, even with a well populated
tools/.Certainly not, but this is a technical problem in the kernel's domain, so it's a fair (and natural) expectation to be able to solve this within the kernel project.
Someone writing perf-gui outside the kernel would have the same problems, no?
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 9 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
I mean, i can trust a kernel service and i can trust
/proc/kallsyms.Can perf trust a random process claiming to be Qemu? What's the trust mechanism here?
Obviously you can't trust anything you get from a guest, no matter how you get it.
I'm not talking about the symbol strings and addresses, and the object contents for allocation (or debuginfo). I'm talking about the basic protocol of establishing which guest is which.
I.e. we really want to be able users to:
1) have it all working with a single guest, without having to specify 'which' guest (qemu PID) to work with. That is the dominant usecase both for developers and for a fair portion of testers.
2) Have some reasonable symbolic identification for guests. For example a usable approach would be to have 'perf kvm list', which would list all currently active guests:
$ perf kvm list
[1] Fedora
[2] OpenSuse
[3] Windows-XP
[4] Windows-7
And from that point on 'perf kvm -g OpenSuse record' would do the obvious thing. Users will be able to just use the 'OpenSuse' symbolic name for that guest, even if the guest got restarted and switched its main PID.
Any such facility needs trusted enumeration and a protocol where i can trust that the information i got is authorative. (I.e. 'OpenSuse' truly matches to the OpenSuse session - not to some local user starting up a Qemu instance that claims to be 'OpenSuse'.)
Is such a scheme possible/available? I suspect all the KVM configuration tools (i havent used them in some time - gui and command-line tools alike) use similar methods to ease guest management?
Ingo
Quoted 6 lines · Ingo Molnar
Quoted 6 lines
Quoted 6 lines
I mean, i can trust a kernel service and i can trust
/proc/kallsyms.Can perf trust a random process claiming to be Qemu? What's the trust mechanism here?
Quoted 7 lines
Quoted 3 lines
Obviously you can't trust anything you get from a guest, no matter how you get it.
I'm not talking about the symbol strings and addresses, and the object contents for allocation (or debuginfo). I'm talking about the basic protocol of establishing which guest is which.
There is none. So far, qemu only dealt with managing just its own guest, and left all multiple guest management to higher levels up the stack (like libvirt).
Quoted 6 lines
I.e. we really want to be able users to:
1) have it all working with a single guest, without having to specify 'which' guest (qemu PID) to work with. That is the dominant usecase both for developers and for a fair portion of testers.
That's reasonable if we can get it working simply.
Quoted 14 lines
2) Have some reasonable symbolic identification for guests. For example a usable approach would be to have 'perf kvm list', which would list all currently active guests:
$ perf kvm list
[1] Fedora
[2] OpenSuse
[3] Windows-XP
[4] Windows-7And from that point on 'perf kvm -g OpenSuse record' would do the obvious thing. Users will be able to just use the 'OpenSuse' symbolic name for that guest, even if the guest got restarted and switched its main PID.
Quoted 9 lines
Any such facility needs trusted enumeration and a protocol where i can trust that the information i got is authorative. (I.e. 'OpenSuse' truly matches to the OpenSuse session - not to some local user starting up a Qemu instance that claims to be 'OpenSuse'.)
Is such a scheme possible/available? I suspect all the KVM configuration tools (i havent used them in some time - gui and command-line tools alike) use similar methods to ease guest management?
You can do that through libvirt, but that only works for guests started through libvirt. libvirt provides command-line tools to list and manage guests (for example autostarting them on startup), and tools built on top of libvirt can manage guests graphically.
Looks like we have a layer inversion here. Maybe we need a plugin system - libvirt drops a .so into perf that teaches it how to list guests and get their symbols.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 16 lines · Avi Kivity
Quoted 10 lines · Ingo Molnar
Quoted 7 lines
Quoted 5 lines
I mean, i can trust a kernel service and i can trust
/proc/kallsyms.Can perf trust a random process claiming to be Qemu? What's the trust mechanism here?
Obviously you can't trust anything you get from a guest, no matter how you get it.
I'm not talking about the symbol strings and addresses, and the object contents for allocation (or debuginfo). I'm talking about the basic protocol of establishing which guest is which.
There is none. So far, qemu only dealt with managing just its own guest, and left all multiple guest management to higher levels up the stack (like libvirt).
Quoted 7 lines
Quoted 5 lines
I.e. we really want to be able users to:
1) have it all working with a single guest, without having to specify 'which' guest (qemu PID) to work with. That is the dominant usecase both for developers and for a fair portion of testers.
That's reasonable if we can get it working simply.
IMO such ease of use is reasonable and required, full stop.
If it cannot be gotten simply then that's a bug: either in the code, or in the design, or in the development process that led to the design. Bugs need fixing.
Quoted 23 lines
Quoted 14 lines
2) Have some reasonable symbolic identification for guests. For example a usable approach would be to have 'perf kvm list', which would list all currently active guests:
$ perf kvm list
[1] Fedora
[2] OpenSuse
[3] Windows-XP
[4] Windows-7And from that point on 'perf kvm -g OpenSuse record' would do the obvious thing. Users will be able to just use the 'OpenSuse' symbolic name for that guest, even if the guest got restarted and switched its main PID.
Quoted 8 lines
Any such facility needs trusted enumeration and a protocol where i can trust that the information i got is authorative. (I.e. 'OpenSuse' truly matches to the OpenSuse session - not to some local user starting up a Qemu instance that claims to be 'OpenSuse'.)
Is such a scheme possible/available? I suspect all the KVM configuration tools (i havent used them in some time - gui and command-line tools alike) use similar methods to ease guest management?
Quoted 8 lines
You can do that through libvirt, but that only works for guests started through libvirt. libvirt provides command-line tools to list and manage guests (for example autostarting them on startup), and tools built on top of libvirt can manage guests graphically.
Looks like we have a layer inversion here. Maybe we need a plugin system - libvirt drops a .so into perf that teaches it how to list guests and get their symbols.
Is libvirt used to start up all KVM guests? If not, if it's only used on some distros while other distros have other solutions then there's apparently no good way to get to such information, and the kernel bits of KVM do not provide it.
To the user (and to me) this looks like a KVM bug / missing feature. (and the user doesnt care where the blame is) If that is true then apparently the current KVM design has no technically actionable solution for certain categories of features!
Ingo
Quoted 6 lines · Ingo Molnar
Quoted 6 lines
You can do that through libvirt, but that only works for guests started through libvirt. libvirt provides command-line tools to list and manage guests (for example autostarting them on startup), and tools built on top of libvirt can manage guests graphically.
Quoted 9 lines
Quoted 4 lines
Looks like we have a layer inversion here. Maybe we need a plugin system - libvirt drops a .so into perf that teaches it how to list guests and get their symbols.
Is libvirt used to start up all KVM guests? If not, if it's only used on some distros while other distros have other solutions then there's apparently no good way to get to such information, and the kernel bits of KVM do not provide it.
Developers tend to start qemu from the command line, but the majority of users and all distros I know of use libvirt. Some users cobble up their own scripts.
Quoted 5 lines
To the user (and to me) this looks like a KVM bug / missing feature. (and the user doesnt care where the blame is) If that is true then apparently the current KVM design has no technically actionable solution for certain categories of features!
A plugin system allows anyone who is interested to provide the information; they just need to write a plugin for their management tool.
Since we can't prevent people from writing management tools, I don't see what else we can do.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 7 lines · Ingo Molnar
[...]
Quoted 6 lines
Quoted 5 lines
I.e. we really want to be able users to:
1) have it all working with a single guest, without having to specify 'which' guest (qemu PID) to work with. That is the dominant usecase both for developers and for a fair portion of testers.
Quoted 6 lines
Quoted 1 line
That's reasonable if we can get it working simply.
IMO such ease of use is reasonable and required, full stop.
If it cannot be gotten simply then that's a bug: either in the code, or in the design, or in the development process that led to the design. Bugs need fixing. [...]
Perhaps the fact that kvm happens to deal with an interesting application area (virtualization) is misleading here. As far as the host kernel or other host userspace is concerned, qemu is just some random unprivileged userspace program (with some *optional* /dev/kvm services that might happen to require temporary root).
As such, perf trying to instrument qemu is no different than perf trying to instrument any other userspace widget. Therefore, expecting 'trusted enumeration' of instances is just as sensible as using 'trusted ps' and 'trusted /var/run/FOO.pid files'.
- FChE
Quoted 23 lines · Frank Ch. Eigler
Quoted 7 lines · Ingo Molnar
[...]
Quoted 6 lines
Quoted 5 lines
I.e. we really want to be able users to:
1) have it all working with a single guest, without having to specify 'which' guest (qemu PID) to work with. That is the dominant usecase both for developers and for a fair portion of testers.
Quoted 6 lines
Quoted 1 line
That's reasonable if we can get it working simply.
IMO such ease of use is reasonable and required, full stop.
If it cannot be gotten simply then that's a bug: either in the code, or in the design, or in the development process that led to the design. Bugs need fixing. [...]Perhaps the fact that kvm happens to deal with an interesting application area (virtualization) is misleading here. As far as the host kernel or other host userspace is concerned, qemu is just some random unprivileged userspace program (with some *optional*
/dev/kvmservices that might happen to require temporary root).
Quoted 4 lines
As such, perf trying to instrument qemu is no different than perf trying to instrument any other userspace widget. Therefore, expecting 'trusted enumeration' of instances is just as sensible as using 'trusted ps' and 'trusted
/var/run/FOO.pidfiles'.
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
( Which can be seen from the simple fact that what started the discussion was
'how do we get /proc/kallsyms from the guest'. I.e. an extension of the existing host-space /proc/kallsyms was desired. )
In that sense the most natural 'extension' would be the solution i mentioned a week or two ago: to have a (read only) mount of all guest filesystems, plus a channel for profiling/tracing data. That would make symbol parsing easier and it's what extends the existing 'host space' abstraction in the most natural way.
( It doesnt even have to be done via the kernel - Qemu could implement that
via FUSE for example. )
As a second best option a 'symbol server' might be used too.
Thanks,
Ingo
Hi -
Quoted 9 lines · Ingo Molnar
[...]
Quoted 4 lines
Perhaps the fact that kvm happens to deal with an interesting application area (virtualization) is misleading here. As far as the host kernel or other host userspace is concerned, qemu is just some random unprivileged userspace program [...]
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
I don't know what "extension of system/kernel services" means in this context, beyond something running on the system/kernel, like every other process. To clarify, to what extent do you consider your classification similarly clear for a host is running
* multiple kvm instances run as unprivileged users
* non-kvm OS simulators such as vmware or xen or gdb
* kvm instances running something other than linux
Quoted 4 lines
( Which can be seen from the simple fact that what started the discussion was 'how do we get
/proc/kallsymsfrom the guest'. I.e. an extension of the existing host-space/proc/kallsymswas desired. )
(Sorry, that smacks of circular reasoning.)
It may be a charming convenience function for perf users to give them shortcuts for certain favoured configurations (kvm running freshest linux), but that says more about perf than kvm.
- FChE
Quoted 9 lines · Frank Ch. Eigler
Hi -
Quoted 5 lines · Ingo Molnar
[...]
Quoted 4 lines
Perhaps the fact that kvm happens to deal with an interesting application area (virtualization) is misleading here. As far as the host kernel or other host userspace is concerned, qemu is just some random unprivileged userspace program [...]
Quoted 7 lines
Quoted 3 lines
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
I don't know what "extension of system/kernel services" means in this context, beyond something running on the system/kernel, like every other process. [...]
It means something like my example of 'extended to guest space' /proc/kallsyms:
Quoted 7 lines
Quoted 5 lines
[...]
( Which can be seen from the simple fact that what started the
discussion was 'how do we get/proc/kallsymsfrom the guest'. I.e. an extension of the existing host-space/proc/kallsymswas desired. )(Sorry, that smacks of circular reasoning.)
To me it sounds like an example supporting my point. /proc/kallsyms is a service by the kernel, and 'perf kvm' desires this to be extended to guest space as well.
Thanks,
Ingo
Quoted 7 lines · Ingo Molnar
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
( Which can be seen from the simple fact that what started the discussion was
'how do we get/proc/kallsymsfrom the guest'. I.e. an extension of the existing host-space/proc/kallsymswas desired. )
Random tools (like perf) should not be able to do what you describe. It's a security nightmare.
If it's desirable to have /proc/kallsyms available, we can expose an interface in QEMU to provide that. That can then be plumbed through libvirt and QMP.
Then a management tool can use libvirt or QMP to obtain that information and interact with the kernel appropriately.
Quoted 9 lines
In that sense the most natural 'extension' would be the solution i mentioned a week or two ago: to have a (read only) mount of all guest filesystems, plus a channel for profiling/tracing data. That would make symbol parsing easier and it's what extends the existing 'host space' abstraction in the most natural way.
( It doesnt even have to be done via the kernel - Qemu could implement that
via FUSE for example. )
No way. The guest has sensitive data and exposing it widely on the host is a bad thing to do. It's a bad interface. We can expose specific information about guests but only through our existing channels which are validated through a security infrastructure.
Ultimately, your goal is to keep perf a simple tool with little dependencies. But practically speaking, if you want to add features to it, it's going to have to interact with other subsystems in the appropriate way. That means, it's going to need to interact with libvirt or QMP.
If you want all applications to expose their data via synthetic file systems, then there's always plan9 :-)
Regards,
Anthony Liguori
Quoted 10 lines · Anthony Liguori
Quoted 6 lines · Ingo Molnar
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
( Which can be seen from the simple fact that what started the discussion was
'how do we get/proc/kallsymsfrom the guest'. I.e. an extension of the existing host-space/proc/kallsymswas desired. )Random tools (like perf) should not be able to do what you describe. It's a security nightmare.
A security nightmare exactly how? Mind to go into details as i dont understand your point.
Quoted 13 lines
If it's desirable to have
/proc/kallsymsavailable, we can expose an interface in QEMU to provide that. That can then be plumbed through libvirt and QMP.Then a management tool can use libvirt or QMP to obtain that information and interact with the kernel appropriately.
Quoted 6 lines
In that sense the most natural 'extension' would be the solution i mentioned a week or two ago: to have a (read only) mount of all guest filesystems, plus a channel for profiling/tracing data. That would make symbol parsing easier and it's what extends the existing 'host space' abstraction in the most natural way.
Quoted 5 lines
Quoted 2 lines
( It doesnt even have to be done via the kernel - Qemu could implement that
via FUSE for example. )No way. The guest has sensitive data and exposing it widely on the host is a bad thing to do. [...]
Firstly, you are putting words into my mouth, as i said nothing about 'exposing it widely'. I suggest exposing it under the privileges of whoever has access to the guest image.
Secondly, regarding confidentiality, and this is guest security 101: whoever can access the image on the host _already_ has access to all the guest data!
A Linux image can generally be loopback mounted straight away:
losetup -o 32256 /dev/loop0 ./guest-image.img
mount -o ro /dev/loop0 /mnt-guest
(Or, if you are an unprivileged user who cannot mount, it can be read via ext2 tools.)
There's nothing the guest can do about that. The host is in total control of guest image data for heaven's sake!
All i'm suggesting is to make what is already possible more convenient.
Ingo
Quoted 12 lines · Ingo Molnar
Quoted 9 lines · Anthony Liguori
Quoted 7 lines · Ingo Molnar
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
( Which can be seen from the simple fact that what started the discussion was
'how do we get/proc/kallsymsfrom the guest'. I.e. an extension of the existing host-space/proc/kallsymswas desired. )
Quoted 6 lines
Quoted 3 lines
Random tools (like perf) should not be able to do what you describe. It's a security nightmare.
A security nightmare exactly how? Mind to go into details as i dont understand your point.
Assume you're using SELinux to implement mandatory access control. How do you label this file system?
Generally speaking, we don't know the difference between /proc/kallsyms vs. /dev/mem if we do generic passthrough. While it might be safe to have a relaxed label of kallsyms (since it's read only), it's clearly not safe to do that for /dev/mem, /etc/shadow, or any file containing sensitive information.
Rather, we ought to expose a higher level interface that we have more confidence in with respect to understanding the ramifications of exposing that guest data.
Quoted 8 lines
Quoted 4 lines
No way. The guest has sensitive data and exposing it widely on the host is a bad thing to do. [...]
Firstly, you are putting words into my mouth, as i said nothing about 'exposing it widely'. I suggest exposing it under the privileges of whoever has access to the guest image.
That doesn't work as nicely with SELinux.
It's completely reasonable to have a user that can interact in a read only mode with a VM via libvirt but cannot read the guest's disk images or the guest's memory contents.
Quoted 5 lines
Secondly, regarding confidentiality, and this is guest security 101: whoever can access the image on the host _already_ has access to all the guest data!
A Linux image can generally be loopback mounted straight away:
Quoted 9 lines
losetup -o 32256
/dev/loop0./guest-image.img
mount -o ro/dev/loop0/mnt-guest(Or, if you are an unprivileged user who cannot mount, it can be read via ext2 tools.)
There's nothing the guest can do about that. The host is in total control of guest image data for heaven's sake!
It's not that simple in a MAC environment.
Regards,
Anthony Liguori
Quoted 4 lines
All i'm suggesting is to make what is already possible more convenient.
Ingo
Quoted 15 lines · Anthony Liguori
Quoted 6 lines · Ingo Molnar
Quoted 4 lines · Anthony Liguori
Quoted 3 lines · Ingo Molnar
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
( Which can be seen from the simple fact that what started the discussion was
'how do we get/proc/kallsymsfrom the guest'. I.e. an extension of the existing host-space/proc/kallsymswas desired. )Random tools (like perf) should not be able to do what you describe. It's a security nightmare.
A security nightmare exactly how? Mind to go into details as i dont understand your point.
Quoted 8 lines
Assume you're using SELinux to implement mandatory access control. How do you label this file system?
Generally speaking, we don't know the difference between
/proc/kallsymsvs./dev/memif we do generic passthrough. While it might be safe to have a relaxed label of kallsyms (since it's read only), it's clearly not safe to do that for/dev/mem,/etc/shadow, or any file containing sensitive information.
What's your _point_? Please outline a threat model, a vector of attack, _anything_ that substantiates your "it's a security nightmare" claim.
Quoted 3 lines
Rather, we ought to expose a higher level interface that we have more confidence in with respect to understanding the ramifications of exposing that guest data.
Exactly, we want something that has a flexible namespace and works well with Linux tools in general. Preferably that namespace should be human readable, and it should be hierarchic, and it should have a well-known permission model.
This concept exists in Linux and is generally called a 'filesystem'.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
No way. The guest has sensitive data and exposing it widely on the host is a bad thing to do. [...]
Firstly, you are putting words into my mouth, as i said nothing about 'exposing it widely'. I suggest exposing it under the privileges of whoever has access to the guest image.
Quoted 5 lines
That doesn't work as nicely with SELinux.
It's completely reasonable to have a user that can interact in a read only mode with a VM via libvirt but cannot read the guest's disk images or the guest's memory contents.
If a user cannot read the image file then the user has no access to its contents via other namespaces either. That is, of course, a basic security aspect.
( That is perfectly true with a non-SELinux Unix permission model as well, and
is true in the SELinux case as well. )
Quoted 8 lines
Quoted 8 lines
Secondly, regarding confidentiality, and this is guest security 101: whoever can access the image on the host _already_ has access to all the guest data!
A Linux image can generally be loopback mounted straight away:
losetup -o 32256
/dev/loop0./guest-image.img
mount -o ro/dev/loop0/mnt-guest
Quoted 7 lines
Quoted 5 lines
(Or, if you are an unprivileged user who cannot mount, it can be read via ext2 tools.)
There's nothing the guest can do about that. The host is in total control of guest image data for heaven's sake!
It's not that simple in a MAC environment.
Erm. Please explain to me, what exactly is 'not that simple' in a MAC environment?
Also, i'd like to note that the 'restrictive SELinux setups' usecases are pretty secondary.
To demonstrate that, i'd like every KVM developer on this list who reads this mail and who has their home development system where they produce their patches set up in a restrictive MAC environment, in that you cannot even read the images you are using, to chime in with a "I'm doing that" reply.
If there's just a _single_ KVM developer amongst dozens and dozens of developers on this list who develops in an environment like that i'd be surprised. That result should pretty much tell you where the weight of instrumentation focus should lie - and it isnt on restrictive MAC environments
...
Ingo
Quoted 26 lines · Ingo Molnar
Quoted 23 lines · Anthony Liguori
Quoted 12 lines · Ingo Molnar
Quoted 9 lines · Anthony Liguori
Quoted 7 lines · Ingo Molnar
You are quite mistaken: KVM isnt really a 'random unprivileged application' in this context, it is clearly an extension of system/kernel services.
( Which can be seen from the simple fact that what started the discussion was
'how do we get/proc/kallsymsfrom the guest'. I.e. an extension of the existing host-space/proc/kallsymswas desired. )Quoted 6 lines
Quoted 3 lines
Random tools (like perf) should not be able to do what you describe. It's a security nightmare.
A security nightmare exactly how? Mind to go into details as i dont understand your point.
Assume you're using SELinux to implement mandatory access control. How do you label this file system?
Quoted 9 lines
Quoted 6 lines
Generally speaking, we don't know the difference between
/proc/kallsymsvs./dev/memif we do generic passthrough. While it might be safe to have a relaxed label of kallsyms (since it's read only), it's clearly not safe to do that for/dev/mem,/etc/shadow, or any file containing sensitive information.What's your _point_? Please outline a threat model, a vector of attack, _anything_ that substantiates your "it's a security nightmare" claim.
You suggested "to have a (read only) mount of all guest filesystems".
As I described earlier, not all of the information within the guest filesystem has the same level of sensitivity. If you exposed a generic interface like this, it makes it very difficult to delegate privileges.
Delegating privileges is important because from in a higher security environment, you may want to prevent a management tool from accessing the VM's disk directly, but still allow it to do basic operations (in particular, to view performance statistics).
Quoted 10 lines
Quoted 4 lines
Rather, we ought to expose a higher level interface that we have more confidence in with respect to understanding the ramifications of exposing that guest data.
Exactly, we want something that has a flexible namespace and works well with Linux tools in general. Preferably that namespace should be human readable, and it should be hierarchic, and it should have a well-known permission model.
This concept exists in Linux and is generally called a 'filesystem'.
If you want to use a synthetic filesystem as the management interface for qemu, that's one thing. But you suggested exposing the guest filesystem in its entirely and that's what I disagreed with.
Quoted 7 lines
If a user cannot read the image file then the user has no access to its contents via other namespaces either. That is, of course, a basic security aspect.
( That is perfectly true with a non-SELinux Unix permission model as well, and
is true in the SELinux case as well. )
I don't think that's reasonable at all. The guest may encrypt it's disk image. It still ought to be possible to run perf against that guest, no?
Quoted 11 lines
Erm. Please explain to me, what exactly is 'not that simple' in a MAC environment?
Also, i'd like to note that the 'restrictive SELinux setups' usecases are pretty secondary.
To demonstrate that, i'd like every KVM developer on this list who reads this mail and who has their home development system where they produce their patches set up in a restrictive MAC environment, in that you cannot even read the images you are using, to chime in with a "I'm doing that" reply.
My home system doesn't run SELinux but I work daily with systems that are using SELinux.
I want to be able to run tools like perf on these systems because ultimately, I need to debug these systems on a daily basis.
But that's missing the point. We want to have an interface that works for both cases so that we're not maintaining two separate interfaces.
We've rat holed a bit though. You want:
1) to run perf kvm list and be able to enumerate KVM guests
2) for this to Just Work with qemu guests launched from the command line
You could achieve (1) by tying perf to libvirt but that won't work for (2). There are a few practical problems with (2).
qemu does not require the user to associate any uniquely identifying information with a VM. We've also optimized the command line use case so that if all you want to do is run a disk image, you just execute "qemu foo.img". To satisfy your use case, we would either have to force a use to always specify unique information, which would be less convenient for our users or we would have to let the name be an optional parameter.
As it turns out, we already support "qemu -name Fedora foo.img". What we don't do today, but I've been suggesting we should, is automatically create a QMP management socket in a well known location based on the -name parameter when it's specified. That would let a tool like perf Just Work provided that a user specified -name.
No one uses -name today though and I'm sure you don't either.
The only way to really address this is to change the interaction. Instead of running perf externally to qemu, we should support a perf command in the qemu monitor that can then tie directly to the perf tooling. That gives us the best possible user experience.
We can't do that though unless perf is a library or is in some way more programmatic.
Regards,
Anthony Liguori
Hi -
Quoted 5 lines · Anthony Liguori
[...]
The only way to really address this is to change the interaction. Instead of running perf externally to qemu, we should support a perf command in the qemu monitor that can then tie directly to the perf tooling. That gives us the best possible user experience.
To what extent could this be solved with less crossing of isolation/abstraction layers, if the perfctr facilities were properly virtualized? That way guests could run perf goo internally. Optionally virt tools on the host side could aggregate data from cooperating self-monitoring guests.
- FChE
Quoted 10 lines · Frank Ch. Eigler
Hi -
Quoted 6 lines · Anthony Liguori
[...]
The only way to really address this is to change the interaction. Instead of running perf externally to qemu, we should support a perf command in the qemu monitor that can then tie directly to the perf tooling. That gives us the best possible user experience.
Quoted 4 lines
To what extent could this be solved with less crossing of isolation/abstraction layers, if the perfctr facilities were properly virtualized?
That's the more interesting (by far) usage model. In general guest owners don't have access to the host, and host owners can't (and shouldn't) change guests.
Monitoring guests from the host is useful for kvm developers, but less so for users.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 2 lines · Avi Kivity
Monitoring guests from the host is useful for kvm developers, but less so for users.
Guest space profiling is easy, and 'perf kvm' is not about that. (plain 'perf' will work if a proper paravirt channel is opened to the host)
I think you might have misunderstood the purpose and role of the 'perf kvm' patch here? 'perf kvm' is aimed at KVM developers: it is them who improve KVM code, not guest kernel users.
Ingo
Quoted 6 lines · Ingo Molnar
Quoted 3 lines · Avi Kivity
Monitoring guests from the host is useful for kvm developers, but less so for users.
Quoted 7 lines
Guest space profiling is easy, and 'perf kvm' is not about that. (plain 'perf' will work if a proper paravirt channel is opened to the host)
I think you might have misunderstood the purpose and role of the 'perf kvm' patch here? 'perf kvm' is aimed at KVM developers: it is them who improve KVM code, not guest kernel users.
Of course I understood it. My point was that 'perf kvm' serves a tiny minority of users. That doesn't mean it isn't useful, just that it doesn't satisfy all needs by itself.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Ingo Molnar
Quoted 2 lines · Avi Kivity
Monitoring guests from the host is useful for kvm developers, but less so for users.
Guest space profiling is easy, and 'perf kvm' is not about that. (plain 'perf' will work if a proper paravirt channel is opened to the host)
Quoted 6 lines
Quoted 3 lines
I think you might have misunderstood the purpose and role of the 'perf kvm' patch here? 'perf kvm' is aimed at KVM developers: it is them who improve KVM code, not guest kernel users.
Of course I understood it. My point was that 'perf kvm' serves a tiny minority of users. [...]
I hope you wont be disappointed to learn that 100% of Linux, all 13+ million lines of it, was and is being developed by a tiny, tiny, tiny minority of users ;-)
Quoted 2 lines
[...] That doesn't mean it isn't useful, just that it doesn't satisfy all needs by itself.
Of course - and it doesnt bring world peace either. One step at a time.
Thanks,
Ingo
Hi Avi, Ingo,
I've been following through this long thread since the very first email.
I'm a performance engineer whose job is to tune workloads run on top of KVM (and Xen previously). As a performance engineer, I desperately want to have a tool that can monitor the host and guests at same time. Think about >100 guests mixed with Linux/Windows running together on single system, being able to know what's happening is critical to do performance analysis. Actually I am the person asked Yanmin to add feature for CPU utilization break down (into host_usr, host_krn, guest_usr, guest_krn) so that I can monitor dozens of running guests. I hasn't made this patch work on my system yet but I _do_ think this patch is a very good start.
And finally, monitoring guests from host is useful for users too (administrator and performance guy like me). I really appreciate you guys' work and would love to provide feedback from my point of view if needed.
Regards,
HUANG, Zhiteng
Intel SSG/SSD/SPA/PRC Scalability Lab
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Avi Kivity
Sent: Wednesday, March 17, 2010 11:55 AM
To: Frank Ch. Eigler
Cc: Anthony Liguori; Ingo Molnar; Zhang, Yanmin; Peter Zijlstra; Sheng Yang; [email protected]; [email protected]; Marcelo Tosatti; oerg Roedel; Jes Sorensen; Gleb Natapov; Zachary Amsden; [email protected]
Subject: Re: [PATCH] Enhance perf to collect KVM guest os statistics from host side
Quoted 10 lines · Frank Ch. Eigler
Hi -
Quoted 6 lines · Anthony Liguori
[...]
The only way to really address this is to change the interaction. Instead of running perf externally to qemu, we should support a perf command in the qemu monitor that can then tie directly to the perf tooling. That gives us the best possible user experience.
Quoted 4 lines
To what extent could this be solved with less crossing of isolation/abstraction layers, if the perfctr facilities were properly virtualized?
That's the more interesting (by far) usage model. In general guest owners don't have access to the host, and host owners can't (and shouldn't) change guests.
Monitoring guests from the host is useful for kvm developers, but less so for users.
Signature · 6 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Frank Ch. Eigler
Hi -
Quoted 5 lines · Anthony Liguori
[...]
The only way to really address this is to change the interaction. Instead of running perf externally to qemu, we should support a perf command in the qemu monitor that can then tie directly to the perf tooling. That gives us the best possible user experience.
Quoted 3 lines
To what extent could this be solved with less crossing of isolation/abstraction layers, if the perfctr facilities were properly virtualized? [...]
Note, 'perfctr' is a different out-of-tree Linux kernel project run by someone
else: it offers the /dev/perfctr special-purpose device that allows raw, unabstracted, low-level access to the PMU.
I suspect the one you wanted to mention here is called 'perf' or 'perf events'. (and used to be called 'performance counters' or 'perfcounters' until it got renamed about a year ago)
Thanks,
Ingo
Quoted 3 lines · Anthony Liguori
If you want to use a synthetic filesystem as the management interface for qemu, that's one thing. But you suggested exposing the guest filesystem in its entirely and that's what I disagreed with.
What did you think, that it would be world-readable? Why would we do such a stupid thing? Any mounted content should at minimum match whatever policy covers the image file. The mounting of contents is not a privilege escallation and it is already possible today - just not integrated properly and not practical. (and apparently not implemented for all the wrong 'security' reasons)
Quoted 2 lines
The guest may encrypt it's disk image. It still ought to be possible to run perf against that guest, no?
_In_ the guest you can of course run it just fine. (once paravirt bits are in place)
That has no connection to 'perf kvm' though, which this patch submission is about ...
If you want unified profiling of both host and guest then you need access to both the guest and the host. This is what the 'perf kvm' patch is about. Please read the patch, i think you might be misunderstanding what it does ...
Regarding encrypted contents - that's really a distraction but the host has absolute, 100% control over the guest and there's nothing the guest can do about that - unless you are thinking about the sub-sub-case of Orwellian DRM-locked-down systems - in which case there's nothing for the host to mount and the guest can reject any requests for information on itself and impose additional policy that way. So it's a security non-issue.
Note that DRM is pretty much the worst place to look at when it comes to
usability: DRM lock-down is the anti-thesis of usability. Do you really want KVM to match the mind-set of the RIAA and MPAA? Why do you pretend that a developer cannot mount his own disk image? Pretty please, help Linux instead, where development is driven by usability and accessibility ...
Thanks,
Ingo
Quoted 18 lines · Ingo Molnar
Quoted 11 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
I mean, i can trust a kernel service and i can trust
/proc/kallsyms.Can perf trust a random process claiming to be Qemu? What's the trust mechanism here?
Obviously you can't trust anything you get from a guest, no matter how you get it.
I'm not talking about the symbol strings and addresses, and the object contents for allocation (or debuginfo). I'm talking about the basic protocol of establishing which guest is which.
Quoted 6 lines
I.e. we really want to be able users to:
1) have it all working with a single guest, without having to specify 'which' guest (qemu PID) to work with. That is the dominant usecase both for developers and for a fair portion of testers.
You're making too many assumptions.
There is no list of guests anymore than there is a list of web browsers.
You can have a multi-tenant scenario where you have distinct groups of virtual machines running as unprivileged users.
Quoted 10 lines
2) Have some reasonable symbolic identification for guests. For example a usable approach would be to have 'perf kvm list', which would list all currently active guests:
$ perf kvm list
[1] Fedora
[2] OpenSuse
[3] Windows-XP
[4] Windows-7
Quoted 4 lines
And from that point on 'perf kvm -g OpenSuse record' would do the obvious thing. Users will be able to just use the 'OpenSuse' symbolic name for that guest, even if the guest got restarted and switched its main PID.
Does "perf kvm list" always run as root? What if two unprivileged users both have a VM named "Fedora"?
If we look at the use-case, it's going to be something like, a user is creating virtual machines and wants to get performance information about them.
Having to run a separate tool like perf is not going to be what they would expect they had to do. Instead, they would either use their existing GUI tool (like virt-manager) or they would use their management interface (either QMP or libvirt).
The complexity of interaction is due to the fact that perf shouldn't be a stand alone tool. It should be a library or something with a programmatic interface that another tool can make use of.
Regards,
Anthony Liguori
Quoted 10 lines
Is such a scheme possible/available? I suspect all the KVM configuration tools (i havent used them in some time - gui and command-line tools alike) use similar methods to ease guest management?
Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 20 lines · Anthony Liguori
Quoted 13 lines · Ingo Molnar
Quoted 7 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
I mean, i can trust a kernel service and i can trust
/proc/kallsyms.Can perf trust a random process claiming to be Qemu? What's the trust mechanism here?
Obviously you can't trust anything you get from a guest, no matter how you get it.
I'm not talking about the symbol strings and addresses, and the object contents for allocation (or debuginfo). I'm talking about the basic protocol of establishing which guest is which.
Quoted 5 lines
I.e. we really want to be able users to:
1) have it all working with a single guest, without having to specify 'which' guest (qemu PID) to work with. That is the dominant usecase both for developers and for a fair portion of testers.
Quoted 6 lines
You're making too many assumptions.
There is no list of guests anymore than there is a list of web browsers.
You can have a multi-tenant scenario where you have distinct groups of virtual machines running as unprivileged users.
"multi-tenant" and groups is not a valid excuse at all for giving crappy technology in the simplest case: when there's a single VM. Yes, eventually it can be supported and any sane scheme will naturally support it too, but it's by no means what we care about primarily when it comes to these tools.
I thought everyone learned the lesson behind SystemTap's failure (and to a certain degree this was behind Oprofile's failure as well): when it comes to tooling/instrumentation we dont want to concentrate on the fancy complex setups and abstract requirements drawn up by CIOs, as development isnt being done there. Concentrate on our developers today, and provide no-compromises usability to those who contribute stuff.
If we dont help make the simplest (and most common) use-case convenient then we are failing on a fundamental level.
Quoted 10 lines
Quoted 10 lines
2) Have some reasonable symbolic identification for guests. For example a usable approach would be to have 'perf kvm list', which would list all currently active guests:
$ perf kvm list
[1] Fedora
[2] OpenSuse
[3] Windows-XP
[4] Windows-7
Quoted 6 lines
Quoted 3 lines
And from that point on 'perf kvm -g OpenSuse record' would do the obvious thing. Users will be able to just use the 'OpenSuse' symbolic name for that guest, even if the guest got restarted and switched its main PID.
Does "perf kvm list" always run as root? What if two unprivileged users both have a VM named "Fedora"?
Again, the single-VM case is the most important case, by far. If you have multiple VMs running and want to develop the kernel on multiple VMs (sounds rather messy if you think it through ...), what would happen is similar to what happens when we have two probes for example:
# perf probe schedule Added new event: probe:schedule (on schedule+0)
You can now use it on all perf tools, such as:
perf record -e probe:schedule -a sleep 1
# perf probe -f schedule Added new event: probe:schedule_1 (on schedule+0)
You can now use it on all perf tools, such as:
perf record -e probe:schedule_1 -a sleep 1
# perf probe -f schedule Added new event: probe:schedule_2 (on schedule+0)
You can now use it on all perf tools, such as:
perf record -e probe:schedule_2 -a sleep 1
Something similar could be used for KVM/Qemu: whichever got created first is named 'Fedora', the second is named 'Fedora-2'.
Quoted 4 lines
If we look at the use-case, it's going to be something like, a user is creating virtual machines and wants to get performance information about them.
Quoted 8 lines
Having to run a separate tool like perf is not going to be what they would expect they had to do. Instead, they would either use their existing GUI tool (like virt-manager) or they would use their management interface (either QMP or libvirt).
The complexity of interaction is due to the fact that perf shouldn't be a stand alone tool. It should be a library or something with a programmatic interface that another tool can make use of.
But ... a GUI interface/integration is of course possible too, and it's being worked on.
perf is mainly a kernel developer tool, and kernel developers generally dont use GUIs to do their stuff: which is the (sole) reason why its first ~850 commits of tools/perf/ were done without a GUI. We go where our developers are.
In any case it's not an excuse to have no proper command-line tooling. In fact if you cannot get simpler, more atomic command-line tooling right then you'll probably doubly suck at doing a GUI as well.
Ingo
Quoted 16 lines · Ingo Molnar
Quoted 4 lines
If we look at the use-case, it's going to be something like, a user is creating virtual machines and wants to get performance information about them.
Quoted 9 lines
Having to run a separate tool like perf is not going to be what they would expect they had to do. Instead, they would either use their existing GUI tool (like virt-manager) or they would use their management interface (either QMP or libvirt).
The complexity of interaction is due to the fact that perf shouldn't be a stand alone tool. It should be a library or something with a programmatic interface that another tool can make use of.
But ... a GUI interface/integration is of course possible too, and it's being worked on.
Quoted 9 lines
perf is mainly a kernel developer tool, and kernel developers generally dont use GUIs to do their stuff: which is the (sole) reason why its first ~850 commits of
tools/perf/were done without a GUI. We go where our developers are.In any case it's not an excuse to have no proper command-line tooling. In fact if you cannot get simpler, more atomic command-line tooling right then you'll probably doubly suck at doing a GUI as well.
It's about who owns the user interface.
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Regards,
Anthony Liguori
Quoted 2 lines
Ingo
[RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 25 lines · Anthony Liguori
Quoted 15 lines · Ingo Molnar
Quoted 4 lines
If we look at the use-case, it's going to be something like, a user is creating virtual machines and wants to get performance information about them.
Quoted 8 lines
Having to run a separate tool like perf is not going to be what they would expect they had to do. Instead, they would either use their existing GUI tool (like virt-manager) or they would use their management interface (either QMP or libvirt).
The complexity of interaction is due to the fact that perf shouldn't be a stand alone tool. It should be a library or something with a programmatic interface that another tool can make use of.
But ... a GUI interface/integration is of course possible too, and it's being worked on.
Quoted 8 lines
perf is mainly a kernel developer tool, and kernel developers generally dont use GUIs to do their stuff: which is the (sole) reason why its first ~850 commits of
tools/perf/were done without a GUI. We go where our developers are.In any case it's not an excuse to have no proper command-line tooling. In fact if you cannot get simpler, more atomic command-line tooling right then you'll probably doubly suck at doing a GUI as well.
Quoted 5 lines
It's about who owns the user interface.
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Of course illogical modularization complicates things 'significantly'.
I wish both you and Avi looked back 3-4 years and realized what made KVM so successful back then and why the hearts and minds of virtualization developers were captured by KVM almost overnight.
KVM's main strength back then was that it was a surprisingly functional piece of code offered by a 10 KLOC patch - right on the very latest upstream kernel. Code was shared with upstream, there was version parity, and it all was in the same single repo which was (and is) a pleasure to develop on.
Unlike Xen, which was a 200+ KLOC patch on top of a forked 10 MLOC kernel a few upstream versions back. Xen had constant version friction due to that fork and due to that forced/false separation/modularization: Xen _itself_ was a fork of Linux to begin with. (for exampe Xen still had my copyrights last i checked, which it got from old Linux code i worked on)
That forced separation and version friction in Xen was a development and productization nightmare, and developing on KVM was a truly refreshing experience. (I'll go out on a limb to declare that you wont find a _single_ developer on this list who will tells us otherwise.)
Fast forward to 2010. The kernel side of KVM is maximum goodness - by far the worst-quality remaining aspects of KVM are precisely in areas that you
mention: 'if we have to support third party tools, then it significantly complicates things'. You kept Qemu as an external 'third party' entity to KVM, and KVM is clearly hurting from that - just see the recent KVM usability thread for examples about suckage.
So a similar 'complication' is the crux of the matter behind KVM quality
problems: you've not followed through with the original KVM vision and you have not applied that concept to Qemu!
And please realize that the user does not care that KVM's kernel bits are top notch, if the rest of the package has sucky aspects: it's always the weakest link of the chain that matters to the user.
Xen sucked because of such design shortsightedness on the kernel level, and now KVM suffers from it on the user space level.
If you want to jump to the next level of technological quality you need to fix this attitude and you need to go back to the design roots of KVM. Concentrate on Qemu (as that is the weakest link now), make it a first class member of the KVM repo and simplify your development model by having a single repo:
- move a clean (and minimal) version of the Qemu code base to tools/kvm/, in the upstream kernel repo, and work on that from that point on.
- co-develop new features within the same patch. Release new versions of kvm-qemu and the kvm bits at the same time (together with the upstream kernel), at well defined points in time.
- encourage kernel-space and user-space KVM developers to work on both user-space and kernel-space bits as a single unit. It's one project and a single experience to the user.
- [ and probably libvirt should go there too ]
If KVM's hypervisor and guest kernel code can enjoy the benefits of a single repository, why cannot the rest of KVM enjoy the same developer goodness? Only fixing that will bring the break-through in quality - not more manpower really.
Yes, i've read a thousand excuses for why this is an absolutely impossible and a bad thing to do, and none of them was really convincing to me - and you also have become rather emotional about all the arguments so it's hard to argue about it on a technical basis.
We made a similar (admittedly very difficult ...) design jump from oprofile to perf, and i can tell you from that experience that it's day and night, both in terms of development and in terms of the end result!
( We recently also made another, kernel/kernel unification that had a very
positive result: we unified the 32-bit and 64-bit x86 architectures. Even within the same repo the unification of technology is generally a good thing. The KVM/Qemu situation is different - it's more similar to the perf design. )
Not having to fight artificial package boundaries and forced package separation is very refreshing experience to a developer - and very rewarding and flexible to develop on. ABI compatibility is _easier_ to maintain in such a model. It's quite similar to the jump from Xen hacking to KVM hacking (i did both). It's a bit like the jump from CVS to Git. Trust me, you _cannot_ know the difference if you havent tried a similar jump with Qemu.
Anyway, you made your position about this rather clear and you are clearly uncompromising, so i just wanted to post this note to the list: you'll waste years of your life on a visibly crappy development model that has been unable to break through a magic usability barrier for the past 2-3 years - just like the Xen mis-design has wasted so many people's time and effort in kernel space.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Ingo Molnar
Quoted 7 lines
It's about who owns the user interface.
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Of course illogical modularization complicates things 'significantly'.
Who should own the user interface then?
Quoted 7 lines
Fast forward to 2010. The kernel side of KVM is maximum goodness - by far the worst-quality remaining aspects of KVM are precisely in areas that you
mention: 'if we have to support third party tools, then it significantly complicates things'. You kept Qemu as an external 'third party' entity to KVM, and KVM is clearly hurting from that - just see the recent KVM usability thread for examples about suckage.
Any qemu usability problems are because developers (or their employers) are not interested in fixing them, not because of the repository location. Most kvm developer interest is in server-side deployment (even for desktop guests), so there is limited effort in implementing a virtualbox-style GUI.
Quoted 3 lines
- move a clean (and minimal) version of the Qemu code base to
tools/kvm/, in the upstream kernel repo, and work on that from that point on.
I'll ignore the repository location which should be immaterial to a serious developer and concentrate on the 'clean and minimal' aspect, since it has some merit. Qemu development does have a tension between the needs of kvm and tcg. For kvm we need fine-grained threading to improve performance and tons of RAS work. For tcg these are mostly meaningless, and the tcg code has sufficient inertia to reduce the rate at which we can develop.
Nevertheless, the majority of developers feel that we'll lose more by a fork (the community) than we gain by it (reduced constraints).
Quoted 4 lines
- co-develop new features within the same patch. Release new versions of kvm-qemu and the kvm bits at the same time (together with the upstream kernel), at well defined points in time.
The majority of patches to qemu don't require changes to kvm, and vice versa. The interface between qemu and kvm is fairly narrow, and most of the changes are related to save/restore and guest debugging, hardly areas of great interest to the causal user.
Quoted 4 lines
- encourage kernel-space and user-space KVM developers to work on both user-space and kernel-space bits as a single unit. It's one project and a single experience to the user.
When a feature is developed that requires both kernel and qemu changes, the same developer makes the changes in both projects. Having them in different repositories does not appear to be a problem.
Quoted 2 lines
- [ and probably libvirt should go there too ]
Let's make a list of projects who don't need to be in the kernel repository, it will probably be shorted.
Seriously, libvirt is a cross-platform cross-hypervisor library, it has no business near the Linux kernel.
Quoted 2 lines
If KVM's hypervisor and guest kernel code can enjoy the benefits of a single repository,
In fact I try hard not to rely too much on that. While both kvm guest and host code are in the same repo, there is an ABI barrier between them because we need to support any guest version on any host version. When designing, writing, or reading guest or host code that interacts across that barrier we need to keep forward and backward compatibility in mind. It's very different from normal kernel APIs that we can adapt whenever the need arises.
Quoted 4 lines
why cannot the rest of KVM enjoy the same developer goodness? Only fixing that will bring the break-through in quality - not more manpower really.
I really don't understand why you believe that. You seem to want a virtualbox-style GUI, and lkml is probably the last place in the world to develop something like that. The developers here are mostly uninterested in GUI and usability problems, remember these are people who thing emacs xor vi is a great editor.
Quoted 9 lines
Yes, i've read a thousand excuses for why this is an absolutely impossible and a bad thing to do, and none of them was really convincing to me - and you also have become rather emotional about all the arguments so it's hard to argue about it on a technical basis.
We made a similar (admittedly very difficult ...) design jump from oprofile to perf, and i can tell you from that experience that it's day and night, both in terms of development and in terms of the end result!
Maybe it was due to better design and implementation choices.
Quoted 6 lines
( We recently also made another, kernel/kernel unification that had a very
positive result: we unified the 32-bit and 64-bit x86 architectures. Even within the same repo the unification of technology is generally a good thing. The KVM/Qemu situation is different - it's more similar to the perf design. )
Quoted 7 lines
Not having to fight artificial package boundaries and forced package separation is very refreshing experience to a developer - and very rewarding and flexible to develop on. ABI compatibility is _easier_ to maintain in such a model. It's quite similar to the jump from Xen hacking to KVM hacking (i did both). It's a bit like the jump from CVS to Git. Trust me, you _cannot_ know the difference if you havent tried a similar jump with Qemu.
Why is ABI compatibility easier to maintain in a single repo?
Quoted 7 lines
Anyway, you made your position about this rather clear and you are clearly uncompromising, so i just wanted to post this note to the list: you'll waste years of your life on a visibly crappy development model that has been unable to break through a magic usability barrier for the past 2-3 years - just like the Xen mis-design has wasted so many people's time and effort in kernel space.
Do you really think the echo'n'cat school of usability wants to write a GUI? In linux-2.6.git?
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Avi Kivity
Quoted 8 lines · Ingo Molnar
Quoted 6 lines
It's about who owns the user interface.
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Of course illogical modularization complicates things 'significantly'.
Who should own the user interface then?
If qemu was in tools/kvm/ then we wouldnt have such issues. A single patch (or series of patches) could modify tools/kvm/, arch/x86/kvm/, virt/ and tools/perf/.
Numerous times did we have patches to kernel/perf_event.c that fixed some detail, also accompanied by a tools/perf/ patch fixing another detail. Having a single 'culture of contribution' is a powerful way to develop.
It turns out kernel developers can be pretty good user-space developers as well and user-space developers can be pretty good kernel developers as well. Some like to do both - as long as it's all within a single project.
The moment any change (be it as trivial as fixing a GUI detail or as complex as a new feature) involves two or more packages, development speed slows down to a crawl - while the complexity of the change might be very low!
Also, there's the harmful process that people start categorizing themselves into 'I am a kernel developer' and 'I am a user space programmer' stereotypes, which limits the scope of contributions artificially.
Quoted 11 lines
Quoted 6 lines
Fast forward to 2010. The kernel side of KVM is maximum goodness - by far the worst-quality remaining aspects of KVM are precisely in areas that you
mention: 'if we have to support third party tools, then it significantly complicates things'. You kept Qemu as an external 'third party' entity to KVM, and KVM is clearly hurting from that - just see the recent KVM usability thread for examples about suckage.Any qemu usability problems are because developers (or their employers) are not interested in fixing them, not because of the repository location. Most kvm developer interest is in server-side deployment (even for desktop guests), so there is limited effort in implementing a virtualbox-style GUI.
The same has been said of oprofile as well: 'it somewhat sucks because we are too server centric', 'nobody is interested in good usability and oprofile is fine for the enterprises'. Ironically, the same has been said of Xen usability as well, up to the point KVM came around.
What was the core of the problem was a bad design and a split kernel-side user-side tool landscape.
In fact i think saying that 'our developers only care about the server' is borderline dishonest, when at the same time you are making it doubly sure (by inaction) that it stays so: by leaving an artificial package wall between kernel-side KVM and user-side KVM and not integrating the two technologies.
You'll never know what heights you could achieve if you leave that wall there
...
Furthermore, what should be realized is that bad usability hurts "server features" just as much. Most of the day-to-day testing is done on the desktop by desktop oriented testers/developers. _Not_ by enterprise shops - they tend to see the code years down the line to begin with ...
Yes, a particular feature might be server oriented, but a good portion of our testing is on the desktop and everyone is hurting from bad usability and this puts limits on contribution efficiency.
As the patch posted in _this very thread demonstrates it_, it is doubly more difficult to contribute a joint KVM+Qemu feature, because it's two separate code bases, two contribution guidelines, two release schedules. While to the user it really is just one and the same thing. It should be so for the developer as well.
Put in another way: KVM's current split design is making it easy to contribute server features (because the kernel side is clean and cool), but also makes it artificially hard to contribute desktop features: because the tooling side (Qemu) is 'just another package', is separated by a package and maintenance wall and is made somewhat uncool by a (as some KVM developers have pointed out in this thread) quirky codebase.
(the rest of your points are really a function of this fundamental disagreement)
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 7 lines · Ingo Molnar
Quoted 6 lines
It's about who owns the user interface.
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Of course illogical modularization complicates things 'significantly'.
Who should own the user interface then?
If qemu was in
tools/kvm/then we wouldnt have such issues. A single patch (or series of patches) could modifytools/kvm/,arch/x86/kvm/,virt/andtools/perf/.
It's not a 1:1 connection. There are more users of the KVM interface. To name a few I'm aware of:
- Mac-on-Linux (PPC)
- Dolphin (PPC)
- Xenner (x86)
- Kuli (s390)
Having a clear userspace interface is the only viable solution there. And if you're interested, look at my MOL enabling patch. It's less than 500 lines of code.
The kernel/userspace interface really isn't the difficult part. Getting device emulation working properly, easily and fast is.
Alex
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 22 lines · Alexander Graf
Quoted 11 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 7 lines · Ingo Molnar
Quoted 6 lines
It's about who owns the user interface.
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Of course illogical modularization complicates things 'significantly'.
Who should own the user interface then?
If qemu was in
tools/kvm/then we wouldnt have such issues. A single patch (or series of patches) could modifytools/kvm/,arch/x86/kvm/,virt/andtools/perf/.
Quoted 7 lines
It's not a 1:1 connection. There are more users of the KVM interface. To name a few I'm aware of:
- Mac-on-Linux (PPC)
- Dolphin (PPC)
- Xenner (x86)
- Kuli (s390)
There must be a misunderstanding here: tools/perf/ still has a clear userspace interface and ABI. There's external projects making use of it: sysprof and libpfm (and probably more i dont know about it). Those projects are also contributing back.
Still it's _very_ useful to have a single reference implementation under tools/perf/ where we concentrate the best of the code. That is where we make sure that each new kernel feature is appropriately implemented in user-space as well, that the combination works well together and is releasable to users. That is what keeps us all honest: the latency of features is much lower, and there's no ping-pong of blame going on between the two components in case of bugs or in case of misfeatures.
Same goes for KVM+Qemu: it would be so much nicer to have a single, well-focused reference implementation under tools/kvm/ and have improvements flow into that code base.
That way KVM developers cannot just shrug "well, GUI suckage is a user-space problem" - like the answers i got in the KVM usability thread ...
The buck will stop here.
And if someone thinks he can do better an external project can be started anytime. (it may even replace the upstream thing if it's better)
Quoted 3 lines
Having a clear userspace interface is the only viable solution there. And if you're interested, look at my MOL enabling patch. It's less than 500 lines of code.
Why do you suppose that what i propose is an "either or" scenario?
It isnt. I just suggested that instead of letting core KVM fragment its limbs into an external entity, put your name behind one good all-around solution and focus the development model into a single project.
I.e. do what KVM has done originally in the kernel space to begin with - and where it was so much better than Xen: single focus.
Learn from what KVM has done so well in the initial years and use the concept on the user-space components as well. The very same arguments that caused KVM to integrate into the upstream kernel (instead of being a separate project) are a valid basis to integrate the user-space components into tools/kvm/. Dont forget your roots and dont assume all your design decisions were correct.
Quoted 2 lines
The kernel/userspace interface really isn't the difficult part. Getting device emulation working properly, easily and fast is.
The kernel/userspace ABI is not difficult at all. Getting device emulation working properly, easily and fast indeed is. And my experience is that it is not working properly nor quickly at the moment, at all. (see the 'KVM usability' thread)
Getting device emulation working properly often involves putting certain pieces that are currently done in Qemu into kernel-space. That kind of 'movement of emulation technology' from user-space component into the kernel-space component [or back] would very clearly be helped if those two components were in the same repository.
And i have first-hand experience there: we had (and have) similar scenarios with tools/perf routinely. We did some aspects in user-space, then decided to do it in kernel-space. Sometimes we moved kernel bits to user-space. It was very easy and there were no package and version complications as it's a single project. Sometimes we even moved bits back and forth until we found the right balance.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Ingo Molnar
Quoted 9 lines
It's not a 1:1 connection. There are more users of the KVM interface. To name a few I'm aware of:
- Mac-on-Linux (PPC)
- Dolphin (PPC)
- Xenner (x86)
- Kuli (s390)
Quoted 5 lines
There must be a misunderstanding here:
tools/perf/still has a clear userspace interface and ABI. There's external projects making use of it: sysprof and libpfm (and probably more i dont know about it). Those projects are also contributing back.
So it seems it is possible to scale the package wall.
Quoted 8 lines
Still it's _very_ useful to have a single reference implementation under
tools/perf/where we concentrate the best of the code. That is where we make sure that each new kernel feature is appropriately implemented in user-space as well, that the combination works well together and is releasable to users. That is what keeps us all honest: the latency of features is much lower, and there's no ping-pong of blame going on between the two components in case of bugs or in case of misfeatures.
That would make sense for a truly minimal userspace for kvm: we once had a tool called kvmctl which was used to run tests (since folded into qemu). It didn't contain a GUI and was unable to run a general purpose guest. It was a few hundred lines of code, and indeed patches to kvmctl had a much closer correspondence to patches with kvm (though still low, as most kvm patches don't modify the ABI).
Quoted 9 lines
Same goes for KVM+Qemu: it would be so much nicer to have a single, well-focused reference implementation under
tools/kvm/and have improvements flow into that code base.That way KVM developers cannot just shrug "well, GUI suckage is a user-space problem" - like the answers i got in the KVM usability thread ...
The buck will stop here.
Suppose we copy qemu tomorrow into tools/. All the problems will be copied with it. Someone still has to write patches to fix them. Who will it be?
Quoted 8 lines
Quoted 3 lines
The kernel/userspace interface really isn't the difficult part. Getting device emulation working properly, easily and fast is.
The kernel/userspace ABI is not difficult at all. Getting device emulation working properly, easily and fast indeed is. And my experience is that it is not working properly nor quickly at the moment, at all. (see the 'KVM usability' thread)
Quoted 6 lines
Getting device emulation working properly often involves putting certain pieces that are currently done in Qemu into kernel-space. That kind of 'movement of emulation technology' from user-space component into the kernel-space component [or back] would very clearly be helped if those two components were in the same repository.
Moving emulation into the kernel is indeed a problem. Not because it's difficult, but because it indicates that the interfaces exposed to userspace are insufficient to obtain good performance. We had that with vhost-net and I'm afraid we'll have that with vhost-blk.
Quoted 7 lines
And i have first-hand experience there: we had (and have) similar scenarios with
tools/perfroutinely. We did some aspects in user-space, then decided to do it in kernel-space. Sometimes we moved kernel bits to user-space. It was very easy and there were no package and version complications as it's a single project. Sometimes we even moved bits back and forth until we found the right balance.
That's reasonable in the first iterations of a project.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Avi Kivity
Quoted 7 lines
Still it's _very_ useful to have a single reference implementation under
tools/perf/where we concentrate the best of the code. That is where we make sure that each new kernel feature is appropriately implemented in user-space as well, that the combination works well together and is releasable to users. That is what keeps us all honest: the latency of features is much lower, and there's no ping-pong of blame going on between the two components in case of bugs or in case of misfeatures.
Quoted 6 lines
That would make sense for a truly minimal userspace for kvm: we once had a tool called kvmctl which was used to run tests (since folded into qemu). It didn't contain a GUI and was unable to run a general purpose guest. It was a few hundred lines of code, and indeed patches to kvmctl had a much closer correspondence to patches with kvm (though still low, as most kvm patches don't modify the ABI).
If it's functional to the extent of at least allowing say a serial console via the console (like the UML binary allows) i'd expect the minimal user-space to quickly grow out of this minimal state. The rest will be history.
Maybe this is a better, simpler (and much cleaner and less controversial) approach than moving a 'full' copy of qemu there.
There's certainly no risk: if qemu stays dominant then nothing is lost [tools/kvm/ can be removed after some time], and if this clean base works out fine then the useful qemu technologies will move over to it gradually and without much fuss, and the developers will move with it as well.
If it's just a token effort with near zero utility to begin with it certainly wont take off.
Once it's there in tools/kvm/ and bootable i'd certainly hack up some quick xlib based VGA output capability myself - it's not that hard ;-) It would also allow me to test whether latest-KVM still boots fine in a much simpler way. (most of my testboxes dont have qemu installed)
So you have one user signed up for that already ;-)
Quoted 4 lines
Quoted 4 lines
Same goes for KVM+Qemu: it would be so much nicer to have a single, well-focused reference implementation under
tools/kvm/and have improvements flow into that code base.
Quoted 8 lines
Quoted 5 lines
That way KVM developers cannot just shrug "well, GUI suckage is a user-space problem" - like the answers i got in the KVM usability thread
...The buck will stop here.
Suppose we copy qemu tomorrow into
tools/. All the problems will be copied with it. Someone still has to write patches to fix them. Who will it be?
What we saw with tools/perf/ was that pure proximity to actual kernel testers and kernel developers produces a steady influx of new developers. It didnt happen overnight, but it happened. A simple:
cd tools/perf/
make -j install
Gets them something to play with. That kind of proximity is very powerful.
The other benefit was that distros can package perf with the kernel package, so it's updated together with the kernel. This means a very efficient distribution of new technologies, together with new kernel releases.
Distributions are very eager to update kernels even in stable periods of the distro lifetime - they are much less willing to update user-space packages.
You can literally get full KVM+userspace features done _and deployed to users_ within the 3 months development cycle of upstream KVM.
All these create synergies that are very clear once you see the process in motion. It's a powerful positive feedback loop. Give it some thought please.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 34 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 8 lines
Still it's _very_ useful to have a single reference implementation under
tools/perf/where we concentrate the best of the code. That is where we make sure that each new kernel feature is appropriately implemented in user-space as well, that the combination works well together and is releasable to users. That is what keeps us all honest: the latency of features is much lower, and there's no ping-pong of blame going on between the two components in case of bugs or in case of misfeatures.Quoted 7 lines
That would make sense for a truly minimal userspace for kvm: we once had a tool called kvmctl which was used to run tests (since folded into qemu). It didn't contain a GUI and was unable to run a general purpose guest. It was a few hundred lines of code, and indeed patches to kvmctl had a much closer correspondence to patches with kvm (though still low, as most kvm patches don't modify the ABI).
If it's functional to the extent of at least allowing say a serial console via the console (like the UML binary allows) i'd expect the minimal user-space to quickly grow out of this minimal state. The rest will be history.
Maybe this is a better, simpler (and much cleaner and less controversial) approach than moving a 'full' copy of qemu there.
There's certainly no risk: if qemu stays dominant then nothing is lost [
tools/kvm/can be removed after some time], and if this clean base works out fine then the useful qemu technologies will move over to it gradually and without much fuss, and the developers will move with it as well.If it's just a token effort with near zero utility to begin with it certainly wont take off.
Quoted 7 lines
Once it's there in
tools/kvm/and bootable i'd certainly hack up some quick xlib based VGA output capability myself - it's not that hard ;-) It would also allow me to test whether latest-KVM still boots fine in a much simpler way. (most of my testboxes dont have qemu installed)So you have one user signed up for that already ;-)
Alright, you just volunteered. Just give it a go and try to implement the "oh so simple" KVM frontend while maintaining compatibility with at least a few older Linux guests. My guess is that you'll realize it's a dead end before committing anything to the kernel source tree. But really, just try it out.
Good Luck
Alex
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 4 lines · Ingo Molnar
[...]
Distributions are very eager to update kernels even in stable periods of the distro lifetime - they are much less willing to update user-space packages. [...]
Sorry, er, what? What distributions eagerly upgrade kernels in stable periods, were it not primarily motivated by security fixes? What users eagerly replace their kernels?
- FChE
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Frank Ch. Eigler
Quoted 4 lines · Ingo Molnar
[...]
Distributions are very eager to update kernels even in stable periods of the distro lifetime - they are much less willing to update user-space packages. [...]Sorry, er, what? What distributions eagerly upgrade kernels in stable periods, were it not primarily motivated by security fixes? What users eagerly replace their kernels?
Us guys reading and participating on the list. ;)
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · John Kacur
Quoted 7 lines · Frank Ch. Eigler
Quoted 4 lines · Ingo Molnar
[...]
Distributions are very eager to update kernels even in stable periods of the distro lifetime - they are much less willing to update user-space packages. [...]
Quoted 6 lines
Quoted 4 lines
Sorry, er, what? ?What distributions eagerly upgrade kernels in stable periods, were it not primarily motivated by security fixes? ?What users eagerly replace their kernels?
Us guys reading and participating on the list. ;)
I'd like to second that - i'm actually quite happy to update the distro kernel. Also, i have rarely any problems even with bleeding edge kernels in rawhide - they are working pretty smoothly.
A large xorg update showing up in yum update gives me the cringe though ;-)
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Hi -
Quoted 10 lines · Ingo Molnar
[...]
Quoted 1 line
Us guys reading and participating on the list. ;)
I'd like to second that - i'm actually quite happy to update the distro kernel. Also, i have rarely any problems even with bleeding edge kernels in rawhide - they are working pretty smoothly.
A large xorg update showing up in yum update gives me the cringe though ;-)
From a parochial point of view, that makes perfect sense: someone
else's large software changes are a source of concern. The same thing applies to non-LKML people -- ordinary users -- when *your* large software changes are proposed.
Perhaps this change in perspective would help you see the absurdity of proposing kernel-2.6.git as a hosting repository for all kinds of stuff, on the theory that kernel updates get pushed to "eager" users more frequently than other kinds of updates. (Never mind that data shows otherwise.)
- FChE
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Frank Ch. EiglerQuoted 9 lines · Frank Ch. Eigler
Quoted 4 lines · Ingo Molnar
[...]
Distributions are very eager to update kernels even in stable periods of the distro lifetime - they are much less willing to update user-space packages. [...]Sorry, er, what? What distributions eagerly upgrade kernels in stable periods, were it not primarily motivated by security fixes? [...]
Please check the popular distro called 'Fedora' for example, and its kernel upgrade policies.
Quoted 1 line
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Ingo Molnar
Quoted 3 lines
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Quoted 2 lines
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
I think you didnt understand my (tersely explained) point - which is probably my fault. What i said is:
- distros update the kernel first. Often in stable releases as well if there's a new kernel released. (They must because it provides new hardware enablement and other critical changes they generally cannot skip.)
- Qemu on the other hand is not upgraded with (nearly) that level of urgency. Completely new versions will generally have to wait for the next distro release.
With in-kernel tools the kernel and the tooling that accompanies the kernel are upgraded in the same low-latency pathway. That is a big plus if you are offering things like instrumentation (which perf does), which relates closely to the kernel.
Furthermore, many distros package up the latest -git kernel as well. They almost never do that with user-space packages.
Let me give you a specific example:
I'm running Fedora Rawhide with 2.6.34-rc1 right now on my main desktop, and that comes with perf-2.6.34-0.10.rc1.git0.fc14.noarch.
My rawhide box has qemu-kvm-0.12.3-3.fc14.x86_64 installed. That's more than a 1000 Qemu commits older than the latest Qemu development branch.
So by being part of the kernel repo there's lower latency upgrades and earlier and better testing available on most distros.
You made it very clear that you dont want that, but please dont try to claim that those advantages do not exist - they are very much real and we are making good use of it.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 16 lines · Ingo Molnar
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Quoted 2 lines
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
I think you didnt understand my (tersely explained) point - which is probably my fault. What i said is:
Quoted 7 lines
- distros update the kernel first. Often in stable releases as well if there's a new kernel released. (They must because it provides new hardware enablement and other critical changes they generally cannot skip.)
- Qemu on the other hand is not upgraded with (nearly) that level of urgency. Completely new versions will generally have to wait for the next distro release.
This has nothing todo with them being in separate source repos. We could update QEMU to new major feature releaes with the same frequency in a Fedora release, but we delibrately choose not to rebase the QEMU userspace because experiance has shown the downside from new bugs / regressions outweighs the benefit of any new features.
The QEMU updates in stable Fedora trees, now just follow the minor bugfix release stream provided by QEMU & those arrive in Fedora with little noticable delay.
Daniel
Signature · 4 lines
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 31 lines · Daniel P. Berrange
Quoted 16 lines · Ingo Molnar
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Quoted 2 lines
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
I think you didnt understand my (tersely explained) point - which is probably my fault. What i said is:
Quoted 7 lines
- distros update the kernel first. Often in stable releases as well if there's a new kernel released. (They must because it provides new hardware enablement and other critical changes they generally cannot skip.)
- Qemu on the other hand is not upgraded with (nearly) that level of urgency. Completely new versions will generally have to wait for the next distro release.
This has nothing todo with them being in separate source repos. We could update QEMU to new major feature releaes with the same frequency in a Fedora release, but we delibrately choose not to rebase the QEMU userspace because experiance has shown the downside from new bugs / regressions outweighs the benefit of any new features.
Quoted 3 lines
The QEMU updates in stable Fedora trees, now just follow the minor bugfix release stream provided by QEMU & those arrive in Fedora with little noticable delay.
That is exactly what i said: Qemu and most user-space packages are on a 'slower' update track than the kernel: generally updated for minor releases.
My further point was that the kernel on the other hand gets updated more frequently and as such, any user-space tool bits hosted in the kernel repo get updated more frequently as well.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 41 lines · Ingo Molnar
Quoted 31 lines · Daniel P. Berrange
Quoted 16 lines · Ingo Molnar
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Quoted 2 lines
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
I think you didnt understand my (tersely explained) point - which is probably my fault. What i said is:
Quoted 7 lines
- distros update the kernel first. Often in stable releases as well if there's a new kernel released. (They must because it provides new hardware enablement and other critical changes they generally cannot skip.)
- Qemu on the other hand is not upgraded with (nearly) that level of urgency. Completely new versions will generally have to wait for the next distro release.
This has nothing todo with them being in separate source repos. We could update QEMU to new major feature releaes with the same frequency in a Fedora release, but we delibrately choose not to rebase the QEMU userspace because experiance has shown the downside from new bugs / regressions outweighs the benefit of any new features.
Quoted 3 lines
The QEMU updates in stable Fedora trees, now just follow the minor bugfix release stream provided by QEMU & those arrive in Fedora with little noticable delay.
That is exactly what i said: Qemu and most user-space packages are on a 'slower' update track than the kernel: generally updated for minor releases.
Quoted 7 lines
My further point was that the kernel on the other hand gets updated more frequently and as such, any user-space tool bits hosted in the kernel repo get updated more frequently as well.
Thanks,
Ingo
Just to play devil's advocate, let's not mix up the development model with the distribution model. There is nothing to stop packagers and distributors from providing separate kernel "proper" packages and perf tools packages.
It might even make good sense assuming backwards compatibility for distros that have conservative policies about new kernel versions to provide newer perf tools packages with older kernels.
John
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 50 lines · John Kacur
Quoted 41 lines · Ingo Molnar
Quoted 31 lines · Daniel P. Berrange
Quoted 16 lines · Ingo Molnar
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Quoted 2 lines
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
I think you didnt understand my (tersely explained) point - which is probably my fault. What i said is:
Quoted 7 lines
?- distros update the kernel first. Often in stable releases as well if ? ?there's a new kernel released. (They must because it provides new hardware ? ?enablement and other critical changes they generally cannot skip.)
?- Qemu on the other hand is not upgraded with (nearly) that level of urgency. ? ?Completely new versions will generally have to wait for the next distro ? ?release.
This has nothing todo with them being in separate source repos. We could update QEMU to new major feature releaes with the same frequency in a Fedora release, but we delibrately choose not to rebase the QEMU userspace because experiance has shown the downside from new bugs / regressions outweighs the benefit of any new features.
Quoted 3 lines
The QEMU updates in stable Fedora trees, now just follow the minor bugfix release stream provided by QEMU & those arrive in Fedora with little noticable delay.
That is exactly what i said: Qemu and most user-space packages are on a 'slower' update track than the kernel: generally updated for minor releases.
Quoted 7 lines
My further point was that the kernel on the other hand gets updated more frequently and as such, any user-space tool bits hosted in the kernel repo get updated more frequently as well.
Thanks,
? ? ? ?Ingo
Quoted 7 lines
Just to play devil's advocate, let's not mix up the development model with the distribution model. There is nothing to stop packagers and distributors from providing separate kernel "proper" packages and perf tools packages.
It might even make good sense assuming backwards compatibility for distros that have conservative policies about new kernel versions to provide newer perf tools packages with older kernels.
Of course. Some distros are also very conservative about updating the kernel at all.
I'm mostly talking about the distros that are at the frontier of kernel
development: those with fresh packages, those which provide eager bleeding-edge testers and developers.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 14 lines · Ingo Molnar
Quoted 11 lines · Avi Kivity
Quoted 6 lines · Ingo Molnar
Quoted 3 lines
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
Quoted 7 lines
I think you didnt understand my (tersely explained) point - which is probably my fault. What i said is:
- distros update the kernel first. Often in stable releases as well if there's a new kernel released. (They must because it provides new hardware enablement and other critical changes they generally cannot skip.)
No, they don't. RHEL 5 is still on 2.6.18, for example. Users don't like their kernels updated unless absolutely necessary, with good reason.
Kernel updates = reboots.
Quoted 4 lines
- Qemu on the other hand is not upgraded with (nearly) that level of urgency. Completely new versions will generally have to wait for the next distro release.
F12 recently updated to 2.6.32. This is probably due to 2.6.31.stable dropping away, and no capacity at Fedora to maintain it on their own. So they are caught in a bind - stay on 2.6.31 and expose users to security vulnerabilities or move to 2.6.32 and cause regressions. Not a happy choice.
Quoted 8 lines
With in-kernel tools the kernel and the tooling that accompanies the kernel are upgraded in the same low-latency pathway. That is a big plus if you are offering things like instrumentation (which perf does), which relates closely to the kernel.
Furthermore, many distros package up the latest -git kernel as well. They almost never do that with user-space packages.
I'm sure if we ask the Fedora qemu maintainer to package qemu-kvm.git they'll consider it favourably. Isn't that what rawhide is for?
Quoted 8 lines
Let me give you a specific example:
I'm running Fedora Rawhide with 2.6.34-rc1 right now on my main desktop, and that comes with perf-2.6.34-0.10.rc1.git0.fc14.noarch.
My rawhide box has qemu-kvm-0.12.3-3.fc14.x86_64 installed. That's more than a 1000 Qemu commits older than the latest Qemu development branch.
Quoted 7 lines
So by being part of the kernel repo there's lower latency upgrades and earlier and better testing available on most distros.
You made it very clear that you dont want that, but please dont try to claim that those advantages do not exist - they are very much real and we are making good use of it.
I don't mind at all if rawhide users run on the latest and greatest, but release users deserve a little more stability.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
Quoted 1 line
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
Of which 1 is the kernel, and 192 are userspace updates (of which one may be qemu).
Quoted 8 lines
Quoted 6 lines
I think you didnt understand my (tersely explained) point - which is probably my fault. What i said is:
- distros update the kernel first. Often in stable releases as well if there's a new kernel released. (They must because it provides new hardware enablement and other critical changes they generally cannot skip.)
No, they don't. [...]
I just replied to Frank Ch. Eigler with a specific example that shows how this happens - and believe me, it happens.
Quoted 3 lines
[...] RHEL 5 is still on 2.6.18, for example. Users don't like their kernels updated unless absolutely necessary, with good reason.
Nope - RHEL 5 is on a 2.6.18 base for entirely different reasons.
Quoted 1 line
Kernel updates = reboots.
If you check the update frequency of RHEL 5 kernels you'll see that it's comparable to that of Fedora.
Quoted 9 lines
Quoted 3 lines
- Qemu on the other hand is not upgraded with (nearly) that level of urgency. Completely new versions will generally have to wait for the next distro release.
F12 recently updated to 2.6.32. This is probably due to 2.6.31.stable dropping away, and no capacity at Fedora to maintain it on their own. So they are caught in a bind - stay on 2.6.31 and expose users to security vulnerabilities or move to 2.6.32 and cause regressions. Not a happy choice.
Happy choice or not, this is what i said is the distro practice these days. (i dont know all the distros that well so i'm sure there's differences)
Quoted 10 lines
Quoted 7 lines
With in-kernel tools the kernel and the tooling that accompanies the kernel are upgraded in the same low-latency pathway. That is a big plus if you are offering things like instrumentation (which perf does), which relates closely to the kernel.
Furthermore, many distros package up the latest -git kernel as well. They almost never do that with user-space packages.
I'm sure if we ask the Fedora qemu maintainer to package qemu-kvm.git they'll consider it favourably. Isn't that what rawhide is for?
Rawhide is generally for latest released versions, to ready them for the next distro release - with special exception for the kernel, which has a special position due being a hardware-enabler and because it has an extremely predictable release schedule of every 90 days (+- 10 days).
Very rarely do distro people jump versions for things like GCC or Xorg or Gnome/KDE, but they've been burned enough times by unexpected delays in those projects to be really loathe to do it.
Qemu might get an exception - dunno, you could ask. My point still holds: by hosting KVM user-space bits in the kernel together with the rest of KVM you get version parity - which has clear advantages.
You also might have more luck with a bleeding-edge distro such as Gentoo.
Quoted 11 lines
Quoted 11 lines
Let me give you a specific example:
I'm running Fedora Rawhide with 2.6.34-rc1 right now on my main desktop, and that comes with perf-2.6.34-0.10.rc1.git0.fc14.noarch.
My rawhide box has qemu-kvm-0.12.3-3.fc14.x86_64 installed. That's more than a 1000 Qemu commits older than the latest Qemu development branch.
So by being part of the kernel repo there's lower latency upgrades and earlier and better testing available on most distros.
Quoted 6 lines
Quoted 3 lines
You made it very clear that you dont want that, but please dont try to claim that those advantages do not exist - they are very much real and we are making good use of it.
I don't mind at all if rawhide users run on the latest and greatest, but release users deserve a little more stability.
What are you suggesting, that released versions of KVM are not reliable? Of course any tools/ bits are release engineered just as much as the rest of KVM
...
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Ingo Molnar
Quoted 5 lines
[...] RHEL 5 is still on 2.6.18, for example. Users don't like their kernels updated unless absolutely necessary, with good reason.
Nope - RHEL 5 is on a 2.6.18 base for entirely different reasons.
All the reasons have 'stability' in them.
Quoted 5 lines
Quoted 2 lines
Kernel updates = reboots.
If you check the update frequency of RHEL 5 kernels you'll see that it's comparable to that of Fedora.
I'm sorry to say that's pretty bad. Users don't want to update their kernels.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
- Qemu on the other hand is not upgraded with (nearly) that level of urgency. Completely new versions will generally have to wait for the next distro release.
Quoted 9 lines
Quoted 6 lines
F12 recently updated to 2.6.32. This is probably due to 2.6.31.stable dropping away, and no capacity at Fedora to maintain it on their own. So they are caught in a bind - stay on 2.6.31 and expose users to security vulnerabilities or move to 2.6.32 and cause regressions. Not a happy choice.
Happy choice or not, this is what i said is the distro practice these days. (i dont know all the distros that well so i'm sure there's differences)
So in addition to all the normal kernel regressions, you want to force tools/kvm/ regressions on users.
Quoted 7 lines
Quoted 3 lines
I don't mind at all if rawhide users run on the latest and greatest, but release users deserve a little more stability.
What are you suggesting, that released versions of KVM are not reliable? Of course any
tools/bits are release engineered just as much as the rest of KVM
...
No, I am suggesting qemu-kvm.git is not as stable as released versions (and won't get fixed backported). Keep in mind that unlike many userspace applications, qemu exposes an ABI to guests which we must keep compatible.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Avi Kivity
Quoted 3 lines
Happy choice or not, this is what i said is the distro practice these days. (i dont know all the distros that well so i'm sure there's differences)
So in addition to all the normal kernel regressions, you want to force
tools/kvm/regressions on users.
So instead you force a NxN compatibility matrix [all versions of qemu combined with all versions of the kernel] instead of a linear N versions matrix with a clear focus on the last version. Brilliant engineering i have to say ;-)
Also, by your argument the kernel should be split up into a micro-kernel, with different packages for KVM, scheduler, drivers, upgradeable separately.
That would be a nightmare. (i can detail many facets of that nightmare if you insist but i'll spare the electrons for now) Fortunately few kernel developers share your views about this.
Quoted 10 lines
Quoted 6 lines
Quoted 2 lines
I don't mind at all if rawhide users run on the latest and greatest, but release users deserve a little more stability.
What are you suggesting, that released versions of KVM are not reliable? Of course any
tools/bits are release engineered just as much as the rest of KVM ...No, I am suggesting qemu-kvm.git is not as stable as released versions (and won't get fixed backported). Keep in mind that unlike many userspace applications, qemu exposes an ABI to guests which we must keep compatible.
I think you still dont understand it: if a tool moves to the kernel repo, then it is _released stable_ together with the next stable kernel.
I.e. you'd get a stable qemu-2.6.34 in essence, when v2.6.34 is released. You get minor updates with 2.6.34.1, 2.6.34.2, 2.6.34.3, etc - while development continues.
I.e. you get _more_ stability, because a matching kernel is released with a matching Qemu.
Qemu might have a different release schedule. Which, i argue, is not a good thing for exactly that reason :-) If it moved to tools/kvm/ it would get the same 90 days release frequency, merge window and stabilization window treatment as the upstream kernel.
Furthermore, users can also run experimental versions of qemu together with experimental versions of the kernel, by running something like 2.6.34-rc1 on Rawhide. Even if they dont download the latest qemu git and build it.
I.e. clearly _more_ is possible in such a scheme.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Ingo Molnar
Quoted 4 lines · Avi Kivity
Quoted 4 lines
Happy choice or not, this is what i said is the distro practice these days. (i dont know all the distros that well so i'm sure there's differences)
Quoted 7 lines
Quoted 3 lines
So in addition to all the normal kernel regressions, you want to force
tools/kvm/regressions on users.So instead you force a NxN compatibility matrix [all versions of qemu combined with all versions of the kernel] instead of a linear N versions matrix with a clear focus on the last version. Brilliant engineering i have to say ;-)
Thanks. In fact with have an QxKxGxT compatibility matrix since we need to keep compatibility with guests and with tools. Since the easiest interface to keep compatible is the qemu/kernel interface, allowing the kernel and qemu to change independently allows reducing the compatibility matrix while still providing some improvements.
Regardless of that I'd keep binary compatibility anyway. Not everyone is on the update treadmill with everything updating every three months and those people appreciate stability. I intend to keep providing it.
Quoted 3 lines
Also, by your argument the kernel should be split up into a micro-kernel, with different packages for KVM, scheduler, drivers, upgradeable separately.
Some kernels do provide some of that facility (without being microkernels), for example the Windows and RHEL kernels. So it seems people want it.
Quoted 4 lines
That would be a nightmare. (i can detail many facets of that nightmare if you insist but i'll spare the electrons for now) Fortunately few kernel developers share your views about this.
I'm not sure you know my views about this.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
I don't mind at all if rawhide users run on the latest and greatest, but release users deserve a little more stability.
What are you suggesting, that released versions of KVM are not reliable? Of course any
tools/bits are release engineered just as much as the rest of KVM ...
Quoted 7 lines
Quoted 4 lines
No, I am suggesting qemu-kvm.git is not as stable as released versions (and won't get fixed backported). Keep in mind that unlike many userspace applications, qemu exposes an ABI to guests which we must keep compatible.
I think you still dont understand it: if a tool moves to the kernel repo, then it is
_releasedstable_together with the next stable kernel.
I was confused by the talk about 2.6.34-rc1, which isn't stable.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarHi -
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
[...]
Distributions are very eager to update kernels even in stable periods of the distro lifetime - they are much less willing to update user-space packages. [...]Sorry, er, what? What distributions eagerly upgrade kernels in stable periods, were it not primarily motivated by security fixes? [...]
Please check the popular distro called 'Fedora' for example
I do believe I've heard of it. According to fedora bodhi, there have been 18 kernel updates issues for fedora 11 since its release, of which 12 were for purely security updates, and most of the other six also contain security fixes. None are described as 'enhancement' updates. Oh, what about fedora 12? 8 updates total, of which 5 are security only, one for drm showstoppers, others including security fixes, again 0 tagged as 'enhancement'.
So where is that "eagerness" again?? My sense is that most users are happy to leave a stable kernel running as long as possible, and distributions know this. You surely must understand that the lkml demographics are different.
Quoted 1 line
and its kernel upgrade policies.
[citation needed]
Quoted 3 lines
Quoted 1 line
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
That's not "eager". That's "I'm exasperated from guessing what's really important; let's not have so many updates; meh".
- FChE
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 20 lines · Frank Ch. Eigler
Hi -
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
[...]
Distributions are very eager to update kernels even in stable periods of the distro lifetime - they are much less willing to update user-space packages. [...]Sorry, er, what? What distributions eagerly upgrade kernels in stable periods, were it not primarily motivated by security fixes? [...]
Please check the popular distro called 'Fedora' for example
I do believe I've heard of it. According to fedora bodhi, there have been 18 kernel updates issues for fedora 11 since its release, of which 12 were for purely security updates, and most of the other six also contain security fixes. None are described as 'enhancement' updates. Oh, what about fedora 12? 8 updates total, of which 5 are security only, one for drm showstoppers, others including security fixes, again 0 tagged as 'enhancement'.
Quoted 8 lines
So where is that "eagerness" again?? My sense is that most users are happy to leave a stable kernel running as long as possible, and distributions know this. You surely must understand that the lkml demographics are different.
Quoted 1 line
and its kernel upgrade policies.
[citation needed]
You are quite wrong, despite the sarcastic tone you are attempting to use, and this is distro kernel policy 101.
For distros such as Fedora it's simpler to support the same kernel version across many older versions of the distro than having to support different kernel versions.
Check Fedora 12 for example. Four months ago it was released with kernel v2.6.31:
But if you update a Fedora 12 installation today you'll get kernel v2.6.32:
http://download.fedora.redhat.com/pub/fedora/linux/updates/12/SRPMS/kernel-2.6.32.9-70.fc12.src.rpm
As a result you'll get a new 2.6.32 kernel on Fedora 12.
The end result is what i said in the previous mail: that you'll get a newer kernel even on a stable distro - while user-space packages will only be updated if there's a security issue (and even then there's no version jump like for the kernel).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
[...] What users eagerly replace their kernels?
Those 99% who click on the 'install 193 updates' popup.
That's not "eager". That's "I'm exasperated from guessing what's really important; let's not have so many updates; meh".
Erm, fact is, 99% [WAG] of the users click on the update button and accept whatever kernel version the distro update offers them.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 12 lines · Ingo Molnar
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Ingo Molnar
Quoted 7 lines
It's about who owns the user interface.
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Of course illogical modularization complicates things 'significantly'.
Who should own the user interface then?
If qemu was in
tools/kvm/then we wouldnt have such issues. A single patch (or series of patches) could modifytools/kvm/,arch/x86/kvm/,virt/andtools/perf/.
We would have exactly the same issues, only they would be in a single repository. The only difference is that we could ignore potential alternatives to qemu, libvirt, and RHEV-M. But that's not how kernel ABIs are developed, we try to make them general, not suited to just one consumer that happens to be close to our heart.
Quoted 4 lines
Numerous times did we have patches to
kernel/perf_event.cthat fixed some detail, also accompanied by atools/perf/patch fixing another detail. Having a single 'culture of contribution' is a powerful way to develop.
In fact kvm started out in a single repo, and it certainly made it easy to bring it up in baby steps. But we've long outgrown that. Maybe the difference is that perf is still new and thus needs tight cooperation. If/when perf gains a real GUI, I doubt more than 1% of the patches will touch both kernel and userspace.
Quoted 4 lines
It turns out kernel developers can be pretty good user-space developers as well and user-space developers can be pretty good kernel developers as well. Some like to do both - as long as it's all within a single project.
Very childish of them. If someone wants to contribute to a userspace project, they can swallow their pride and send patches to a non-kernel mailing list and repository.
Quoted 4 lines
The moment any change (be it as trivial as fixing a GUI detail or as complex as a new feature) involves two or more packages, development speed slows down to a crawl - while the complexity of the change might be very low!
Why is that?
I the maintainers of all packages are cooperative and responsive, then the patches will get accepted quickly. If they aren't, development will be slow. It isn't any different from contributing to two unrelated kernel subsystems (which are in fact in different repositories until the next merge window).
Quoted 4 lines
Also, there's the harmful process that people start categorizing themselves into 'I am a kernel developer' and 'I am a user space programmer' stereotypes, which limits the scope of contributions artificially.
You're encouraging this with your proposal. You're basically using the glory of kernel development to attract people to userspace.
Quoted 12 lines
Quoted 7 lines
Quoted 7 lines
Fast forward to 2010. The kernel side of KVM is maximum goodness - by far the worst-quality remaining aspects of KVM are precisely in areas that you
mention: 'if we have to support third party tools, then it significantly complicates things'. You kept Qemu as an external 'third party' entity to KVM, and KVM is clearly hurting from that - just see the recent KVM usability thread for examples about suckage.Quoted 5 lines
Any qemu usability problems are because developers (or their employers) are not interested in fixing them, not because of the repository location. Most kvm developer interest is in server-side deployment (even for desktop guests), so there is limited effort in implementing a virtualbox-style GUI.
Quoted 8 lines
The same has been said of oprofile as well: 'it somewhat sucks because we are too server centric', 'nobody is interested in good usability and oprofile is fine for the enterprises'. Ironically, the same has been said of Xen usability as well, up to the point KVM came around.
What was the core of the problem was a bad design and a split kernel-side user-side tool landscape.
I can accept the bad design (not knowing any of the details), but how can the kernel/user split affect usability?
Quoted 5 lines
In fact i think saying that 'our developers only care about the server' is borderline dishonest, when at the same time you are making it doubly sure (by inaction) that it stays so: by leaving an artificial package wall between kernel-side KVM and user-side KVM and not integrating the two technologies.
The wall is maybe four nanometers high. Please be serious. If someone wants to work on qemu usability all they have to do is to clone the repository and start sending patches to qemu-devel@. What's gained by putting it in the kernel repository? You're saving a minute's worth of clone, and that only for people who already happen to be kernel developers.
Quoted 3 lines
You'll never know what heights you could achieve if you leave that wall there
...
I truly don't know. What highly usable GUIs were developed in the kernel?
Quoted 9 lines
Furthermore, what should be realized is that bad usability hurts "server features" just as much. Most of the day-to-day testing is done on the desktop by desktop oriented testers/developers. _Not_ by enterprise shops - they tend to see the code years down the line to begin with ...
Yes, a particular feature might be server oriented, but a good portion of our testing is on the desktop and everyone is hurting from bad usability and this puts limits on contribution efficiency.
I'm not saying that improved usability isn't a good thing, but time spent on improving the GUI is time not spent on the features that we really want.
Desktop oriented users also rarely test 16 vcpu guests with tons of RAM exercising 10Gb NICs and a SAN. Instead they care about graphics performance for 2vcpu/1GB guests.
Quoted 6 lines
As the patch posted in
_thisvery thread demonstratesit_, it is doubly more difficult to contribute a joint KVM+Qemu feature, because it's two separate code bases, two contribution guidelines, two release schedules. While to the user it really is just one and the same thing. It should be so for the developer as well.
It's hard to contribute a patch that goes against the architecture of the system, where kvm deals with cpu virtualization, qemu (or theoretically another tool) manages a guest, and libvirt (or another tool) manages the host. You want a list of guests to be provided by qemu or the kernel, and that simply isn't how the system works.
Quoted 5 lines
Put in another way: KVM's current split design is making it easy to contribute server features (because the kernel side is clean and cool), but also makes it artificially hard to contribute desktop features: because the tooling side (Qemu) is 'just another package', is separated by a package and maintenance wall
Most server oriented patches in qemu/kvm have gone into qemu, not kvm (simply because it sees many more patches overall). It isn't hard to contribute to 'just another package', I have 1700 packages installed on my desktop and only one of them is a kernel.
Anyway your arguments apply equally well to gedit.
Quoted 3 lines
and is made somewhat uncool by a (as some KVM developers have pointed out in this thread) quirky codebase.
The qemu codebase is in fact quirky, but cp won't solve it. Only long patchsets to qemu-devel@.
Quoted 3 lines
(the rest of your points are really a function of this fundamental disagreement)
I disagree.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 15 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Quoted 3 lines · Avi Kivity
Quoted 2 lines · Ingo Molnar
Quoted 2 lines
It's about who owns the user interface.
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
If qemu owns the user interface, than we can satisfy this in a very simple way by adding a perf monitor command. If we have to support third party tools, then it significantly complicates things.
Of course illogical modularization complicates things 'significantly'.
Who should own the user interface then?
If qemu was in
tools/kvm/then we wouldnt have such issues. A single patch (or series of patches) could modifytools/kvm/,arch/x86/kvm/,virt/andtools/perf/.
Quoted 5 lines
We would have exactly the same issues, only they would be in a single repository. The only difference is that we could ignore potential alternatives to qemu, libvirt, and RHEV-M. But that's not how kernel ABIs are developed, we try to make them general, not suited to just one consumer that happens to be close to our heart.
Not at all - as i replied to in a previous mail, tools/perf/ still has a clear userspace interface and ABI, and external projects are making use of it.
So there's no problem with the ABI at all.
In fact our experience has been the opposite: the perf ABI is markedly better _because_ there's an immediate consumer of it in the form of tools/perf/. It gets tested better and external projects can get their ABI tweaks in as well and can provide a reference implementation for tools/perf. This has happened a couple of times. It's a win-win scenario.
So the exact opposite of what you suggest is happening in practice.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityQuoted 6 lines · Avi Kivity
Quoted 4 lines
The moment any change (be it as trivial as fixing a GUI detail or as complex as a new feature) involves two or more packages, development speed slows down to a crawl - while the complexity of the change might be very low!
Why is that?
It's very simple: because the contribution latencies and overhead compound, almost inevitably.
If you ever tried to implement a combo GCC+glibc+kernel feature you'll know
...
Even with the best-run projects in existence it takes forever and is very painful - and here i talk about first hand experience over many years.
Quoted 3 lines
I the maintainers of all packages are cooperative and responsive, then the patches will get accepted quickly. If they aren't, development will be slow. [...]
I'm afraid practice is different from the rosy ideal you paint there. Even with assumed 'perfect projects' there's always random differences between projects, causing doubled (tripled) overhead and compounded up overhead:
- random differences in release schedules
- random differences in contribution guidelines
- random differences in coding style
Quoted 3 lines
[...] It isn't any different from contributing to two unrelated kernel subsystems (which are in fact in different repositories until the next merge window).
You mention a perfect example: contributing to multipe kernel subsystems. Even _that_ is very noticeably harder than contributing to a single subsystem - due to the inevitable buerocratic overhead, due to different development trees, due to different merge criteria.
So you are underlining my point (perhaps without intending to): treating closely related bits of technology as a single project is much better.
Obviously arch/x86/kvm/, virt/ and tools/kvm/ should live in a single development repository (perhaps micro-differentiated by a few topical branches), for exactly those reasons you mention.
Just like tools/perf/ and kernel/perf_event.c and arch/*/kernel/perf*.c are treated as a single project.
[ Note: we actually started from a 'split' design [almost everyone picks that,
because of this false 'kernel space bits must be separate from user space bits' myth] where the user-space component was a separate code base and unified it later on as the project progressed.
Trust me, the practical benefits of the unified approach are enormous to developers and to users alike, and there was no looking back once we made the switch. ]
Also, i dont really try to 'convince' you here - you made your position very clear early on and despite many unopposed technical arguments i made, the positions seem to have hardened and i expect it wont change, no matter what arguments i bring. It's a pity but hey, i'm just an observer here really - it's the rest of _your_ life this all impacts.
I just wanted to point out the root cause of KVM's usability problems as i see it - just like i was pointing out the mortal Xen design deficiencies back when i was backing KVM strongly, four years ago. Back then everyone was saying that i'm crazy and we are stuck with Xen forever and while KVM is nice it has no chance.
Just because you got the kernel bits of KVM right a few years ago does not mean you cannot mess up other design aspects, and sometimes badly so ;-) Historically i messed up more than half of all first-gut-feeling technical design decisions i did, so i had to correct the course many, many times.
I hope you are still keeping an open mind about it all and dont think that because the project was split for 4 years (to no fault of your own, simply out of necessity) it should be split forever ...
arch/x86 was split for a much longer period than that.
Circumstances have changed. Most Qemu users/contributions are now coming from the KVM angle, so please simply start thinking about the next level of evolution.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Avi Kivity
Quoted 5 lines
The moment any change (be it as trivial as fixing a GUI detail or as complex as a new feature) involves two or more packages, development speed slows down to a crawl - while the complexity of the change might be very low!
Quoted 5 lines
Quoted 2 lines
Why is that?
It's very simple: because the contribution latencies and overhead compound, almost inevitably.
It's not inevitable, if the projects are badly run, you'll have high latencies, but projects don't have to be badly run.
Quoted 6 lines
If you ever tried to implement a combo GCC+glibc+kernel feature you'll know
...Even with the best-run projects in existence it takes forever and is very painful - and here i talk about first hand experience over many years.
Try sending a patch to qemu-devel@, you may be pleasantly surprised.
Quoted 8 lines
Quoted 4 lines
I the maintainers of all packages are cooperative and responsive, then the patches will get accepted quickly. If they aren't, development will be slow. [...]
I'm afraid practice is different from the rosy ideal you paint there. Even with assumed 'perfect projects' there's always random differences between projects, causing doubled (tripled) overhead and compounded up overhead:
Quoted 6 lines
- random differences in release schedules
- random differences in contribution guidelines
- random differences in coding style
None of these matter for steady contributors.
Quoted 9 lines
Quoted 4 lines
[...] It isn't any different from contributing to two unrelated kernel subsystems (which are in fact in different repositories until the next merge window).
You mention a perfect example: contributing to multipe kernel subsystems. Even _that_ is very noticeably harder than contributing to a single subsystem - due to the inevitable buerocratic overhead, due to different development trees, due to different merge criteria.
Quoted 7 lines
So you are underlining my point (perhaps without intending to): treating closely related bits of technology as a single project is much better.
Obviously
arch/x86/kvm/,virt/andtools/kvm/should live in a single development repository (perhaps micro-differentiated by a few topical branches), for exactly those reasons you mention.
How is a patch for the qemu GUI eject button and the kvm shadow mmu related? Should a single maintainer deal with both?
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Avi Kivity
Quoted 6 lines · Ingo Molnar
Quoted 4 lines · Avi Kivity
Quoted 4 lines
The moment any change (be it as trivial as fixing a GUI detail or as complex as a new feature) involves two or more packages, development speed slows down to a crawl - while the complexity of the change might be very low!
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Why is that?
It's very simple: because the contribution latencies and overhead compound, almost inevitably.
It's not inevitable, if the projects are badly run, you'll have high latencies, but projects don't have to be badly run.
So the 64K dollar question is, why does Qemu still suck?
Quoted 36 lines
Quoted 6 lines
If you ever tried to implement a combo GCC+glibc+kernel feature you'll know
...Even with the best-run projects in existence it takes forever and is very painful - and here i talk about first hand experience over many years.
Try sending a patch to qemu-devel@, you may be pleasantly surprised.
Quoted 7 lines
Quoted 3 lines
I the maintainers of all packages are cooperative and responsive, then the patches will get accepted quickly. If they aren't, development will be slow. [...]
I'm afraid practice is different from the rosy ideal you paint there. Even with assumed 'perfect projects' there's always random differences between projects, causing doubled (tripled) overhead and compounded up overhead:
Quoted 5 lines
- random differences in release schedules
- random differences in contribution guidelines
- random differences in coding style
None of these matter for steady contributors.
Quoted 11 lines
Quoted 3 lines
[...] It isn't any different from contributing to two unrelated kernel subsystems (which are in fact in different repositories until the next merge window).
You mention a perfect example: contributing to multipe kernel subsystems. Even _that_ is very noticeably harder than contributing to a single subsystem - due to the inevitable buerocratic overhead, due to different development trees, due to different merge criteria.
So you are underlining my point (perhaps without intending to): treating closely related bits of technology as a single project is much better.
Quoted 6 lines
Quoted 3 lines
Obviously
arch/x86/kvm/,virt/andtools/kvm/should live in a single development repository (perhaps micro-differentiated by a few topical branches), for exactly those reasons you mention.How is a patch for the qemu GUI eject button and the kvm shadow mmu related? Should a single maintainer deal with both?
We have co-maintainers for perf that have a different focus. It works pretty well.
Look at git log tools/perf/ and how user-space and kernel-space components interact in practice. You'll patches that only impact one side, but you'll see very big overlap both in contributor identity and in patches as well.
Also, let me put similar questions in a bit different way:
- ' how is an in-kernel PIT emulation connected to Qemu's PIT emulation? '
- ' how is the in-kernel dynticks implementation related to Qemu's implementation of hardware timers? '
- ' how is an in-kernel event for a CD-ROM eject connected to an in-Qemu eject event? '
- ' how is a new hardware virtualization feature related to being able to configure and use it via Qemu? '
- ' how is the in-kernel x86 decoder/emulator related to the Qemu x86 emulator? '
- ' how is the performance of the qemu GUI related to the way VGA buffers are mapped and accelerated by KVM? '
They are obviously deeply related. The quality of a development process is not defined by the easy cases where no project unification is needed. The quality of a development process is defined by the _difficult_ cases.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Ingo Molnar
Quoted 4 lines
It's not inevitable, if the projects are badly run, you'll have high latencies, but projects don't have to be badly run.
So the 64K dollar question is, why does Qemu still suck?
Where people sent patches, it doesn't suck (or sucks less). Where they don't, it still sucks. And it cost way more than $64K.
If moving things to tools/ helps, let's move Fedora to tools/.
Quoted 6 lines
Quoted 3 lines
How is a patch for the qemu GUI eject button and the kvm shadow mmu related? Should a single maintainer deal with both?
We have co-maintainers for perf that have a different focus. It works pretty well.
And it works well when I have patches that change x86 core and kvm. But that's no longer a single repository and we have to coordinate.
Quoted 8 lines
Look at git log
tools/perf/and how user-space and kernel-space components interact in practice. You'll patches that only impact one side, but you'll see very big overlap both in contributor identity and in patches as well.Also, let me put similar questions in a bit different way:
- ' how is an in-kernel PIT emulation connected to Qemu's PIT emulation? '
Both implement the same spec. One is be a code derivative of the other (via Xen).
Quoted 3 lines
- ' how is the in-kernel dynticks implementation related to Qemu's implementation of hardware timers? '
The quality of host kernel timers directly determines the quality of qemu's timer emulation.
Quoted 3 lines
- ' how is an in-kernel event for a CD-ROM eject connected to an in-Qemu eject event? '
Both implement the same spec. The kernel of course needs to handle all implementation variants, while qemu only needs to implement it once.
Quoted 3 lines
- ' how is a new hardware virtualization feature related to being able to configure and use it via Qemu? '
Most features (example: npt) are transparent to userspace, some are not. When they are not, we introduce an ioctl() to kvm for controlling the feature, and a command-line switch to qemu for calling it.
Quoted 3 lines
- ' how is the in-kernel x86 decoder/emulator related to the Qemu x86 emulator? '
Both implement the same spec. Note qemu is not an emulator but a binary translator.
Quoted 3 lines
- ' how is the performance of the qemu GUI related to the way VGA buffers are mapped and accelerated by KVM? '
kvm needs to support direct mapping when possible and efficient data transfer when not. The latter will obviously be much slower. When direct mapping is possible, kvm needs to track pages touched by the guest to avoid full screen redraws. The rest (interfacing to X or vnc, implementing emulated hardware acceleration, full-screen mode, etc.) are unrelated.
Quoted 1 line
They are obviously deeply related.
Not at all. kvm in fact knows nothing about vga, to take your last example. To suggest that qemu needs to be close to the kernel to benefit from the kernel's timer implementation means we don't care about providing quality timing except to ourselves, which luckily isn't the case.
Some time ago the various desktops needed directory change notification, and people implemented inotify (or whatever it's called today). No one suggested tools/gnome/ and tools/kde/.
Quoted 4 lines
The quality of a development process is not
defined by the easy cases where no project unification is needed. The quality of a development process is defined by the _difficult_ cases.
That's true, but we don't have issues at the qemu/kvm boundary. Note we do have issues at the qemu/aio interfaces and qemu/net interfaces (out of which vhost-net was born) but these wouldn't be solved by tools/qemu/.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Quoted 2 lines
It's not inevitable, if the projects are badly run, you'll have high latencies, but projects don't have to be badly run.
So the 64K dollar question is, why does Qemu still suck?
Where people sent patches, it doesn't suck (or sucks less). Where they don't, it still sucks. [...]
So is your point that the development process and basic code structure does not matter at all, it's just a matter of people sending patches? I beg to differ ...
Quoted 3 lines
[...] And it cost way more than $64K.
If moving things to
tools/helps, let's move Fedora totools/.
Those bits of Fedora which deeply relate to the kernel - yes. Those bits that are arguably separate - nope.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
How is a patch for the qemu GUI eject button and the kvm shadow mmu related? Should a single maintainer deal with both?
We have co-maintainers for perf that have a different focus. It works pretty well.
And it works well when I have patches that change x86 core and kvm. But that's no longer a single repository and we have to coordinate.
Actually, it works much better if, contrary to your proposal it ends up in a single repo. Last i checked both of us really worked on such a project, run by some guy. (Named Linus or so.)
Quoted 48 lines
Quoted 7 lines
Look at git log
tools/perf/and how user-space and kernel-space components interact in practice. You'll patches that only impact one side, but you'll see very big overlap both in contributor identity and in patches as well.Also, let me put similar questions in a bit different way:
- ' how is an in-kernel PIT emulation connected to Qemu's PIT emulation? '
Both implement the same spec. One is be a code derivative of the other (via Xen).
Quoted 2 lines
- ' how is the in-kernel dynticks implementation related to Qemu's implementation of hardware timers? '
The quality of host kernel timers directly determines the quality of qemu's timer emulation.
Quoted 2 lines
- ' how is an in-kernel event for a CD-ROM eject connected to an in-Qemu eject event? '
Both implement the same spec. The kernel of course needs to handle all implementation variants, while qemu only needs to implement it once.
Quoted 2 lines
- ' how is a new hardware virtualization feature related to being able to configure and use it via Qemu? '
Most features (example: npt) are transparent to userspace, some are not. When they are not, we introduce an
ioctl()to kvm for controlling the feature, and a command-line switch to qemu for calling it.Quoted 2 lines
- ' how is the in-kernel x86 decoder/emulator related to the Qemu x86 emulator? '
Both implement the same spec. Note qemu is not an emulator but a binary translator.
Quoted 2 lines
- ' how is the performance of the qemu GUI related to the way VGA buffers are mapped and accelerated by KVM? '
kvm needs to support direct mapping when possible and efficient data transfer when not. The latter will obviously be much slower. When direct mapping is possible, kvm needs to track pages touched by the guest to avoid full screen redraws. The rest (interfacing to X or vnc, implementing emulated hardware acceleration, full-screen mode, etc.) are unrelated.
Quoted 3 lines
Quoted 1 line
They are obviously deeply related.
Not at all. [...]
You are obviously arguing for something like UML. Fortunately KVM is not that. Or i hope it isnt.
Quoted 2 lines
[...] kvm in fact knows nothing about vga, to take your last example. [...]
Look at the VGA dirty bitmap optimization a'ka the KVM_GET_DIRTY_LOG ioctl.
See qemu/kvm-all.c's kvm_physical_sync_dirty_bitmap().
It started out as a VGA optimization (also used by live migration) and even today it's mostly used by the VGA drivers - albeit a weak one.
I wish there were stronger VGA optimizations implemented, copying the dirty bitmap is not a particularly performant solution. (although it's certainly better than full emulation) Graphics performance is one of the more painful aspects of KVM usability today.
Quoted 3 lines
[...] To suggest that qemu needs to be close to the kernel to benefit from the kernel's timer implementation means we don't care about providing quality timing except to ourselves, which luckily isn't the case.
That is not what i said. I said they are closely related, and where technologies are closely related, project proximity turns into project unification at a certain stage.
Quoted 3 lines
Some time ago the various desktops needed directory change notification, and people implemented inotify (or whatever it's called today). No one suggested
tools/gnome/andtools/kde/.
You are misconstruing and misrepresenting my argument - i'd expect better. Gnome and KDE runs on other kernels as well and is generally not considered close to the kernel.
Do you seriously argue that Qemu has nothing to do with KVM these days?
Quoted 7 lines
Quoted 3 lines
The quality of a development process is not defined by the easy cases where no project unification is needed. The quality of a development process is defined by the _difficult_ cases.
That's true, but we don't have issues at the qemu/kvm boundary. Note we do have issues at the qemu/aio interfaces and qemu/net interfaces (out of which vhost-net was born) but these wouldn't be solved by
tools/qemu/.
That was not what i suggested. They would be solved by what i proposed:tools/kvm/, right?
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
Quoted 3 lines
It's not inevitable, if the projects are badly run, you'll have high latencies, but projects don't have to be badly run.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
So the 64K dollar question is, why does Qemu still suck?
Where people sent patches, it doesn't suck (or sucks less). Where they don't, it still sucks. [...]
So is your point that the development process and basic code structure does not matter at all, it's just a matter of people sending patches? I beg to differ ...
The development process of course matters, and we have worked hard to fix qemu's. Basic code structure also matters, but you don't fix that with cp.
Quoted 7 lines
Quoted 4 lines
[...] And it cost way more than $64K.
If moving things to
tools/helps, let's move Fedora totools/.Those bits of Fedora which deeply relate to the kernel - yes. Those bits that are arguably separate - nope.
A qemu GUI is not deeply related to the kernel. Or at all.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
How is a patch for the qemu GUI eject button and the kvm shadow mmu related? Should a single maintainer deal with both?
We have co-maintainers for perf that have a different focus. It works pretty well.
Quoted 7 lines
Quoted 3 lines
And it works well when I have patches that change x86 core and kvm. But that's no longer a single repository and we have to coordinate.
Actually, it works much better if, contrary to your proposal it ends up in a single repo. Last i checked both of us really worked on such a project, run by some guy. (Named Linus or so.)
Well, when last I sent x86 patches, they went to you and hpa, applied to tip, from which I had to merge them back. Two repositories. After several weeks they did end up in a third repository, Linus'. The process isn't trivial or fast, but it works.
Quoted 54 lines
Quoted 54 lines
Quoted 8 lines
Look at git log
tools/perf/and how user-space and kernel-space components interact in practice. You'll patches that only impact one side, but you'll see very big overlap both in contributor identity and in patches as well.Also, let me put similar questions in a bit different way:
- ' how is an in-kernel PIT emulation connected to Qemu's PIT emulation? '
Both implement the same spec. One is be a code derivative of the other (via Xen).
Quoted 3 lines
- ' how is the in-kernel dynticks implementation related to Qemu's implementation of hardware timers? '
The quality of host kernel timers directly determines the quality of qemu's timer emulation.
Quoted 3 lines
- ' how is an in-kernel event for a CD-ROM eject connected to an in-Qemu eject event? '
Both implement the same spec. The kernel of course needs to handle all implementation variants, while qemu only needs to implement it once.
Quoted 3 lines
- ' how is a new hardware virtualization feature related to being able to configure and use it via Qemu? '
Most features (example: npt) are transparent to userspace, some are not. When they are not, we introduce an
ioctl()to kvm for controlling the feature, and a command-line switch to qemu for calling it.Quoted 3 lines
- ' how is the in-kernel x86 decoder/emulator related to the Qemu x86 emulator? '
Both implement the same spec. Note qemu is not an emulator but a binary translator.
Quoted 3 lines
- ' how is the performance of the qemu GUI related to the way VGA buffers are mapped and accelerated by KVM? '
kvm needs to support direct mapping when possible and efficient data transfer when not. The latter will obviously be much slower. When direct mapping is possible, kvm needs to track pages touched by the guest to avoid full screen redraws. The rest (interfacing to X or vnc, implementing emulated hardware acceleration, full-screen mode, etc.) are unrelated.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
They are obviously deeply related.
Not at all. [...]
You are obviously arguing for something like UML. Fortunately KVM is not that. Or i hope it isnt.
I am not arguing for UML and don't understand why you think so.
Quoted 5 lines
Quoted 3 lines
[...] kvm in fact knows nothing about vga, to take your last example. [...]
Look at the VGA dirty bitmap optimization a'ka the
KVM_GET_DIRTY_LOGioctl.
Quoted 7 lines
See qemu/kvm-all.c's
kvm_physical_sync_dirty_bitmap().It started out as a VGA optimization (also used by live migration) and even today it's mostly used by the VGA drivers - albeit a weak one.
I wish there were stronger VGA optimizations implemented, copying the dirty bitmap is not a particularly performant solution.
The VGA dirty bitmap is 256 bytes in length. Copying it doesn't take any time at all.
People are in fact working on a copy-less dirty bitmap solution, for live migration of very large memory guests. Expect set_bit_user() patches for tip.git.
Quoted 4 lines
(although it's certainly
better than full emulation) Graphics performance is one of the more painful aspects of KVM usability today.
If you have suggestions for further optimizations (or even patches) I'd love to hear them.
One solution we are working on is QXL, a framebuffer-less graphics card designed for spice. The use case is again server based (hosted desktops) but may be adapted for desktop-on-desktop use.
Quoted 8 lines
Quoted 4 lines
[...] To suggest that qemu needs to be close to the kernel to benefit from the kernel's timer implementation means we don't care about providing quality timing except to ourselves, which luckily isn't the case.
That is not what i said. I said they are closely related, and where technologies are closely related, project proximity turns into project unification at a certain stage.
I really don't see how. So what if both qemu and kvm implement an i8254? They can't share any code since the internal APIs are so different. Even worse for the x86 emulator as qemu and kvm are fundamentally different. Even more with the qemu timers and kernel dyntick code.
Quoted 8 lines
Quoted 4 lines
Some time ago the various desktops needed directory change notification, and people implemented inotify (or whatever it's called today). No one suggested
tools/gnome/andtools/kde/.You are misconstruing and misrepresenting my argument - i'd expect better. Gnome and KDE runs on other kernels as well and is generally not considered close to the kernel.
qemu runs on other kernels (including Windows), just without kvm.
Quoted 2 lines
Do you seriously argue that Qemu has nothing to do with KVM these days?
The vast majority of qemu has nothing to do with kvm, all the kvm interface bits are in two files. Things like the GUI, the VNC server, IDE emulation, the management interface (the monitor), live migration, qcow2 and ~15 other file format drivers, chipset emulation, USB controller emulation, snapshot support, slirp, serial port emulation, and a zillion other details have nothing to do with kvm.
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines
The quality of a development process is not defined by the easy cases where no project unification is needed. The quality of a development process is defined by the _difficult_ cases.
That's true, but we don't have issues at the qemu/kvm boundary. Note we do have issues at the qemu/aio interfaces and qemu/net interfaces (out of which vhost-net was born) but these wouldn't be solved by
tools/qemu/.That was not what i suggested. They would be solved by what i proposed:
tools/kvm/, right?
If they were, it would be worth it.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Avi Kivity
Quoted 3 lines
That is not what i said. I said they are closely related, and where technologies are closely related, project proximity turns into project unification at a certain stage.
I really don't see how. So what if both qemu and kvm implement an i8254? They can't share any code since the internal APIs are so different. [...]
I wouldnt jump to assumptions there. perf shares some facilities with the kernel on the source code level - they can be built both in the kernel and in user-space.
But my main thought wasnt even to actually share the implementation - but to actually synchronize when a piece of device emulation moves into the kernel. It is arguably bad for performance in most cases when Qemu handles a given device - so all the common devices should be kernel accelerated.
The version and testing matrix would be simplified significantly as well: as kernel and qemu goes hand in hand, they are always on the same version.
Quoted 2 lines
[...] Even worse for the x86 emulator as qemu and kvm are fundamentally different.
So is it your argument that the difference and the duplication in x86 instruction emulation is a good thing? You said it some time ago that the kvm x86 emulator was very messy and you wish it was cleaner.
While qemu's is indeed rather different (it's partly a translator/JIT), i'm sure the decoder logic could be shared - and qemu has a slow-path full-emulation fallback in any case, which is similar to what in-kernel emulator does (IIRC ...).
That might have changed meanwhile.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 14 lines · Ingo Molnar
Quoted 7 lines · Avi Kivity
Quoted 4 lines
That is not what i said. I said they are closely related, and where technologies are closely related, project proximity turns into project unification at a certain stage.
I really don't see how. So what if both qemu and kvm implement an i8254? They can't share any code since the internal APIs are so different. [...]
I wouldnt jump to assumptions there. perf shares some facilities with the kernel on the source code level - they can be built both in the kernel and in user-space.
Quoted 8 lines
But my main thought wasnt even to actually share the implementation - but to actually synchronize when a piece of device emulation moves into the kernel. It is arguably bad for performance in most cases when Qemu handles a given device - so all the common devices should be kernel accelerated.
The version and testing matrix would be simplified significantly as well: as kernel and qemu goes hand in hand, they are always on the same version.
So, you propose to allow running tools/kvm/ only on the kernel it was shipped with?
Otherwise the testing matrix isn't simplified.
Quoted 5 lines
Quoted 3 lines
[...] Even worse for the x86 emulator as qemu and kvm are fundamentally different.
So is it your argument that the difference and the duplication in x86 instruction emulation is a good thing?
Of course it isn't a good thing, but it is unavoidable. Qemu compiles code just-in-time to avoid interpretation overhead, while kvm emulates one instruction at a time. No caching is possible, especially with ept/npt, since the guest is free to manipulate memory with no notification to the host. Qemu also supports the full instruction set while kvm only implements what is necessary. Qemu is a multi-source/multi-target translator while kvm's emulator is x86 specific.
Quoted 3 lines
You said it some time ago that
the kvm x86 emulator was very messy and you wish it was cleaner.
It's still messy but is being cleaned up.
Quoted 7 lines
While qemu's is indeed rather different (it's partly a translator/JIT), i'm sure the decoder logic could be shared - and qemu has a slow-path full-emulation fallback in any case, which is similar to what in-kernel emulator does (IIRC ...).
That might have changed meanwhile.
IIUC it only ever translates.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 19 lines · Avi Kivity
Quoted 18 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 3 lines
That is not what i said. I said they are closely related, and where technologies are closely related, project proximity turns into project unification at a certain stage.
I really don't see how. So what if both qemu and kvm implement an i8254? They can't share any code since the internal APIs are so different. [...]
I wouldnt jump to assumptions there. perf shares some facilities with the kernel on the source code level - they can be built both in the kernel and in user-space.
But my main thought wasnt even to actually share the implementation - but to actually synchronize when a piece of device emulation moves into the kernel. It is arguably bad for performance in most cases when Qemu handles a given device - so all the common devices should be kernel accelerated.
Quoted 5 lines
Quoted 2 lines
The version and testing matrix would be simplified significantly as well:
as kernel and qemu goes hand in hand, they are always on the same version.So, you propose to allow running
tools/kvm/only on the kernel it was shipped with?
No, but i propose concentrating on that natural combination.
Quoted 1 line
Otherwise the testing matrix isn't simplified.
It is, because testing is more focused and more people are testing the combination that developers tested as well. (and not some random version combination picked by the distributor or the user)
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 7 lines · Ingo Molnar
Quoted 3 lines
[...] kvm in fact knows nothing about vga, to take your last example. [...]
Look at the VGA dirty bitmap optimization a'ka the
KVM_GET_DIRTY_LOGioctl.See qemu/kvm-all.c's
kvm_physical_sync_dirty_bitmap().
Quoted 8 lines
It started out as a VGA optimization (also used by live migration) and even today it's mostly used by the VGA drivers - albeit a weak one.
I wish there were stronger VGA optimizations implemented, copying the dirty bitmap is not a particularly performant solution. (although it's certainly better than full emulation) Graphics performance is one of the more painful aspects of KVM usability today.
We have to maintain a dirty bitmap because we don't have a paravirtual graphics driver. IOW, someone needs to write an Xorg driver.
Ideally, we could just implement a Linux framebuffer device, right? Well, we took that approach in Xen and that sucks even worse because the Xorg framebuffer driver doesn't implement any of the optimizations that the Linux framebuffer supports and the Xorg driver does not provide use the kernel's interfaces for providing update regions.
Of course, we need to pull in X into the kernel to fix this, right?
Any sufficiently complicated piece of software is going to interact with a lot of other projects. The solution is not to pull it all into one massive repository. It's to build relationships and to find ways to efficiently work with the various communities.
And we're working on this with X. We'll have a paravirtual graphics driver very soon. There are no magic solutions. We need more developers working on the hard problems.
Regards,
Anthony Liguori
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 18 lines · Anthony Liguori
Quoted 9 lines · Ingo Molnar
Quoted 3 lines
[...] kvm in fact knows nothing about vga, to take your last example. [...]
Look at the VGA dirty bitmap optimization a'ka the
KVM_GET_DIRTY_LOGioctl.See qemu/kvm-all.c's
kvm_physical_sync_dirty_bitmap().Quoted 7 lines
It started out as a VGA optimization (also used by live migration) and even today it's mostly used by the VGA drivers - albeit a weak one.
I wish there were stronger VGA optimizations implemented, copying the dirty bitmap is not a particularly performant solution. (although it's certainly better than full emulation) Graphics performance is one of the more painful aspects of KVM usability today.
Quoted 4 lines
We have to maintain a dirty bitmap because we don't have a paravirtual graphics driver. IOW, someone needs to write an Xorg driver.
Ideally, we could just implement a Linux framebuffer device, right?
No, you'd want to interact with DRM.
( Especially as you want to write guest accelerators passing guest-space
OpenGL requests straight to the kernel DRM level. )
Especially if you want to do things like graphics card virtualization, with aspects of the graphics driver passed through to the guest OS.
There are all kernel space projects, going through Xorg would be a horrible waste of performance for full-screen virtualization. It's fine for the windowed or networked case (and good as a compatibility fallback), but very much not fine for local desktop use.
Quoted 6 lines
Well, we took that approach in Xen and that sucks even worse because the Xorg framebuffer driver doesn't implement any of the optimizations that the Linux framebuffer supports and the Xorg driver does not provide use the kernel's interfaces for providing update regions.
Of course, we need to pull in X into the kernel to fix this, right?
FYI, this part of X has already been pulled into the kernel, it's called DRM. If then it's being expanded.
Quoted 4 lines
Any sufficiently complicated piece of software is going to interact with a lot of other projects. The solution is not to pull it all into one massive repository. It's to build relationships and to find ways to efficiently work with the various communities.
That's my whole point with this thread: the kernel side of KVM and qemu, but all practical purposes should not be two 'separate communities'. They should be one and the same thing.
Separation makes sense where the relationship is light or strictly hierarchical - here it's neither. KVM and Qemu is interconnected, quite fundamentally so.
Quoted 3 lines
And we're working on this with X. We'll have a paravirtual graphics driver very soon. There are no magic solutions. We need more developers working on the hard problems.
The thing is, writing up a DRM connector to a guest Linux OS could be done in no time. It could be deployed to users in no time as well, with the proper development model.
That after years and years of waiting proper GX support is _still_ not implemented in KVM is really telling of the efficiency of development based on such disjoint 'communities'. Maybe put up a committee as well to increase efficiency? ;-)
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 21 lines · Ingo Molnar
Quoted 18 lines · Anthony Liguori
Quoted 16 lines · Ingo Molnar
Quoted 3 lines
[...] kvm in fact knows nothing about vga, to take your last example. [...]
Look at the VGA dirty bitmap optimization a'ka the
KVM_GET_DIRTY_LOGioctl.See qemu/kvm-all.c's
kvm_physical_sync_dirty_bitmap().It started out as a VGA optimization (also used by live migration) and even today it's mostly used by the VGA drivers - albeit a weak one.
I wish there were stronger VGA optimizations implemented, copying the dirty bitmap is not a particularly performant solution. (although it's certainly better than full emulation) Graphics performance is one of the more painful aspects of KVM usability today.
Quoted 7 lines
Quoted 5 lines
We have to maintain a dirty bitmap because we don't have a paravirtual graphics driver. IOW, someone needs to write an Xorg driver.
Ideally, we could just implement a Linux framebuffer device, right?
No, you'd want to interact with DRM.
Using DRM doesn't help very much. You still need an X driver and most of the operations you care about (video rendering, window movement, etc) are not operations that need to go through DRM.
3D graphics virtualization is extremely difficult in the non-passthrough case. It really requires hardware support that isn't widely available today (outside a few NVIDIA chipsets).
Quoted 9 lines
Quoted 6 lines
Xorg framebuffer driver doesn't implement any of the optimizations that the Linux framebuffer supports and the Xorg driver does not provide use the kernel's interfaces for providing update regions.
Of course, we need to pull in X into the kernel to fix this, right?
FYI, this part of X has already been pulled into the kernel, it's called DRM. If then it's being expanded.
It doesn't provide the things we need to a good user experience. You need things like an absolute input device, host driven display resize, RGBA hardware cursors. None of these go through DRI and it's those things that really provide the graphics user experience.
Quoted 9 lines
Quoted 5 lines
Any sufficiently complicated piece of software is going to interact with a lot of other projects. The solution is not to pull it all into one massive repository. It's to build relationships and to find ways to efficiently work with the various communities.
That's my whole point with this thread: the kernel side of KVM and qemu, but all practical purposes should not be two 'separate communities'. They should be one and the same thing.
I don't know why you keep saying this. The people who are in these "separate communities" keep claiming that they don't feel this way.
I'm not just saying this to be argumentative. Many of the people in the community have thought this same thing, and tried it themselves, and we've all come to the same conclusion.
It's certainly possible that we just missed the obvious thing to do but we'll never know that unless someone shows us.
Quoted 4 lines
The thing is, writing up a DRM connector to a guest Linux OS could be done in no time. It could be deployed to users in no time as well, with the proper development model.
If this is true, please demonstrate it. Prove your point with patches and I'll happily turn around and do whatever I can to help out.
Quoted 5 lines
That after years and years of waiting proper GX support is _still_ not implemented in KVM is really telling of the efficiency of development based on such disjoint 'communities'. Maybe put up a committee as well to increase efficiency? ;-)
Nah, instead we can just have a few hundred mail thread on the list. Otherwise we'd have to write patches and do other kinds of productive work.
Regards,
Anthony Liguori
Quoted 2 lines
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 21 lines · Anthony Liguori
Quoted 20 lines · Ingo Molnar
Quoted 18 lines · Anthony Liguori
Quoted 7 lines · Ingo Molnar
Quoted 2 lines
[...] kvm in fact knows nothing about vga, to take your last example. [...]
Look at the VGA dirty bitmap optimization a'ka the
KVM_GET_DIRTY_LOGioctl.See qemu/kvm-all.c's
kvm_physical_sync_dirty_bitmap().Quoted 7 lines
It started out as a VGA optimization (also used by live migration) and even today it's mostly used by the VGA drivers - albeit a weak one.
I wish there were stronger VGA optimizations implemented, copying the dirty bitmap is not a particularly performant solution. (although it's certainly better than full emulation) Graphics performance is one of the more painful aspects of KVM usability today.
We have to maintain a dirty bitmap because we don't have a paravirtual graphics driver. IOW, someone needs to write an Xorg driver.
Quoted 6 lines
Quoted 2 lines
Quoted 1 line
Ideally, we could just implement a Linux framebuffer device, right?
No, you'd want to interact with DRM.
Using DRM doesn't help very much. You still need an X driver and most of the operations you care about (video rendering, window movement, etc) are not operations that need to go through DRM.
You stripped out this bit from my reply:
Quoted 4 lines
Quoted 4 lines
There are all kernel space projects, going through Xorg would be a horrible waste of performance for full-screen virtualization. It's fine for the windowed or networked case (and good as a compatibility fallback), but very much not fine for local desktop use.
For the full-screen case (which is a very common mode of using a guest OS on the desktop) there's not much of window management needed. You need to save/restore as you switch in/out.
Quoted 3 lines
3D graphics virtualization is extremely difficult in the non-passthrough case. It really requires hardware support that isn't widely available today (outside a few NVIDIA chipsets).
Granted it's difficult in the general case.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Xorg framebuffer driver doesn't implement any of the optimizations that the Linux framebuffer supports and the Xorg driver does not provide use the kernel's interfaces for providing update regions.
Of course, we need to pull in X into the kernel to fix this, right?
Quoted 7 lines
Quoted 2 lines
FYI, this part of X has already been pulled into the kernel, it's called DRM. If then it's being expanded.
It doesn't provide the things we need to a good user experience. You need things like an absolute input device, host driven display resize, RGBA hardware cursors. None of these go through DRI and it's those things that really provide the graphics user experience.
With KSM the display resize is in the kernel. Cursor management is not. Yet: i think it would be a nice feature as the cursor could move even if Xorg is blocked or busy with other things.
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines
Any sufficiently complicated piece of software is going to interact with a lot of other projects. The solution is not to pull it all into one massive repository. It's to build relationships and to find ways to efficiently work with the various communities.
That's my whole point with this thread: the kernel side of KVM and qemu, but all practical purposes should not be two 'separate communities'. They should be one and the same thing.
I don't know why you keep saying this. The people who are in these "separate communities" keep claiming that they don't feel this way.
If you are not two separate communities but one community, then why do you go through the (somewhat masochistic) self-punishing excercise of keeping the project in two different pieces?
In a distant past Qemu was a separate project and KVM was just a newcomer who used it for fancy stuff. Today as you say(?) the two communities are one and the same. Why not bring it to its logical conclusion?
Quoted 6 lines
I'm not just saying this to be argumentative. Many of the people in the community have thought this same thing, and tried it themselves, and we've all come to the same conclusion.
It's certainly possible that we just missed the obvious thing to do but we'll never know that unless someone shows us.
I'm not aware of anyone in the past having attempted to move qemu to tools/kvm/ in the uptream kernel repo, and having reported on the experiences with such a contribution setup. (obviously it's not possible at all without heavy cooperation and acceptance from you and Avi, so this will probably remain a thought experiment forever)
If then you must refer to previous attempts to 'strip down' Qemu, right? Those attempts didnt really solve the fundamental problem of project code base separation.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Ingo Molnar
Quoted 5 lines
Quoted 5 lines
There are all kernel space projects, going through Xorg would be a horrible waste of performance for full-screen virtualization. It's fine for the windowed or networked case (and good as a compatibility fallback), but very much not fine for local desktop use.
For the full-screen case (which is a very common mode of using a guest OS on the desktop) there's not much of window management needed. You need to save/restore as you switch in/out.
I don't think I've ever used full-screen mode with my VMs and I use virtualization on a daily basis.
We hear very infrequently from users using full screen mode.
Quoted 16 lines
Quoted 4 lines
3D graphics virtualization is extremely difficult in the non-passthrough case. It really requires hardware support that isn't widely available today (outside a few NVIDIA chipsets).
Granted it's difficult in the general case.
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Xorg framebuffer driver doesn't implement any of the optimizations that the Linux framebuffer supports and the Xorg driver does not provide use the kernel's interfaces for providing update regions.
Of course, we need to pull in X into the kernel to fix this, right?
FYI, this part of X has already been pulled into the kernel, it's called DRM. If then it's being expanded.
Quoted 6 lines
Quoted 5 lines
It doesn't provide the things we need to a good user experience. You need things like an absolute input device, host driven display resize, RGBA hardware cursors. None of these go through DRI and it's those things that really provide the graphics user experience.
With KSM the display resize is in the kernel.
KMS
Quoted 4 lines
Cursor management is not. Yet: i
think it would be a nice feature as the cursor could move even if Xorg is blocked or busy with other things.
If it was all in the kernel, we'd try to support it.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Any sufficiently complicated piece of software is going to interact with a lot of other projects. The solution is not to pull it all into one massive repository. It's to build relationships and to find ways to efficiently work with the various communities.
That's my whole point with this thread: the kernel side of KVM and qemu, but all practical purposes should not be two 'separate communities'. They should be one and the same thing.
Quoted 7 lines
Quoted 3 lines
I don't know why you keep saying this. The people who are in these "separate communities" keep claiming that they don't feel this way.
If you are not two separate communities but one community, then why do you go through the (somewhat masochistic) self-punishing excercise of keeping the project in two different pieces?
I don't see any actual KVM developer complaining about this so I'm not sure why you're describing it like this.
Quoted 4 lines
In a distant past Qemu was a separate project and KVM was just a newcomer who used it for fancy stuff. Today as you say(?) the two communities are one and the same. Why not bring it to its logical conclusion?
We lose a huge amount of users and contributors if we put QEMU in the Linux kernel. As I said earlier, a huge number of our contributions come from people not using KVM.
Quoted 4 lines
Quoted 4 lines
I'm not just saying this to be argumentative. Many of the people in the community have thought this same thing, and tried it themselves, and we've all come to the same conclusion.
Quoted 9 lines
Quoted 3 lines
It's certainly possible that we just missed the obvious thing to do but we'll never know that unless someone shows us.
I'm not aware of anyone in the past having attempted to move qemu to
tools/kvm/in the uptream kernel repo, and having reported on the experiences with such a contribution setup. (obviously it's not possible at all without heavy cooperation and acceptance from you and Avi, so this will probably remain a thought experiment forever)
We've tried to create a "clean" version of QEMU specifically for KVM. Moving it into tools/kvm would be the second step. We've all failed on the firs step.
Quoted 4 lines
If then you must refer to previous attempts to 'strip down' Qemu, right? Those attempts didnt really solve the fundamental problem of project code base separation.
If the problem is combining the two, I've sent you a patch that you can put into tip.git if you're so inclined.
Regards,
Anthony Liguori
Quoted 2 lines
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Anthony Liguori
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
There are all kernel space projects, going through Xorg would be a horrible waste of performance for full-screen virtualization. It's fine for the windowed or networked case (and good as a compatibility fallback), but very much not fine for local desktop use.
Quoted 8 lines
Quoted 3 lines
For the full-screen case (which is a very common mode of using a guest OS on the desktop) there's not much of window management needed. You need to save/restore as you switch in/out.
I don't think I've ever used full-screen mode with my VMs and I use virtualization on a daily basis.
We hear very infrequently from users using full screen mode.
Sorry for getting slightly off-topic but I find the above statement interesting.
I don't use virtualization on daily basis but a working, fully integrated full-screen model with VirtualBox was the only reason I bothered to give VMs a second chance. From my point of view, the user experience of earlier versions (e.g. Parallels) was just too painful to live with.
/me crawls back to his hole now...
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 15 lines · Pekka Enberg
Quoted 5 lines · Anthony Liguori
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
There are all kernel space projects, going through Xorg would be a horrible waste of performance for full-screen virtualization. It's fine for the windowed or networked case (and good as a compatibility fallback), but very much not fine for local desktop use.
Quoted 8 lines
Quoted 3 lines
For the full-screen case (which is a very common mode of using a guest OS on the desktop) there's not much of window management needed. You need to save/restore as you switch in/out.
I don't think I've ever used full-screen mode with my VMs and I use virtualization on a daily basis.
We hear very infrequently from users using full screen mode.
Quoted 7 lines
Sorry for getting slightly off-topic but I find the above statement interesting.
I don't use virtualization on daily basis but a working, fully integrated full-screen model with VirtualBox was the only reason I bothered to give VMs a second chance. From my point of view, the user experience of earlier versions (e.g. Parallels) was just too painful to live with.
That's the same i do, and that's what i'm hearing from other desktop users as well.
The moment you work seriously in a guest OS you often want to switch to it full-screen, to maximize screen real-estate and to reduce host GUI element distractions. If it's just casual use of a single app then windowed mode suffices (but in that case performance doesnt matter much to begin with).
I find the 'KVM mostly cares about the server, not about the desktop' attitude expressed in this thread troubling.
Quoted 1 line
/me crawls back to his hole now...
/me should do that too - this discussion is not resulting in any positive result so it has become rather pointless.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 4 lines · Ingo Molnar
I find the 'KVM mostly cares about the server, not about the desktop' attitude expressed in this thread troubling.
It's not kvm, just it's developers (and their employers, where applicable). If you post desktop oriented patches I'm sure they'll be welcome.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
I find the 'KVM mostly cares about the server, not about the desktop' attitude expressed in this thread troubling.
It's not kvm, just it's developers (and their employers, where applicable). If you post desktop oriented patches I'm sure they'll be welcome.
Just such a patch-set was posted in this very thread: 'perf kvm'.
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
- the reaction to the 'how do we get symbols out of the guest' sub-question was, paraphrased: 'we dont want that due to <unspecified> security threat to XYZ selinux usecase with lots of guests'.
Anyone being aware of how Linux and KVM is being used on the desktop will know how detached that attitude is from the typical desktop usecase ...
Usability _never_ sucks because of lack of patches or lack of suggestions. I bet if you made the next server feature contingent on essential usability fixes they'd happen overnight - for God's sake there's been 1000 commits in the last 3 months in the Qemu repository so there's plenty of manpower...
Usability suckage - and i'm not going to be popular for saying this out loud - almost always shows a basic maintainer disconnect with the real world. See your very first reactions to my 'KVM usability' observations. Read back your and Anthony's replies: total 'sure, patches welcome' kind of indifference. It is _your project_, not some other project down the road ...
So that is my first-hand experience about how you are welcoming these desktop issues, in this very thread. I suspect people try a few times with suggestions, then get shot down like our suggestions were shot down and then give up.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
I find the 'KVM mostly cares about the server, not about the desktop' attitude expressed in this thread troubling.
It's not kvm, just it's developers (and their employers, where applicable). If you post desktop oriented patches I'm sure they'll be welcome.
Quoted 8 lines
Just such a patch-set was posted in this very thread: 'perf kvm'.
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
Well, it isn't.
Quoted 4 lines
- the reaction to the 'how do we get symbols out of the guest' sub-question was, paraphrased: 'we dont want that due to<unspecified> security threat to XYZ selinux usecase with lots of guests'.
When I review a patch, I try to think of the difficult cases, not just the easy case.
Quoted 8 lines
Anyone being aware of how Linux and KVM is being used on the desktop will know how detached that attitude is from the typical desktop usecase ...
Usability _never_ sucks because of lack of patches or lack of suggestions. I bet if you made the next server feature contingent on essential usability fixes they'd happen overnight - for God's sake there's been 1000 commits in the last 3 months in the Qemu repository so there's plenty of manpower...
First of all I am not a qemu maintainer. Second, from my point of view all contributors are volunteers (perhaps their employer volunteered them, but there's no difference from my perspective). Asking them to repaint my apartment as a condition to get a patch applied is abuse. If a patch is good, it gets applied.
Quoted 6 lines
Usability suckage - and i'm not going to be popular for saying this out loud - almost always shows a basic maintainer disconnect with the real world. See your very first reactions to my 'KVM usability' observations. Read back your and Anthony's replies: total 'sure, patches welcome' kind of indifference. It is
_yourproject_, not some other project down the road ...
I could drop everything and write a gtk GUI for qemu. Is that what you want?
If someone is truly interested in a qemu usability, it's up to them to write the patches. Personally I've never missed the eject button.
As to disconnect from the real world, most products based on kvm and qemu (and Linux) are server based. Perhaps that's the reason people emphasise that? Maybe if Linux had 10-20% desktop market penetration, there would be more interest in a bells and whistles qemu GUI.
Quoted 5 lines
So that is my first-hand experience about how you are welcoming these desktop issues, in this very thread. I suspect people try a few times with suggestions, then get shot down like our suggestions were shot down and then give up.
I don't recall anyone trying this much less being shot down. Perhaps people are concentrating on virt-manager and the like and leaving qemu alone.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Avi Kivity
Quoted 5 lines
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
Well, it isn't.
Erm, my usability points are _doubly_ true when there are multiple guests ...
The inconvenience of having to type:
perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ --guestmodules=/home/ymzhang/guest/modules top
is very obvious even with a single guest. Now multiply that by more guests ...
The crux is: we are working on improving KVM instrumentation. There are working patches posted to this thread and we would like to have/implement an automatism to allow the discovery of all this information. The information should be available to the developer who wants it, and easily/transparently so
- in true Linux fashion.
Quoted 6 lines
Quoted 3 lines
- the reaction to the 'how do we get symbols out of the guest' sub-question was, paraphrased: 'we dont want that due to<unspecified> security threat to XYZ selinux usecase with lots of guests'.
When I review a patch, I try to think of the difficult cases, not just the easy case.
You havent articulated an actionable reason and you have suggested no solution either, you just passive-agressive backed the claim that giving developers access to the symbol space is some sort of vague 'security threat'.
If that is not so i'd be glad to be proven wrong.
Quoted 10 lines
Quoted 8 lines
Anyone being aware of how Linux and KVM is being used on the desktop will know how detached that attitude is from the typical desktop usecase ...
Usability _never_ sucks because of lack of patches or lack of suggestions. I bet if you made the next server feature contingent on essential usability fixes they'd happen overnight - for God's sake there's been 1000 commits in the last 3 months in the Qemu repository so there's plenty of manpower...
First of all I am not a qemu maintainer. [...]
That is the crux of the matter. My experience in these threads was that no-one really seems to feel in charge of the whole thing. Should we really wonder why KVM usability sucks?
Quoted 4 lines
[...] Second, from my point of view all contributors are volunteers (perhaps their employer volunteered them, but there's no difference from my perspective). Asking them to repaint my apartment as a condition to get a patch applied is abuse. If a patch is good, it gets applied.
This is one of the weirdest arguments i've seen in this thread. Almost all the time do we make contributions conditional on the general shape of the project. Developers dont get to do just the fun stuff.
This is a basic quid pro quo: new features introduce risks and create additional workload not just to the originating developer but on the rest of the community as well. You should check how Linus has pulled new features in the past 15 years: he very much requires the existing code to first be top-notch before he accepts new features for a given area of functionality.
Doing that and insisting on developers to see those imbalances as well is absolutely essential to code quality: otherwise everyone would be running around implementing just the features they are interested in, without regard for the general health of the project.
Of course, if you keep the project in two halves (KVM and Qemu), and pretend that they are separate and have little relation, imbalances of quality can mount up and you can throw your hands up and say that it's "too bad, I'm not maintaining that". It is your basic duty as a Linux maintainer to keep balances of quality. I do it all day, other maintainers do it all day.
Quoted 9 lines
Quoted 6 lines
Usability suckage - and i'm not going to be popular for saying this out loud - almost always shows a basic maintainer disconnect with the real world. See your very first reactions to my 'KVM usability' observations. Read back your and Anthony's replies: total 'sure, patches welcome' kind of indifference. It is
_yourproject_, not some other project down the road ...I could drop everything and write a gtk GUI for qemu. Is that what you want?
No, my suggestion to you (it's up to you whether you give my opinion any weight) is to accept your mistakes and improve, and to not stand in the way of people who'd like to improve the situation. You are happy with the server features and you also made it clear that you dont feel responsible for the rest of the package - which is a big mistake IMO.
Also, you have demonstrated it in this thread that you have near zero technical clue about basic desktop and development usability matters - for example your stance on symbol space access and your stance on how to enumerate guests symbolically are outright bizarre.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 6 lines
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
Well, it isn't.
Quoted 9 lines
Erm, my usability points are _doubly_ true when there are multiple guests ...
The inconvenience of having to type:
perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ --guestmodules=/home/ymzhang/guest/modules topis very obvious even with a single guest. Now multiply that by more guests ...
If you want to improve this, you need to do the following:
1) Add a userspace daemon that uses vmchannel that runs in the guest and can fetch kallsyms and arbitrary modules. If that daemon lives in tools/perf, that's fine.
2) Add a QMP interface in qemu to interact with such daemon
3) Add a default QMP port in a well known location[1]
4) Modify the perf tool to look for a default QMP port. In the case of a single guest, there's one port. If there are multiple guests, then you will have to connect to each port, find the name or any other identifying information, and let the user choose.
Patches are certainly welcome.
[1] I've written up this patch and will send it out some time today.
Regards,
Anthony Liguori
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 16 lines · Anthony Liguori
Quoted 15 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 5 lines
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
Well, it isn't.
Erm, my usability points are _doubly_ true when there are multiple guests ...
The inconvenience of having to type:
perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ --guestmodules=/home/ymzhang/guest/modules top
Quoted 7 lines
Quoted 1 line
is very obvious even with a single guest. Now multiply that by more guests ...
If you want to improve this, you need to do the following:
1) Add a userspace daemon that uses vmchannel that runs in the guest and can fetch kallsyms and arbitrary modules. If that daemon lives in
tools/perf, that's fine.
Adding any new daemon to an existing guest is a deployment and usability nightmare.
The basic rule of good instrumentation is to be transparent. The moment we have to modify the user-space of a guest just to monitor it, the purpose of transparent instrumentation is defeated.
That was one of the fundamental usability mistakes of Oprofile.
There is no 'perf' daemon - all the perf functionality is _built in_, and for very good reasons. It is one of the main reasons for perf's success as well.
Now Qemu is trying to repeat that stupid mistake ...
So please either suggest a different transparent solution that is technically better than the one i suggested, or you should concede the point really.
Please try think with the heads of our users and developers and dont suggest some weird ivory-tower design that is totally impractical ...
And no, you have to code none of this, we'll do all the coding. The only thing we are asking is for you to not stand in the way of good usability ...
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 23 lines · Ingo Molnar
Quoted 21 lines · Anthony Liguori
Quoted 19 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 6 lines
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
Well, it isn't.
Erm, my usability points are _doubly_ true when there are multiple guests ...
The inconvenience of having to type:
perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ --guestmodules=/home/ymzhang/guest/modules topis very obvious even with a single guest. Now multiply that by more guests ...
Quoted 9 lines
Quoted 6 lines
If you want to improve this, you need to do the following:
1) Add a userspace daemon that uses vmchannel that runs in the guest and can fetch kallsyms and arbitrary modules. If that daemon lives in
tools/perf, that's fine.Adding any new daemon to an existing guest is a deployment and usability nightmare.
Absolutely. In most cases it is not desirable, and you'll find that in a lot of cases it is not even possible - for non-technical reasons. One of the main benefits of virtualization is the ability to manage and see things from the outside.
Quoted 4 lines
The basic rule of good instrumentation is to be transparent. The moment we have to modify the user-space of a guest just to monitor it, the purpose of transparent instrumentation is defeated.
Not to mention Heisenbugs and interference.
Cheers
Antoine
Quoted 24 lines
That was one of the fundamental usability mistakes of Oprofile.
There is no 'perf' daemon - all the perf functionality is
_builtin_, and for very good reasons. It is one of the main reasons for perf's success as well.Now Qemu is trying to repeat that stupid mistake ...
So please either suggest a different transparent solution that is technically better than the one i suggested, or you should concede the point really.
Please try think with the heads of our users and developers and dont suggest some weird ivory-tower design that is totally impractical ...
And no, you have to code none of this, we'll do all the coding. The only thing we are asking is for you to not stand in the way of good usability ...
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 30 lines · Antoine Martin
Quoted 17 lines · Ingo Molnar
Quoted 16 lines · Anthony Liguori
Quoted 15 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 5 lines
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
Well, it isn't.
Erm, my usability points are _doubly_ true when there are multiple guests ...
The inconvenience of having to type:
perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ --guestmodules=/home/ymzhang/guest/modules topis very obvious even with a single guest. Now multiply that by more guests ...
Quoted 8 lines
Quoted 5 lines
If you want to improve this, you need to do the following:
1) Add a userspace daemon that uses vmchannel that runs in the guest and can fetch kallsyms and arbitrary modules. If that daemon lives in
tools/perf, that's fine.Adding any new daemon to an existing guest is a deployment and usability nightmare.
Absolutely. In most cases it is not desirable, and you'll find that in a lot of cases it is not even possible - for non-technical reasons.
Quoted 8 lines
One of the main benefits of virtualization is the ability to manage and see things from the outside.
Quoted 3 lines
The basic rule of good instrumentation is to be transparent. The moment we have to modify the user-space of a guest just to monitor it, the purpose of transparent instrumentation is defeated.
Not to mention Heisenbugs and interference.
Correct.
Frankly, i was surprised (and taken slightly off base) by both Avi and Anthony suggesting such a clearly inferior "add a demon to the guest space" solution. It's a usability and deployment non-starter.
Furthermore, allowing a guest to integrate/mount its files into the host VFS space (which was my suggestion) has many other uses and advantages as well, beyond the instrumentation/symbol-lookup purpose.
So can we please have some resolution here and move on: the KVM maintainers should either suggest a different transparent approach, or should retract the NAK for the solution we suggested.
We very much want to make progress and want to write code, but obviously we cannot code against a maintainer NAK, nor can we code up an inferior solution either.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Ingo Molnar
Frankly, i was surprised (and taken slightly off base) by both Avi and Anthony suggesting such a clearly inferior "add a demon to the guest space" solution. It's a usability and deployment non-starter.
It's only clearly inferior if you ignore every consideration against it. It's definitely not a deployment non-starter, see the tons of daemons that come with any Linux system. The basic ones are installed and enabled automatically during system installation.
Quoted 4 lines
Furthermore, allowing a guest to integrate/mount its files into the host VFS space (which was my suggestion) has many other uses and advantages as well, beyond the instrumentation/symbol-lookup purpose.
Yes. I'm just not sure about the auto-enabling part.
Quoted 4 lines
So can we please have some resolution here and move on: the KVM maintainers should either suggest a different transparent approach, or should retract the NAK for the solution we suggested.
So long as you define 'transparent' as in 'only the guest kernel is involved' or even 'only the guest and host kernels are involved' we aren't going to make a lot of progress. I oppose shoving random bits of functionality into the kernel, especially things that are in daily use. While us developers do and will use profiling extensively, it doesn't need sit in every guest's non-swappable .text.
Quoted 4 lines
We very much want to make progress and want to write code, but obviously we cannot code against a maintainer NAK, nor can we code up an inferior solution either.
You haven't heard any NAKs, only objections. If we discuss things perhaps we can achieve something that works for everyone. If we keep turning the flames higher that's unlikely.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Frankly, i was surprised (and taken slightly off base) by both Avi and Anthony suggesting such a clearly inferior "add a demon to the guest space" solution. It's a usability and deployment non-starter.
It's only clearly inferior if you ignore every consideration against it. It's definitely not a deployment non-starter, see the tons of daemons that come with any Linux system. [...]
Avi, please dont put arguments into my mouth that i never made.
My (clearly expressed) argument was that:
_a new guest-side demon is a transparent instrumentation non-starter_
What is so hard to understand about that simple concept? Instrumentation is good if it's as transparent as possible.
Of course lots of other features can be done via a new user-space package ...
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Frankly, i was surprised (and taken slightly off base) by both Avi and Anthony suggesting such a clearly inferior "add a demon to the guest space" solution. It's a usability and deployment non-starter.
Quoted 6 lines
Quoted 4 lines
It's only clearly inferior if you ignore every consideration against it. It's definitely not a deployment non-starter, see the tons of daemons that come with any Linux system. [...]
Avi, please dont put arguments into my mouth that i never made.
Sorry, that was not the intent. I meant that putting things into the kernel have disadvantages that must be considered.
Quoted 9 lines
My (clearly expressed) argument was that:
_a new guest-side demon is a transparent instrumentation non-starter_
What is so hard to understand about that simple concept? Instrumentation is good if it's as transparent as possible.
Of course lots of other features can be done via a new user-space package ...
I believe you can deploy this daemon via a (default) package, without any hassle to users.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 13 lines · Ingo Molnar
Quoted 10 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Frankly, i was surprised (and taken slightly off base) by both Avi and Anthony suggesting such a clearly inferior "add a demon to the guest space" solution. It's a usability and deployment non-starter.
It's only clearly inferior if you ignore every consideration against it. It's definitely not a deployment non-starter, see the tons of daemons that come with any Linux system. [...]
Quoted 6 lines
Avi, please dont put arguments into my mouth that i never made.
My (clearly expressed) argument was that:
_a new guest-side demon is a transparent instrumentation non-starter_
FWIW, there's no reason you couldn't consume a vmchannel port from within the kernel. I don't think the code needs to be in the kernel and from a security PoV, that suggests that it should be in userspace IMHO.
But if you want to make a kernel thread, knock yourself out. I have no objection to that from a qemu perspective. I can't see why Avi would mind either. I think it's papering around another problem (the kernel should control initrds IMHO) but that's a different topic.
Regards,
Anthony Liguori
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 4 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
The logical conclusion of that is that everything should be built into the kernel. Where a failure brings the system down or worse. Where you have to bear the memory footprint whether you ever use the functionality or not. Where to update the functionality you need to deploy a new kernel (possibly introducing unrelated bugs) and reboot.
If userspace daemons are such a deployment and usability nightmare, maybe we should fix that instead.
Quoted 4 lines
The basic rule of good instrumentation is to be transparent. The moment we have to modify the user-space of a guest just to monitor it, the purpose of transparent instrumentation is defeated.
You have to modify the guest anyway by deploying a new kernel.
Quoted 3 lines
Please try think with the heads of our users and developers and dont suggest some weird ivory-tower design that is totally impractical ...
inetd.d style 'drop a listener config here and it will be executed on connection' should work. The listener could come with the kernel package, though I don't think it's a good idea. module-init-tools doesn't and people have survived somehow.
Quoted 3 lines
And no, you have to code none of this, we'll do all the coding. The only thing we are asking is for you to not stand in the way of good usability ...
Thanks.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
Quoted 8 lines
The logical conclusion of that is that everything should be built into the kernel. Where a failure brings the system down or worse. Where you have to bear the memory footprint whether you ever use the functionality or not. Where to update the functionality you need to deploy a new kernel (possibly introducing unrelated bugs) and reboot.
If userspace daemons are such a deployment and usability nightmare, maybe we should fix that instead.
Which userspace? Deploying *anything* in the guest can be a nightmare, including paravirt drivers if you don't have a natively supported in the OS virtual hardware backoff. Deploying things in the host OTOH is business as usual.
And you're smart enough to know that.
OG.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 14 lines · Olivier Galibert
Quoted 12 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
The logical conclusion of that is that everything should be built into the kernel. Where a failure brings the system down or worse. Where you have to bear the memory footprint whether you ever use the functionality or not. Where to update the functionality you need to deploy a new kernel (possibly introducing unrelated bugs) and reboot.
Quoted 6 lines
Quoted 3 lines
If userspace daemons are such a deployment and usability nightmare, maybe we should fix that instead.
Which userspace? Deploying *anything* in the guest can be a nightmare, including paravirt drivers if you don't have a natively supported in the OS virtual hardware backoff.
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
Quoted 3 lines
Deploying things in the
host OTOH is business as usual.
True.
Quoted 2 lines
And you're smart enough to know that.
Thanks.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Olivier GalibertQuoted 14 lines · Olivier Galibert
Quoted 12 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
The logical conclusion of that is that everything should be built into the kernel. Where a failure brings the system down or worse. Where you have to bear the memory footprint whether you ever use the functionality or not. Where to update the functionality you need to deploy a new kernel (possibly introducing unrelated bugs) and reboot.
Quoted 6 lines
Quoted 3 lines
If userspace daemons are such a deployment and usability nightmare, maybe we should fix that instead.
Which userspace? Deploying *anything* in the guest can be a nightmare, including paravirt drivers if you don't have a natively supported in the OS virtual hardware backoff.
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
Quoted 3 lines
Deploying things in the
host OTOH is business as usual.
True.
Quoted 2 lines
And you're smart enough to know that.
Thanks.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Olivier Galibert
Quoted 10 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
The logical conclusion of that is that everything should be built into the kernel. Where a failure brings the system down or worse. Where you have to bear the memory footprint whether you ever use the functionality or not. Where to update the functionality you need to deploy a new kernel (possibly introducing unrelated bugs) and reboot.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
If userspace daemons are such a deployment and usability nightmare, maybe we should fix that instead.
Which userspace? Deploying *anything* in the guest can be a nightmare, including paravirt drivers if you don't have a natively supported in the OS virtual hardware backoff.
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
That's not always true.
The host admin can control the guest kernel via "kvm -kernel" easily enough, but he may or may not have access to the disk that is used in the guest. (think encrypted disks, service agreements, etc)
Antoine
Quoted 9 lines
Quoted 2 lines
Deploying things in the
host OTOH is business as usual.True.
Quoted 1 line
And you're smart enough to know that.
Thanks.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 4 lines · Antoine Martin
Quoted 1 line
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
That's not always true.
The host admin can control the guest kernel via "kvm -kernel" easily enough, but he may or may not have access to the disk that is used in the guest. (think encrypted disks, service agreements, etc)
There is a matching -initrd argument that you can use to launch a daemon. I believe that -kernel use will be rare, though. It's a lot easier to keep everything in one filesystem.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Avi Kivity
Quoted 4 lines · Antoine Martin
Quoted 1 line
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
That's not always true.
The host admin can control the guest kernel via "kvm -kernel" easily enough, but he may or may not have access to the disk that is used in the guest. (think encrypted disks, service agreements, etc)There is a matching -initrd argument that you can use to launch a daemon.
I thought this discussion was about making it easy to deploy... and generating a custom initrd isn't easy by any means, and it requires access to the guest filesystem (and its mkinitrd tools).
Quoted 2 lines
I believe that -kernel use will be rare, though. It's a lot easier
to keep everything in one filesystem.
Well, for what it's worth, I rarely ever use anything else. My virtual disks are raw so I can loop mount them easily, and I can also switch my guest kernels from outside... without ever needing to mount those disks.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Antoine Martin
Quoted 7 lines · Avi Kivity
Quoted 4 lines · Antoine Martin
Quoted 1 line
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
That's not always true.
The host admin can control the guest kernel via "kvm -kernel" easily enough, but he may or may not have access to the disk that is used in the guest. (think encrypted disks, service agreements, etc)There is a matching -initrd argument that you can use to launch a daemon.
I thought this discussion was about making it easy to deploy... and generating a custom initrd isn't easy by any means, and it requires access to the guest filesystem (and its mkinitrd tools).
That's true. You need to run mkinitrd anyway, though, unless your guest is non-modular and non-lvm.
Quoted 3 lines
Quoted 2 lines
I believe that -kernel use will be rare, though. It's a lot easier
to keep everything in one filesystem.Well, for what it's worth, I rarely ever use anything else. My virtual disks are raw so I can loop mount them easily, and I can also switch my guest kernels from outside... without ever needing to mount those disks.
Curious, what do you use them for?
btw, if you build your kernel outside the guest, then you already have access to all its symbols, without needing anything further.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Avi Kivity
Quoted 3 lines
Well, for what it's worth, I rarely ever use anything else. My virtual disks are raw so I can loop mount them easily, and I can also switch my guest kernels from outside... without ever needing to mount those disks.
Curious, what do you use them for?
btw, if you build your kernel outside the guest, then you already have access to all its symbols, without needing anything further.
There's two errors with your argument:
1) you are assuming that it's only about kernel symbols
Look at this 'perf report' output:
# Samples: 7127509216
#
# Overhead Command Shared Object Symbol
# ........ .......... ............................. ......
#
19.14% git git [.] lookup_object
15.16% perf git [.] lookup_object
4.74% perf libz.so.1.2.3 [.] inflate
4.52% git libz.so.1.2.3 [.] inflate
4.21% perf libz.so.1.2.3 [.] inflate_table
3.94% git libz.so.1.2.3 [.] inflate_table
3.29% git git [.] find_pack_entry_one
3.24% git libz.so.1.2.3 [.] inflate_fast
2.96% perf libz.so.1.2.3 [.] inflate_fast
2.96% git git [.] decode_tree_entry
2.80% perf libc-2.11.90.so [.] __strlen_sse42
2.56% git libc-2.11.90.so [.] __strlen_sse42
1.98% perf libc-2.11.90.so [.] __GI_memcpy
1.71% perf git [.] decode_tree_entry
1.53% git libc-2.11.90.so [.] __GI_memcpy
1.48% git git [.] lookup_blob
1.30% git git [.] process_tree
1.30% perf git [.] process_tree
0.90% perf git [.] tree_entry
0.82% perf git [.] lookup_blob
0.78% git [kernel.kallsyms] [k] kstat_irqs_cpukernel symbols are only a small portion of the symbols. (a single line in this case)
To get to those other symbols we have to read the ELF symbols of those binaries in the guest filesystem, in the post-processing/reporting phase. This is both complex to do and relatively slow so we dont want to (and cannot) do this at sample time from IRQ context or NMI context ...
Also, many aspects of reporting are interactive so it's done lazily or on-demand. So we need ready access to the guest filesystem - for those guests which decide to integrate with the host for this.
2) the 'SystemTap mistake'
You are assuming that the symbols of the kernel when it got built got saved properly and are discoverable easily. In reality those symbols can be erased by a make clean, can be modified by a new build, can be misplaced and can generally be hard to find because each distro puts them in a different installation path.
My 10+ years experience with kernel instrumentation solutions is that kernel-driven, self-sufficient, robust, trustable, well-enumerated sources of information work far better in practice.
The thing is, in this thread i'm forced to repeat the same basic facts again and again. Could you _PLEASE_, pretty please, when it comes to instrumentation details, at least _read the mails_ of the guys who actually ... write and maintain Linux instrumentation code? This is getting ridiculous really.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 45 lines · Ingo Molnar
Quoted 9 lines · Avi Kivity
Quoted 4 lines
Well, for what it's worth, I rarely ever use anything else. My virtual disks are raw so I can loop mount them easily, and I can also switch my guest kernels from outside... without ever needing to mount those disks.
Curious, what do you use them for?
btw, if you build your kernel outside the guest, then you already have access to all its symbols, without needing anything further.
There's two errors with your argument:
1) you are assuming that it's only about kernel symbols
Look at this 'perf report' output:
# Samples: 7127509216
#
# Overhead Command Shared Object Symbol# ........ .......... ............................. ...... # 19.14% git git [.] lookup_object 15.16% perf git [.] lookup_object 4.74% perf libz.so.1.2.3 [.] inflate 4.52% git libz.so.1.2.3 [.] inflate 4.21% perf libz.so.1.2.3 [.] inflate_table 3.94% git libz.so.1.2.3 [.] inflate_table 3.29% git git [.] find_pack_entry_one 3.24% git libz.so.1.2.3 [.] inflate_fast 2.96% perf libz.so.1.2.3 [.] inflate_fast 2.96% git git [.] decode_tree_entry 2.80% perf libc-2.11.90.so [.] __strlen_sse42 2.56% git libc-2.11.90.so [.] __strlen_sse42 1.98% perf libc-2.11.90.so [.] __GI_memcpy 1.71% perf git [.] decode_tree_entry 1.53% git libc-2.11.90.so [.] __GI_memcpy 1.48% git git [.] lookup_blob 1.30% git git [.] process_tree 1.30% perf git [.] process_tree 0.90% perf git [.] tree_entry 0.82% perf git [.] lookup_blob 0.78% git [kernel.kallsyms] [k] kstat_irqs_cpu
Quoted 8 lines
kernel symbols are only a small portion of the symbols. (a single line in this case)
To get to those other symbols we have to read the ELF symbols of those binaries in the guest filesystem, in the post-processing/reporting phase. This is both complex to do and relatively slow so we dont want to (and cannot) do this at sample time from IRQ context or NMI context ...
Okay. So a symbol server is necessary. Still, I don't think -kernel is a good reason for including the symbol server in the kernel itself. If someone uses it extensively together with perf, _and_ they can't put the symbol server in the guest for some reason, let them patch mkinitrd to include it.
Quoted 12 lines
Also, many aspects of reporting are interactive so it's done lazily or on-demand. So we need ready access to the guest filesystem - for those guests which decide to integrate with the host for this.
2) the 'SystemTap mistake'
You are assuming that the symbols of the kernel when it got built got saved properly and are discoverable easily. In reality those symbols can be erased by a make clean, can be modified by a new build, can be misplaced and can generally be hard to find because each distro puts them in a different installation path.
Quoted 4 lines
My 10+ years experience with kernel instrumentation solutions is that kernel-driven, self-sufficient, robust, trustable, well-enumerated sources of information work far better in practice.
What about line number information? And the source? Into the kernel with them as well?
Quoted 5 lines
The thing is, in this thread i'm forced to repeat the same basic facts again and again. Could you _PLEASE_, pretty please, when it comes to instrumentation details, at least
_readthemails_of the guys who actually ... write and maintain Linux instrumentation code? This is getting ridiculous really.
I've read every one of your emails. If I misunderstood or overlooked something, I apologize. The thread is very long and at times antagonistic so it's hard to keep all the details straight.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Avi Kivity
Quoted 3 lines
My 10+ years experience with kernel instrumentation solutions is that kernel-driven, self-sufficient, robust, trustable, well-enumerated sources of information work far better in practice.
What about line number information? And the source? Into the kernel with them as well?
Sigh. Please read the _very first_ suggestion i made, which solves all that. I rarely go into discussions without suggesting technical solutions - i'm not interested in flaming, i'm interested in real solutions.
Here it is, repeated for the Nth time:
Allow a guest to (optionally) integrate its VFS namespace with the host side as well. An example scheme would be:
/guests/Fedora-G1/
/guests/Fedora-G1/proc/
/guests/Fedora-G1/usr/
/guests/Fedora-G1/.../
/guests/OpenSuse-G2/
/guests/OpenSuse-G2/proc/
/guests/OpenSuse-G2/usr/
/guests/OpenSuse-G2/.../
( This feature would be configurable and would be default-off, to maintain
the current status quo. )
Line number information and the source (dwarf info) and ELF symbols are all provided and accessible via such an interface - no need to run any 'symbol demon' on the guest side.
And, obviously, having the guest VFS namespace (optionally) available on the host side also has far more uses than perf's symbol needs.
I was surprised no-one ever came up with such a suggestion - it is so obvious to allow the integration of the VFS namespaces. But given your explicit declaration of your KVM desktop usability indifference i'm kind of not surprised about that anymore.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 21 lines · Ingo Molnar
Quoted 2 lines
What about line number information? And the source? Into the kernel with them as well?
Sigh. Please read the
_veryfirst_suggestion i made, which solves all that. I rarely go into discussions without suggesting technical solutions - i'm not interested in flaming, i'm interested in real solutions.Here it is, repeated for the Nth time:
Allow a guest to (optionally) integrate its VFS namespace with the host side as well. An example scheme would be:
/guests/Fedora-G1/
/guests/Fedora-G1/proc/
/guests/Fedora-G1/usr/
/guests/Fedora-G1/.../
/guests/OpenSuse-G2/
/guests/OpenSuse-G2/proc/
/guests/OpenSuse-G2/usr/
/guests/OpenSuse-G2/.../
Quoted 2 lines
( This feature would be configurable and would be default-off, to maintain the current status quo. )
Heh, funny. That would also solve my number one gripe with virtualization these days: how to get files in and out of guests without having to install extra packages on the guest side and fiddling with mount points on every single guest image I want to play with.
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 22 lines · Pekka Enberg
Quoted 21 lines · Ingo Molnar
Quoted 2 lines
What about line number information? And the source? Into the kernel with them as well?
Sigh. Please read the
_veryfirst_suggestion i made, which solves all that. I rarely go into discussions without suggesting technical solutions - i'm not interested in flaming, i'm interested in real solutions.Here it is, repeated for the Nth time:
Allow a guest to (optionally) integrate its VFS namespace with the host side as well. An example scheme would be:
/guests/Fedora-G1/
/guests/Fedora-G1/proc/
/guests/Fedora-G1/usr/
/guests/Fedora-G1/.../
/guests/OpenSuse-G2/
/guests/OpenSuse-G2/proc/
/guests/OpenSuse-G2/usr/
/guests/OpenSuse-G2/.../
Quoted 8 lines
Quoted 2 lines
( This feature would be configurable and would be default-off, to maintain the current status quo. )
Heh, funny. That would also solve my number one gripe with virtualization these days: how to get files in and out of guests without having to install extra packages on the guest side and fiddling with mount points on every single guest image I want to play with.
FYI, for offline guests, you can use libguestfs[1] to access & change files inside the guest, and read-only access to running guests files. It provides access via a interactive shell, APIs in all major languages, and also has a FUSE mdule to expose it directly in the host VFS. It could probably be made to work read-write for running guests too if its agent were installed inside the guest & leverage the new Virtio-Serial channel for comms (avoiding any network setup requirements).
Regards,
Daniel
Signature · 4 lines
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Hi Daniel,
(I'm getting slightly off-topic, sorry about that.)
Daniel P. Berrange kirjoitti:
Quoted 22 lines
Quoted 14 lines
Quoted 14 lines
Here it is, repeated for the Nth time:
Allow a guest to (optionally) integrate its VFS namespace with the host side as well. An example scheme would be:
/guests/Fedora-G1/
/guests/Fedora-G1/proc/
/guests/Fedora-G1/usr/
/guests/Fedora-G1/.../
/guests/OpenSuse-G2/
/guests/OpenSuse-G2/proc/
/guests/OpenSuse-G2/usr/
/guests/OpenSuse-G2/.../Quoted 7 lines
Quoted 2 lines
( This feature would be configurable and would be default-off, to maintain
the current status quo. )Heh, funny. That would also solve my number one gripe with virtualization these days: how to get files in and out of guests without having to install extra packages on the guest side and fiddling with mount points on every single guest image I want to play with.
Quoted 7 lines
FYI, for offline guests, you can use libguestfs[1] to access & change files inside the guest, and read-only access to running guests files. It provides access via a interactive shell, APIs in all major languages, and also has a FUSE mdule to expose it directly in the host VFS. It could probably be made to work read-write for running guests too if its agent were installed inside the guest & leverage the new Virtio-Serial channel for comms (avoiding any network setup requirements).
Right. Thanks for the pointer.
The use case I am thinking of is working on an userspace project and wanting to test a piece of code on multiple distributions before pushing it out. That pretty much means being able to pull from the host git repository (or push to the guest repo) while the guest is running, maybe changing the code a bit and then getting the changes back to the host for the final push.
What I do now is I push the changes on the host side to a (private) remote branch and do the work through that. But that's pretty lame workaround in my opinion.
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Daniel P. BerrangeQuoted 39 lines · Daniel P. Berrange
Quoted 22 lines · Pekka Enberg
Quoted 21 lines · Ingo Molnar
Quoted 2 lines
What about line number information? ?And the source? ?Into the kernel with them as well?
Sigh. Please read the
_veryfirst_suggestion i made, which solves all that. I rarely go into discussions without suggesting technical solutions - i'm not interested in flaming, i'm interested in real solutions.Here it is, repeated for the Nth time:
Allow a guest to (optionally) integrate its VFS namespace with the host side as well. An example scheme would be:
? /guests/Fedora-G1/
? /guests/Fedora-G1/proc/
? /guests/Fedora-G1/usr/
? /guests/Fedora-G1/.../
? /guests/OpenSuse-G2/
? /guests/OpenSuse-G2/proc/
? /guests/OpenSuse-G2/usr/
? /guests/OpenSuse-G2/.../Quoted 7 lines
Quoted 2 lines
?( This feature would be configurable and would be default-off, to maintain ? ?the current status quo. )
Heh, funny. That would also solve my number one gripe with virtualization these days: how to get files in and out of guests without having to install extra packages on the guest side and fiddling with mount points on every single guest image I want to play with.
FYI, for offline guests, you can use libguestfs[1] to access & change files inside the guest, and read-only access to running guests files. It provides access via a interactive shell, APIs in all major languages, and also has a FUSE mdule to expose it directly in the host VFS. It could probably be made to work read-write for running guests too if its agent were installed inside the guest & leverage the new Virtio-Serial channel for comms (avoiding any network setup requirements).
Quoted 4 lines
Regards,
Daniel
Yes, this is the kind of functionality i'm suggesting.
I'd suggest a different implementation for live guests: to drive this from within the live guest side of KVM, i.e. basically a paravirt driver for guestfs. You'd pass file API guests to the guest directly, via the KVM ioctl or so - and get responses from the guest.
That will give true read-write access and completely coherent (and still transparent) VFS integration, with no host-side knowledge needed for the guest's low level (raw) filesystem structure. That's a big advantage.
Yes, it needs an 'aware' guest kernel - but that is a one-off transition overhead whose cost is zero in the long run. (i.e. all KVM kernels beyond a given version would have this ability - otherwise it's guest side distribution transparent)
Even 'offline' read-only access could be implemented by booting a minimal kernel via qemu -kernel and using a 'ro' boot option. That way you could eliminate all lowlevel filesystem knowledge from libguestfs. You could run ext4 or btrfs guest filesystems and FAT ones as well - with no restriction.
This would allow 'offline' access to Windows images as well: a FAT or ntfs enabled mini-kernel could be booted in read-only mode.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 32 lines · Ingo Molnar
Quoted 9 lines · Daniel P. Berrange
FYI, for offline guests, you can use libguestfs[1] to access & change files inside the guest, and read-only access to running guests files. It provides access via a interactive shell, APIs in all major languages, and also has a FUSE mdule to expose it directly in the host VFS. It could probably be made to work read-write for running guests too if its agent were installed inside the guest & leverage the new Virtio-Serial channel for comms (avoiding any network setup requirements).
Quoted 4 lines
Regards,
DanielYes, this is the kind of functionality i'm suggesting.
I'd suggest a different implementation for live guests: to drive this from within the live guest side of KVM, i.e. basically a paravirt driver for guestfs. You'd pass file API guests to the guest directly, via the KVM ioctl or so - and get responses from the guest.
That will give true read-write access and completely coherent (and still transparent) VFS integration, with no host-side knowledge needed for the guest's low level (raw) filesystem structure. That's a big advantage.
Yes, it needs an 'aware' guest kernel - but that is a one-off transition overhead whose cost is zero in the long run. (i.e. all KVM kernels beyond a given version would have this ability - otherwise it's guest side distribution transparent)
Quoted 7 lines
Even 'offline' read-only access could be implemented by booting a minimal kernel via qemu -kernel and using a 'ro' boot option. That way you could eliminate all lowlevel filesystem knowledge from libguestfs. You could run ext4 or btrfs guest filesystems and FAT ones as well - with no restriction.
This would allow 'offline' access to Windows images as well: a FAT or ntfs enabled mini-kernel could be booted in read-only mode.
This is close to the way libguestfs already works. It boots QEMU/KVM pointing to a minimal stripped down appliance linux OS image, containing a small agent it talks to over some form of vmchannel/serial/virtio-serial device. Thus the kernel in the appliance it runs is the only thing that needs to know about the filesystem/lvm/dm on-disk formats - libguestfs definitely does not want to be duplicating this detailed knowledge of on disk format itself. It is doing full read-write access to the guest filesystem in offline mode - one of the major use cases is disaster recovery from a unbootable guest OS image.
Regards,
Daniel
Signature · 4 lines
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Daniel P. Berrange
This is close to the way libguestfs already works. It boots QEMU/KVM pointing to a minimal stripped down appliance linux OS image, containing a small agent it talks to over some form of vmchannel/serial/virtio-serial device. Thus the kernel in the appliance it runs is the only thing that needs to know about the filesystem/lvm/dm on-disk formats - libguestfs definitely does not want to be duplicating this detailed knowledge of on disk format itself. It is doing full read-write access to the guest filesystem in offline mode - one of the major use cases is disaster recovery from a unbootable guest OS image.
As Dan said, the 'daemon' part is separate and could be run as a standard part of a guest install, talking over vmchannel to the host. The only real issue I can see is adding access control to the daemon (currently it doesn't need it and doesn't do any). Doing it this way you'd be leveraging the ~250,000 lines of existing libguestfs code, bindings in multiple languages, tools etc.
Rich.
Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 10 lines · Richard W.M. Jones
Quoted 8 lines · Daniel P. Berrange
This is close to the way libguestfs already works. It boots QEMU/KVM pointing to a minimal stripped down appliance linux OS image, containing a small agent it talks to over some form of vmchannel/serial/virtio-serial device. Thus the kernel in the appliance it runs is the only thing that needs to know about the filesystem/lvm/dm on-disk formats - libguestfs definitely does not want to be duplicating this detailed knowledge of on disk format itself. It is doing full read-write access to the guest filesystem in offline mode - one of the major use cases is disaster recovery from a unbootable guest OS image.
Quoted 6 lines
As Dan said, the 'daemon' part is separate and could be run as a standard part of a guest install, talking over vmchannel to the host. The only real issue I can see is adding access control to the daemon (currently it doesn't need it and doesn't do any). Doing it this way you'd be leveraging the ~250,000 lines of existing libguestfs code, bindings in multiple languages, tools etc.
I think it would be a nice option to allow such guest-side "daemon's" to be executed in the guest context without _any_ guest-side support.
This would be possible by building such minimal daemons that use vmchannel, and which are built for generic x86 (maybe even built for 32-bit x86 so that they can run on any x86 distro). They could execute as the init task of any guest kernel - Qemu could 'blend in / replace' the binary as the init task of the guest temporarily - and some simple bootstrap code could then start the daemon and start the real init binary (and turn off the 'blending' of the init task).
That way any guest could be extended via such Qemu functionality - even without any kernel changes. Has anyone thought about (or coded) such a solution perhaps?
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Richard W.M. JonesQuoted 10 lines · Richard W.M. Jones
Quoted 8 lines · Daniel P. Berrange
This is close to the way libguestfs already works. It boots QEMU/KVM pointing to a minimal stripped down appliance linux OS image, containing a small agent it talks to over some form of vmchannel/serial/virtio-serial device. Thus the kernel in the appliance it runs is the only thing that needs to know about the filesystem/lvm/dm on-disk formats - libguestfs definitely does not want to be duplicating this detailed knowledge of on disk format itself. It is doing full read-write access to the guest filesystem in offline mode - one of the major use cases is disaster recovery from a unbootable guest OS image.
Quoted 6 lines
As Dan said, the 'daemon' part is separate and could be run as a standard part of a guest install, talking over vmchannel to the host. The only real issue I can see is adding access control to the daemon (currently it doesn't need it and doesn't do any). Doing it this way you'd be leveraging the ~250,000 lines of existing libguestfs code, bindings in multiple languages, tools etc.
I think we don't need per-guest-file access control. Probably we could apply the image-file permissions to all guestfs files. This would cover the usecases:
* perf for reading symbol information (needs ro-access only anyway)
* Desktop like host<->guest file copy
I have not looked into libguestfs yet but I guess this approach is easier to achieve.
Joerg
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Daniel P. BerrangeQuoted 38 lines · Daniel P. Berrange
Quoted 37 lines · Ingo Molnar
Quoted 9 lines · Daniel P. Berrange
FYI, for offline guests, you can use libguestfs[1] to access & change files inside the guest, and read-only access to running guests files. It provides access via a interactive shell, APIs in all major languages, and also has a FUSE mdule to expose it directly in the host VFS. It could probably be made to work read-write for running guests too if its agent were installed inside the guest & leverage the new Virtio-Serial channel for comms (avoiding any network setup requirements).
Quoted 4 lines
Regards,
DanielYes, this is the kind of functionality i'm suggesting.
I'd suggest a different implementation for live guests: to drive this from within the live guest side of KVM, i.e. basically a paravirt driver for guestfs. You'd pass file API guests to the guest directly, via the KVM ioctl or so - and get responses from the guest.
That will give true read-write access and completely coherent (and still transparent) VFS integration, with no host-side knowledge needed for the guest's low level (raw) filesystem structure. That's a big advantage.
Yes, it needs an 'aware' guest kernel - but that is a one-off transition overhead whose cost is zero in the long run. (i.e. all KVM kernels beyond a given version would have this ability - otherwise it's guest side distribution transparent)
Even 'offline' read-only access could be implemented by booting a minimal kernel via qemu -kernel and using a 'ro' boot option. That way you could eliminate all lowlevel filesystem knowledge from libguestfs. You could run ext4 or btrfs guest filesystems and FAT ones as well - with no restriction.
Quoted 4 lines
Quoted 2 lines
This would allow 'offline' access to Windows images as well: a FAT or ntfs enabled mini-kernel could be booted in read-only mode.
This is close to the way libguestfs already works. [...]
[ Oops, you are right - sorry for not looking more closely! I was confused by
the 'read only' aspect. ]
Quoted 8 lines
[...] It boots QEMU/KVM pointing to a minimal stripped down appliance linux OS image, containing a small agent it talks to over some form of vmchannel/serial/virtio-serial device. Thus the kernel in the appliance it runs is the only thing that needs to know about the filesystem/lvm/dm on-disk formats - libguestfs definitely does not want to be duplicating this detailed knowledge of on disk format itself. It is doing full read-write access to the guest filesystem in offline mode - one of the major use cases is disaster recovery from a unbootable guest OS image.
Just curious: any plans to extend this to include live read/write access as well?
I.e. to have the 'agent' (guestfsd) running universally, so that tools such as perf and by users could rely on the VFS integration as well, not just disaster recovery tools?
Without universal access to this feature it's not adequate for instrumentation purposes.
One option to achieve that would be to extend Qemu to allow 'qemu daemons' to run on the (Linux) guest side. These would be statically linked binaries that can run on any Linux system, and which could provide various built-in Qemu functionality from the guest side to the host side.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Ingo Molnar
Just curious: any plans to extend this to include live read/write access as well?
I.e. to have the 'agent' (guestfsd) running universally, so that tools such as perf and by users could rely on the VFS integration as well, not just disaster recovery tools?
Totally. That's not to say there is a definite plan, but we're very open to doing this. We already wrote the daemon in such a way that it doesn't require the appliance part, but could run inside any existing guest (we've even ported bits of it to Windoze ...).
The only remaining issue is how access control would be handled. You obviously wouldn't want anything in the host that can get access to the vmchannel socket to start sending destructive write commands into guests.
Rich.
Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Richard W.M. Jones
Quoted 6 lines · Ingo Molnar
Just curious: any plans to extend this to include live read/write access as well?
I.e. to have the 'agent' (guestfsd) running universally, so that tools such as perf and by users could rely on the VFS integration as well, not just disaster recovery tools?
Quoted 8 lines
Totally. That's not to say there is a definite plan, but we're very open to doing this. We already wrote the daemon in such a way that it doesn't require the appliance part, but could run inside any existing guest (we've even ported bits of it to Windoze ...).
The only remaining issue is how access control would be handled. You obviously wouldn't want anything in the host that can get access to the vmchannel socket to start sending destructive write commands into guests.
By default i'd suggest to put it into a maximally restricted mount point. I.e. restrict access to only the security context running libguestfs or so.
( Which in practice will be the user starting the guest, so there will be
proper protection from other users while still allowing easy access to the user that has access already. )
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 14 lines · Ingo Molnar
Quoted 7 lines · Avi Kivity
Quoted 4 lines
My 10+ years experience with kernel instrumentation solutions is that kernel-driven, self-sufficient, robust, trustable, well-enumerated sources of information work far better in practice.
What about line number information? And the source? Into the kernel with them as well?
Sigh. Please read the
_veryfirst_suggestion i made, which solves all that. I rarely go into discussions without suggesting technical solutions - i'm not interested in flaming, i'm interested in real solutions.
Quoted 7 lines
Here it is, repeated for the Nth time:
Allow a guest to (optionally) integrate its VFS namespace with the host side as well. An example scheme would be:
/guests/Fedora-G1/
[...]
You're missing something. This sub-thread is about someone launching a kernel with 'qemu -kernel', the kernel lives outside the guest disk image, they don't want a custom initrd because it's hard to make.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Avi Kivity
Quoted 6 lines
Here it is, repeated for the Nth time:
Allow a guest to (optionally) integrate its VFS namespace with the host side
as well. An example scheme would be:
Quoted 8 lines
Quoted 2 lines
/guests/Fedora-G1/
[...]
You're missing something. This sub-thread is about someone launching a kernel with 'qemu -kernel', the kernel lives outside the guest disk image, they don't want a custom initrd because it's hard to make.
Well, you know, I am missing your point here about initrd. Surely the guest kernels need to use sys_mount() at some point at which time they could just tell the host kernel where they can find the mount points? But maybe we're not talking about that kind of scenario here?
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 44 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 3 lines
Well, for what it's worth, I rarely ever use anything else. My virtual disks are raw so I can loop mount them easily, and I can also switch my guest kernels from outside... without ever needing to mount those disks.
Curious, what do you use them for?
btw, if you build your kernel outside the guest, then you already have access to all its symbols, without needing anything further.
There's two errors with your argument:
1) you are assuming that it's only about kernel symbols
Look at this 'perf report' output:
# Samples: 7127509216
#
# Overhead Command Shared Object Symbol# ........ .......... ............................. ...... # 19.14% git git [.] lookup_object 15.16% perf git [.] lookup_object 4.74% perf libz.so.1.2.3 [.] inflate 4.52% git libz.so.1.2.3 [.] inflate 4.21% perf libz.so.1.2.3 [.] inflate_table 3.94% git libz.so.1.2.3 [.] inflate_table 3.29% git git [.] find_pack_entry_one 3.24% git libz.so.1.2.3 [.] inflate_fast 2.96% perf libz.so.1.2.3 [.] inflate_fast 2.96% git git [.] decode_tree_entry 2.80% perf libc-2.11.90.so [.] __strlen_sse42 2.56% git libc-2.11.90.so [.] __strlen_sse42 1.98% perf libc-2.11.90.so [.] __GI_memcpy 1.71% perf git [.] decode_tree_entry 1.53% git libc-2.11.90.so [.] __GI_memcpy 1.48% git git [.] lookup_blob 1.30% git git [.] process_tree 1.30% perf git [.] process_tree 0.90% perf git [.] tree_entry 0.82% perf git [.] lookup_blob 0.78% git [kernel.kallsyms] [k] kstat_irqs_cpu
Quoted 2 lines
kernel symbols are only a small portion of the symbols. (a single line in this case)
Above example shows perf could summarize both kernel and application hot functions. If we collect guest os statistics from host side, we can't summarize detailed guest os application info because we couldn't get guest os's application process id from host side. So we could only get detailed kernel info and the total utilization percent of guest application processes.
Quoted 9 lines
To get to those other symbols we have to read the ELF symbols of those binaries in the guest filesystem, in the post-processing/reporting phase. This is both complex to do and relatively slow so we dont want to (and cannot) do this at sample time from IRQ context or NMI context ...
Also, many aspects of reporting are interactive so it's done lazily or on-demand. So we need ready access to the guest filesystem - for those guests which decide to integrate with the host for this.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi Kivity[snip]
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
I believe that -kernel use will be rare, though. It's a lot
easier to keep everything in one filesystem.Well, for what it's worth, I rarely ever use anything else. My virtual disks are raw so I can loop mount them easily, and I can also switch my guest kernels from outside... without ever needing to mount those disks.
Curious, what do you use them for?
Various things, here is one use case which I think is under-used: read-only virtual disks with just one network application on them (no runlevels, sshd, user accounts, etc), a hell of a lot easier to maintain and secure than a full blown distro. Want a new kernel? boot a new VM and swap it for the old one with zero downtime (if your network app supports this sort of hot-swap - which a lot of cluster apps do)
Another reason for wanting to keep the kernel outside is to limit the potential points of failure: remove the partition table, remove the bootloader, remove even the ramdisk. Also makes it easier to switch to another solution (say UML) or another disk driver (as someone mentioned previously). In virtualized environments I often prefer to remove the ability to load kernel modules too, for obvious reasons.
Hope this helps.
Antoine
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityQuoted 12 lines · Avi Kivity
Quoted 11 lines · Olivier Galibert
Quoted 10 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
The logical conclusion of that is that everything should be built into the kernel. Where a failure brings the system down or worse. Where you have to bear the memory footprint whether you ever use the functionality or not. Where to update the functionality you need to deploy a new kernel (possibly introducing unrelated bugs) and reboot.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
If userspace daemons are such a deployment and usability nightmare, maybe we should fix that instead.
Which userspace? Deploying *anything* in the guest can be a nightmare, including paravirt drivers if you don't have a natively supported in the OS virtual hardware backoff.
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
Note that with perf we can instrument the guest with zero guest-kernel modifications as well.
We try to reduce the guest impact to a bare minimum, as the difficulties in deployment are function of the cross section surface to the guest.
Also, note that the kernel is special with regards to instrumentation: since this is the kernel project, we are doing kernel space changes, as we are doing them _anyway_. So adding symbol resolution capabilities would be a minimal addition to that - while adding a while new guest package for the demon would significantly increase the cross section surface.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Ingo Molnar
Quoted 4 lines
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
Note that with perf we can instrument the guest with zero guest-kernel modifications as well.
Quoted 9 lines
We try to reduce the guest impact to a bare minimum, as the difficulties in deployment are function of the cross section surface to the guest.
Also, note that the kernel is special with regards to instrumentation: since this is the kernel project, we are doing kernel space changes, as we are doing them _anyway_. So adding symbol resolution capabilities would be a minimal addition to that - while adding a while new guest package for the demon would significantly increase the cross section surface.
It's true that for us, changing the kernel is easier than changing the rest of the guest. IMO we should still resist the temptation to go the easy path and do the right thing (I understand we disagree about what the right thing is).
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 17 lines · Avi Kivity
Quoted 7 lines · Ingo Molnar
Quoted 3 lines
That includes the guest kernel. If you can deploy a new kernel in the guest, presumably you can deploy a userspace package.
Note that with perf we can instrument the guest with zero guest-kernel modifications as well.
Quoted 8 lines
We try to reduce the guest impact to a bare minimum, as the difficulties in deployment are function of the cross section surface to the guest.
Also, note that the kernel is special with regards to instrumentation:
since this is the kernel project, we are doing kernel space changes, as we are doing them _anyway_. So adding symbol resolution capabilities would be a minimal addition to that - while adding a while new guest package for the demon would significantly increase the cross section surface.
Quoted 4 lines
It's true that for us, changing the kernel is easier than changing the rest of the guest. IMO we should still resist the temptation to go the easy path and do the right thing (I understand we disagree about what the right thing is).
It is not about the 'temptation to go the easy path'.
It is about finding the most pragmatic approach and realizing the cost of
inaction: sucky Linux, sucky KVM.
Let me give you an example: Linus's commit in v2.6.30 that changed the user-space policy of the EXT3 filesystem to make it more desktop capable:
bbae8bc: ext3: make default data ordering mode configurable
That changes was opposed vehemently with your kind of arguments: "such changes should be done by the distributions", "it should be done correctly", "the kernel should not implement policy", etc..
I can also tell you that this commit improved my desktop experience incredibly. Still, distros didnt do it for almost a decade of ext3 existence. Why?
Truth is that those kinds of "do it right" arguments are mistaken because they assume that we live in an ideal, 'perfect market' where all inefficiencies will get eliminated in the long run.
In reality the "market" for OSS software is imperfect:
- there's marginal costs of action - a too small change has difficulty getting over that
- there's costs of modularization (which are both technical and social)
- there's the power of the status quo acting against marginally good changes
- there's the power of entropy ripping Linux distributions apart making all-distro changes harder
So the solution to the "why dont the distributions do this" question you pose is exactly what i propose: _give a default, reference implementation of KVM tooling that has to be eclipsed_.
There's the unique position of the kernel that it can impose sanity in a more central way which acts as a reference implementation.
I.e. the kernel can very much improve quality all across the board by providing a sane default (in the ext3 case) - or, as in the case of perf, by providing a sane 'baseline' tooling. It should do the same for KVM as well.
If we dont do that, Linux will eventually stop mattering on the desktop - and some time after that, it will vanish from the server space as well. Then, may it be a decade down the line, you wont have a KVM hacking job left, and you wont know where all those forces eliminating your project came from.
But i told you now so you'll know ;-)
Reality is, the server space never was and never will be self-sustaining in the long run (as Novell has found it out with Netware), it is the desktop that dictates future markets. This is why i find your views about this naive and shortsighted.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Ingo Molnar
Reality is, the server space never was and never will be self-sustaining in the long run (as Novell has found it out with Netware), it is the desktop that dictates future markets. This is why i find your views about this naive and shortsighted.
Yet Linux is gaining ground in the server and embedded space while struggling on the desktop. Apple is gaining ground on the desktop but is invisible on the server side (despite having a nice product - Xserve).
It's true Windows achieved server dominance through it's desktop power, but I don't think that's what keeping them there now.
In any case, I'm not going to write a kvm GUI. It doesn't match my skills, interest, or my employer's interest. If you wish to see a kvm GUI you have to write one yourself or convince someone to write it (perhaps convince Red Hat to fund such an effort beyond virt-manager).
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 12 lines · Avi Kivity
Quoted 6 lines · Ingo Molnar
Reality is, the server space never was and never will be self-sustaining in the long run (as Novell has found it out with Netware), it is the desktop that
dictates future markets. This is why i find your views about this naive and shortsighted.Yet Linux is gaining ground in the server and embedded space while struggling on the desktop. Apple is gaining ground on the desktop but is invisible on the server side (despite having a nice product - Xserve).
Quoted 7 lines
It's true Windows achieved server dominance through it's desktop power, but I don't think that's what keeping them there now.
In any case, I'm not going to write a kvm GUI. It doesn't match my skills, interest, or my employer's interest. If you wish to see a kvm GUI you have to write one yourself or convince someone to write it (perhaps convince Red Hat to fund such an effort beyond virt-manager).
It is planned to add support for SPICE remote desktop to virt-manager once that matures & is accepted into upstream KVM/QEMU. That will improve the guest/desktop interaction in many ways compared to VNC or SDL, with improved display resolution changing, copy+paste between host & guest, much better graphics performance, etc.
Development efforts aren't totally ignoring the desktop, more that they are focusing on remoting guest desktops, rather than interaction host desktop since that's where alot of demand is. This benefits single host desktops scenarios too, since there's alot of overlap in the problems faced there.
Regards,
Daniel
Signature · 4 lines
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityQuoted 9 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Reality is, the server space never was and never will be self-sustaining in the long run (as Novell has found it out with Netware), it is the desktop that dictates future markets. This is why i find your views about this naive and shortsighted.
Yet Linux is gaining ground in the server and embedded space while struggling on the desktop. [...]
Frankly, Linux is mainly growing in the server space due to:
1) the server space is technically much simpler than the desktop space. It is far easier to code up a server performance feature than to make struggle through stupid (server-motivated) package boundaries and get something done on the desktop. It is far easier to code up a server app as that space is well standardized and servers tend to be compartmented. Integration between server apps is much less common than integration between desktop apps, hence the harm that our modularization idiocies cause less harm.
2) Linux's growth is still feeding on the remains of the destruction of Unix.
Linux is struggling on the desktop due to the desktop's inherent complexity, due to the lack of the Unix inertia and due to incompetence, insensitivity, intellectual arrogance and shortsightedness of server-centric thinking, like your arguments/position displayed in this very thread.
Quoted 2 lines
[...] Apple is gaining ground on the desktop but is invisible on the server side (despite having a nice product - Xserve).
But the thing is, Apple doesnt really care about the server space, yet. It is lucrative but it is a side-show: it will fall automatically to the 'winner' of the desktop (or gadget) of tomorrow.
Has the quick fall of Banyan Vines or Netware (both excellent all-around server products) taught you nothing?
We need a lot more desktop focus in the kernel community. The best method to achieve this, that i know of currently, is to simply have kernel developers think outside the kernel box and to have them do bits of user-space coding as well - and in particular desktop coding. To eat our own dogfood in essence. Suffer through crap we cause to user-space. To face the _real_ difficulties of users. We seem to have forgotten our roots.
Quoted 4 lines
[...]
It's true Windows achieved server dominance through it's desktop power, but I don't think that's what keeping them there now.
What is keeping them there is precisely that.
Quoted 4 lines
In any case, I'm not going to write a kvm GUI. It doesn't match my skills, interest, or my employer's interest. If you wish to see a kvm GUI you have to write one yourself or convince someone to write it (perhaps convince Red Hat to fund such an effort beyond virt-manager).
As a maintainer you certainly dont have to write a single line of code, if you dont want to. You 'just' need to care about the big picture and encourage/help the flow and balance of the whole project.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 24 lines · Ingo Molnar
Quoted 10 lines · Avi Kivity
Quoted 5 lines · Ingo Molnar
Reality is, the server space never was and never will be self-sustaining in the long run (as Novell has found it out with Netware), it is the desktop that dictates future markets. This is why i find your views about this naive and shortsighted.
Yet Linux is gaining ground in the server and embedded space while struggling on the desktop. [...]
Frankly, Linux is mainly growing in the server space due to:
1) the server space is technically much simpler than the desktop space. It is far easier to code up a server performance feature than to make struggle through stupid (server-motivated) package boundaries and get something done on the desktop. It is far easier to code up a server app as that space is well standardized and servers tend to be compartmented. Integration between server apps is much less common than integration between desktop apps, hence the harm that our modularization idiocies cause less harm.
Quoted 2 lines
2) Linux's growth is still feeding on the remains of the destruction of Unix.
Agreed (minus the 'package boundaries' stuff). Also, Linux is cheaper than Windows.
Quoted 5 lines
Linux is struggling on the desktop due to the desktop's inherent complexity, due to the lack of the Unix inertia and due to incompetence, insensitivity, intellectual arrogance and shortsightedness of server-centric thinking, like your arguments/position displayed in this very thread.
It's struggling because it isn't competitive technically with other desktops, because there is no application base, because of a chicken-and-egg problem with some drivers, because lack of a stable ABI means you can't get a driver CD with your device so you need a yet-unreleased kernel, because the zillion binary incompatible distributions mean that application developers don't know what to code and test for, because of lack of documentation, to name a few. At least it's improving all the time.
The incompetence, insensitivity, intellectual arrogance and shortsightedness of server-centric thinking of my arguments/position are a result of this, not the cause.
Quoted 7 lines
Quoted 3 lines
[...] Apple is gaining ground on the desktop but is invisible on the server side (despite having a nice product - Xserve).
But the thing is, Apple doesnt really care about the server space, yet. It is lucrative but it is a side-show: it will fall automatically to the 'winner' of the desktop (or gadget) of tomorrow.
It won't automatically fall to Apple, there's tons of middleware and server apps that need porting (the "ecosystem"), plus they need to work hard on improving their kernel which is desktop oriented. Looks like they're interesting in other things.
Quoted 3 lines
Has the quick fall of Banyan Vines or Netware (both excellent all-around server products) taught you nothing?
Not familiar with Banyan, but wasn't Netware a cooperative multitasking command line only thing? It couldn't compete with preemptive modern system with a nice GUI. Windows didn't need the desktop to win that fight.
Quoted 7 lines
We need a lot more desktop focus in the kernel community. The best method to achieve this, that i know of currently, is to simply have kernel developers think outside the kernel box and to have them do bits of user-space coding as well - and in particular desktop coding. To eat our own dogfood in essence. Suffer through crap we cause to user-space. To face the _real_ difficulties of users. We seem to have forgotten our roots.
Try it yourself and report the experience. Note: perf is not desktop development, it's kernel tooling development.
Quoted 7 lines
Quoted 5 lines
[...]
It's true Windows achieved server dominance through it's desktop power, but I don't think that's what keeping them there now.
What is keeping them there is precisely that.
Not at all. They have excellent development tools and lots of middleware and other third party products that make it easy to pick Windows. For example, Exchange is more or less standard for groupware, and they made C# and the technology around it easy to develop for, learning from Java's mistakes.
Quoted 9 lines
Quoted 5 lines
In any case, I'm not going to write a kvm GUI. It doesn't match my skills, interest, or my employer's interest. If you wish to see a kvm GUI you have to write one yourself or convince someone to write it (perhaps convince Red Hat to fund such an effort beyond virt-manager).
As a maintainer you certainly dont have to write a single line of code, if you dont want to. You 'just' need to care about the big picture and encourage/help the flow and balance of the whole project.
I haven't written that line of code, and no one else has either. Don't tell me they're all scared of me.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityQuoted 7 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
The logical conclusion of that is that everything should be built into the kernel. [...]
Only if you apply it as a totalitarian rule.
Furthermore, the logical conclusion of _your_ line of argument (applied in a totalitarian manner) is that 'nothing should be built into the kernel'.
I.e. you are arguing for microkernel Linux, while you see me as arguing for a monolithic kernel.
Reality is that we are somewhere inbetween, we are neither black nor white:
it's shades of grey.
If we want to do a good job with all this then we observe subsystems, we see how they relate to the physical world and decide about how to shape them. We identify long-term changes and re-design modularization boundaries in hindsight - when we got them wrong initially. We dont try to rationalize the status-quo.
Lets see one example of that thought process in action: Oprofile.
We saw that the modularization of oprofile was a total nightmare: a separate kernel-space and a separate user-space component, which was in constant version friction. The ABI between them was stiffling: it was hard to change it (you needed to trickle that through the tool as well which was on a different release schedule, etc.e tc.)
The result was sucky usability that never went beyond some basic 'you can do profiling' threshold. The subsystem worked well within that design box, and it was worked on by highly competent people - but it was still far, far away from the potential it could have achieved.
So we observed those problems and decided to do something about it:
- We unified the two parts into a single maintenance domain. There's the kernel-side in kernel/perf_event.c and arch/*/*/perf_event.c, plus the user-side in tools/perf/. The two are connected by a very flexible, forwards and backwards compatible ABI.
- We moved much more code into the kernel, realizing that transparent and robust instrumentation should be offered instead of punting abstractions into user-space (which is in a disadvantaged position to implement system-wide abstractions).
- We created a no-bullsh*t approach to usability. perf is by no means perfect, but it's written by developers for developers and if you report a bug to us we'll act on it before anything else. Furthermore the kernel developers do the user-space coding as well, so there's no chinese wall separating them. Kernel-space becomes aware of the intricacies of user-space and user-space developers become aware of the difficulties of kernel-space as well. It's a good mix in our experience.
The thing is (and i doubt you are surprised that i say that), i see a similar situation with KVM. The basic parameters are comparable to Oprofile: it has a kernel-space component and a KVM-specific user-space. By all practical means the two are one and the same, but are maintained as different projects.
I have followed KVM since its inception with great interest. I saw its good initial design, i tried it early on and even wrote various patches for it. So i care more about KVM than a random observer would, but this preference and passion for KVM's good technical sides does not cloud my judgement when it comes to its weaknesses.
In fact the weaknesses are far more important to identify and express publicly, so i tend to concentrate on them. Dont take this as me blasting KVM, we both know the many good aspects of KVM.
So, as i explained it earlier in greater detail the modularization of KVM into a separate kernel-space and user-space component is one of its worst current weaknesses, and it has become the main stiffling force in the way of a better KVM experience to users.
That, IMO, is the 'weakest link' of KVM today and no matter how well the rest of KVM gets improved those nice bits all get unfairly ignored when the user cannot have a usable and good desktop experience and thinks that KVM is crappy.
I think you should think outside the initial design box you have created 4 years ago, you should consider iterating the model and you should consider the alternative i suggested: move (or create) KVM tooling to tools/kvm/ and treat it as a single project from there on.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Avi Kivity
Quoted 3 lines · Ingo Molnar
Adding any new daemon to an existing guest is a deployment and usability nightmare.
Quoted 8 lines
Quoted 3 lines
The logical conclusion of that is that everything should be built into the kernel. [...]
Only if you apply it as a totalitarian rule.
Furthermore, the logical conclusion of _your_ line of argument (applied in a totalitarian manner) is that 'nothing should be built into the kernel'.
I'm certainly a minimalist, but that doesn't follow. Things that require privileged access, or access to the page cache, or that can't be made to perform otherwise should certainly be in the kernel. That's why I submitted kvm for inclusion in the first place.
If it's something that can work just as well in userspace but we can't be bothered to fix any 'deployment nightmares', then they shouldn't be in the kernel. Examples include lvm2 and mdadm (which truly are 'deployment nightmares' - you need to start them before you have access to your filesystem - yet they work somehow).
Quoted 3 lines
I.e. you are arguing for microkernel Linux, while you see me as arguing for a monolithic kernel.
No. I'm arguing for reducing bloat wherever possible. Kernel code is more expensive than userspace code in every metric possible.
Quoted 9 lines
Reality is that we are somewhere inbetween, we are neither black nor white:
it's shades of grey.If we want to do a good job with all this then we observe subsystems, we see how they relate to the physical world and decide about how to shape them. We identify long-term changes and re-design modularization boundaries in hindsight - when we got them wrong initially. We dont try to rationalize the status-quo.
I'm not for the status quo either - I'm for reducing the kernel code footprint whereever it doesn't impact performance or break clean interfaces.
Quoted 13 lines
Lets see one example of that thought process in action: Oprofile.
We saw that the modularization of oprofile was a total nightmare: a separate kernel-space and a separate user-space component, which was in constant version friction. The ABI between them was stiffling: it was hard to change it (you needed to trickle that through the tool as well which was on a different release schedule, etc.e tc.)
The result was sucky usability that never went beyond some basic 'you can do profiling' threshold. The subsystem worked well within that design box, and it was worked on by highly competent people - but it was still far, far away from the potential it could have achieved.
Quoted 7 lines
So we observed those problems and decided to do something about it:
- We unified the two parts into a single maintenance domain. There's the kernel-side in
kernel/perf_event.candarch/*/*/perf_event.c, plus the user-side intools/perf/. The two are connected by a very flexible, forwards and backwards compatible ABI.
That's useful because perf is still small. If it were a full fledged 350KLOC GUI, then most of the development would concentrate on the GUI and very little (relatively) would have to do with the kernel.
Qemu is in that state today. Please, please look at the recent commits and check how many have actually anything to do with kvm, and how many with everything else.
Quoted 5 lines
- We moved much more code into the kernel, realizing that transparent and robust instrumentation should be offered instead of punting abstractions into user-space (which is in a disadvantaged position to implement system-wide abstractions).
No argument.
I have a similar experience with kvm. The user/kernel break is at the cpu virtualization level - that is kvm is solely responsible for emulating a cpu and userspace is responsible for emulating devices. An exception was made for the PIC/IOAPIC/PIT due to performance considerations - they are emulated in the kernel as well.
A common FAQ is why do we not emulate real-mode instructions in qemu. The answer is that it the interface to kvm would be insane - it would emulate a partial cpu. All other users of that interface would have to implement an emulator (there is also a practical argument - the qemu emulator does not implement atomics correctly wrt other threads).
Quoted 8 lines
- We created a no-bullsh*t approach to usability. perf is by no means perfect, but it's written by developers for developers and if you report a bug to us we'll act on it before anything else. Furthermore the kernel developers do the user-space coding as well, so there's no chinese wall separating them. Kernel-space becomes aware of the intricacies of user-space and user-space developers become aware of the difficulties of kernel-space as well. It's a good mix in our experience.
Excellent. However qemu is written by developers for their users, and their users are not worried about an eject button in the qemu SDL interface, or about running the qemu command line by hand. They have complicated management interfaces that do everything, so we concentrate, for example, on a robust RPC interface for qemu. That means nothing for command line users but is critical for our users.
I am not _against_ excellent support for command-line users, but I am not going to divert the resources I control (=me) into something that is not needed by my users. I encourage anyone who wants to improve usability to subscribe to qemu-devel and contribute, they will receive a warm welcome.
Quoted 5 lines
The thing is (and i doubt you are surprised that i say that), i see a similar situation with KVM. The basic parameters are comparable to Oprofile: it has a kernel-space component and a KVM-specific user-space. By all practical means the two are one and the same, but are maintained as different projects.
There is tight cooperation between the maintainers and developers of these two projects. Most developers are subscibed to both mailing lists and many have contributed to both repositories. There does not appear to be a problem with release schedules.
Quoted 15 lines
I have followed KVM since its inception with great interest. I saw its good initial design, i tried it early on and even wrote various patches for it. So i care more about KVM than a random observer would, but this preference and passion for KVM's good technical sides does not cloud my judgement when it comes to its weaknesses.
In fact the weaknesses are far more important to identify and express publicly, so i tend to concentrate on them. Dont take this as me blasting KVM, we both know the many good aspects of KVM.
So, as i explained it earlier in greater detail the modularization of KVM into a separate kernel-space and user-space component is one of its worst current weaknesses, and it has become the main stiffling force in the way of a better KVM experience to users.
Quoted 5 lines
That, IMO, is the 'weakest link' of KVM today and no matter how well the rest of KVM gets improved those nice bits all get unfairly ignored when the user cannot have a usable and good desktop experience and thinks that KVM is crappy.
Thanks. I agree the user experience when launching qemu from the command line is miles behind virtualbox and vmware workstation. What I disagree is that this is how a typical user will first experience kvm - most distributions now integrate virt-manager which allows you much better graphical interaction.
Unfortunately, virt-manager is still server-oriented (for example, it uses VNC instead of displaying directly to X), and is hardly polished to the same level as commercial tools. However, you cannot force someone to write good desktop integration for qemu, it has to come from someone with the itch, the experience, the capability, and the time.
Quoted 5 lines
I think you should think outside the initial design box you have created 4 years ago, you should consider iterating the model and you should consider the alternative i suggested: move (or create) KVM tooling to
tools/kvm/and treat it as a single project from there on.
Do you really think that tools/kvm/ would create a good GUI for kvm? lkml is hardly the place where GUI developers and designers congregate. Please, if any of you GUI experts are reading this, please consider contributing to qemu directly.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Avi Kivity
Quoted 2 lines
I.e. you are arguing for microkernel Linux, while you see me as arguing for a monolithic kernel.
No. I'm arguing for reducing bloat wherever possible. Kernel code is more expensive than userspace code in every metric possible.
1)
One of the primary design arguments of the micro-kernel design as well was to push as much into user-space as possible without impacting performance too much so you very much seem to be arguing for a micro-kernel design for the kernel.
I think history has given us the answer for that fight between microkernels and monolithic kernels.
Furthermore, to not engage in hypotheticals about microkernels: by your argument the Oprofile design was perfect (it was minimalistic kernel-space, with all the complexity in user-space), while perf was over-complex (which does many things in the kernel that could have been done in user-space).
Practical results suggest the exact opposite happened - Oprofile is being replaced by perf. How do you explain that?
2)
In your analysis you again ignore the package boundary costs and artifacts as if they didnt exist.
That was my main argument, and that is what we saw with oprofile and perf:
while maintaining more kernel-code may be more expensive, it sure pays off for getting us a much better solution in the end.
And getting a 'much better solution' to users is the goal of all this, isnt it?
I dont mind what you call 'bloat' per se if it's for a purpose that users find like a good deal. I have quite a bit of RAM in most of my systems, having 50K more or less included in the kernel image is far less important than having a healthy and vibrant development model and having satisfied users ...
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 3 lines
I.e. you are arguing for microkernel Linux, while you see me as arguing for a monolithic kernel.
No. I'm arguing for reducing bloat wherever possible. Kernel code is more expensive than userspace code in every metric possible.
1)
Quoted 8 lines
One of the primary design arguments of the micro-kernel design as well was to push as much into user-space as possible without impacting performance too much so you very much seem to be arguing for a micro-kernel design for the kernel.
I think history has given us the answer for that fight between microkernels and monolithic kernels.
I am not arguing for a microkernel. Again: reduce bloat where possible, kernel code is more expensive than userspace code.
Quoted 8 lines
Furthermore, to not engage in hypotheticals about microkernels: by your argument the Oprofile design was perfect (it was minimalistic kernel-space, with all the complexity in user-space), while perf was over-complex (which does many things in the kernel that could have been done in user-space).
Practical results suggest the exact opposite happened - Oprofile is being replaced by perf. How do you explain that?
I did not say that the amount of kernel and userspace code is the only factor deciding the quality of software. If that were so, microkernels would have won out long ago.
It may be that that perf has too much kernel code, and won against oprofile despite that because it was better in other areas. Or it may be that perf has exactly the right user/kernel division. Or maybe perf needs some of the code moved from userspace to the kernel. I don't know, I haven't examined the code.
The user/kernel boundary is only one metric for code quality. Nor is it always in favour of pushing things to userspace. Narrowing or simplifying an interface is often an argument in favour of pushing things into the kernel.
IMO the reason perf is more usable than oprofile has less to do with the kernel/userspace boundary and more do to with effort and attention spent on the userspace/user boundary.
Quoted 9 lines
2)
In your analysis you again ignore the package boundary costs and artifacts as if they didnt exist.
That was my main argument, and that is what we saw with oprofile and perf:
while maintaining more kernel-code may be more expensive, it sure pays off for getting us a much better solution in the end.
Package costs are real. We need to bear them. I don't think that because maintaining another package (and the interface between two packages) is more difficult, then the kernel size should increase.
Quoted 8 lines
And getting a 'much better solution' to users is the goal of all this, isnt it?
I dont mind what you call 'bloat' per se if it's for a purpose that users find like a good deal. I have quite a bit of RAM in most of my systems, having 50K more or less included in the kernel image is far less important than having a healthy and vibrant development model and having satisfied users ...
I'm not worried about 50K or so, I'm worried about a bug in those 50K taking down the guest.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Avi Kivity
IMO the reason perf is more usable than oprofile has less to do with the kernel/userspace boundary and more do to with effort and attention spent on the userspace/user boundary.
[...]
If you are interested in the first-hand experience of the people who are doing the perf work then here it is: by far the biggest reason for perf success and perf usability is the integration of the user-space tooling with the kernel-space bits, into a single repository and project.
The very move you are opposing so vehemently for KVM.
Oprofile went the way you proposed, and it was a failure. It failed not because it was bad technology (it was pretty decent and people used it), it was not a failure because the wrong people worked on it (to the contrary, very capable people worked on it), it was a failure in hindsight because it simply incorrectly split into two projects which stiffled the progress of each other.
Obviously 3 years ago you'd have seen a similar, big "Oprofile is NOT broken!" flamewar, had i posted the same observations about Oprofile that i expressed about KVM here. (In fact there was a similar, big flamewar about all this when perf was posted a year ago.)
And yes, (as you are aware of) i see very similar patterns of inefficiency in the KVM/Qemu tooling relationship as well, hence did i express my views about it.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Ingo Molnar
Quoted 4 lines · Avi Kivity
IMO the reason perf is more usable than oprofile has less to do with the kernel/userspace boundary and more do to with effort and attention spent on the userspace/user boundary.
Quoted 7 lines
Quoted 2 lines
[...]
If you are interested in the first-hand experience of the people who are doing the perf work then here it is: by far the biggest reason for perf success and perf usability is the integration of the user-space tooling with the kernel-space bits, into a single repository and project.
Please take a look at the kvm integration code in qemu as a fraction of the whole code base.
Quoted 2 lines
The very move you are opposing so vehemently for KVM.
I don't want to fracture a working community.
Quoted 6 lines
Oprofile went the way you proposed, and it was a failure. It failed not because it was bad technology (it was pretty decent and people used it), it was not a failure because the wrong people worked on it (to the contrary, very capable people worked on it), it was a failure in hindsight because it simply incorrectly split into two projects which stiffled the progress of each other.
Every project that has some kernel footprint, except perf, is split like that. Are they all failures?
Seems like perf is also split, with sysprof being developed outside the kernel. Will you bring sysprof into the kernel? Will every feature be duplicated in prof and sysprof?
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Hi Avi,
Quoted 3 lines · Avi Kivity
Seems like perf is also split, with sysprof being developed outside the kernel. Will you bring sysprof into the kernel? Will every feature be duplicated in prof and sysprof?
I am glad you brought it up! Sysprof was historically outside of the kernel (with it's own kernel module, actually). While the GUI was nice, it was much harder to set up compared to oprofile so it wasn't all that popular. Things improved slightly when Ingo merged the custom kernel module but the _userspace_ part of sysprof was lagging behind a bit. I don't know what's the situation now that they've switched over to perf syscalls but you probably get my point.
It would be nice if the two projects merged but I honestly don't see any fundamental problem with two (or more) co-existing projects. Friendly competition will ultimately benefit the users (think KDE and Gnome here).
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 15 lines · Pekka Enberg
Hi Avi,
Quoted 3 lines · Avi Kivity
Seems like perf is also split, with sysprof being developed outside the kernel. ?Will you bring sysprof into the kernel? ?Will every feature be duplicated in prof and sysprof?
I am glad you brought it up! Sysprof was historically outside of the kernel (with it's own kernel module, actually). While the GUI was nice, it was much harder to set up compared to oprofile so it wasn't all that popular. Things improved slightly when Ingo merged the custom kernel module but the _userspace_ part of sysprof was lagging behind a bit. I don't know what's the situation now that they've switched over to perf syscalls but you probably get my point.
Quoted 3 lines
It would be nice if the two projects merged but I honestly don't see any fundamental problem with two (or more) co-existing projects. Friendly competition will ultimately benefit the users (think KDE and Gnome here).
See my previous mail - what i see as the most healthy project model is to have a full solution reference implementation, connected to a flexible halo of plugins or sub-apps.
Firefox does that, KDE does that, and Gnome as well to a certain degree.
The 'halo' provides a constant feedback of new features, and it also provides competition and pressure on the 'main' code to be top-notch.
The problem i see with KVM is that there's no reference implementation! There is _only_ the KVM kernel part which is not functional in itself. Surrounded by a 'halo' - where none of the entities is really 'the' reference implementation we call 'KVM'.
This causes constant quality problems as the developers of the main project dont have constant pressure towards good quality (it is not their responsibility to care about user-space bits after all), plus it causes a lack of focus as well: integration between (friendly) competing user-space components is a lot harder than integration within a single framework such as Firefox.
I hope this explains my points about modularization a bit better! I suggested KVM to grow a user-space tool component in the kernel repo in tools/kvm/, which would become the reference implementation for tooling. User-space projects can still provide alternative tooling or can plug into this tooling, just like they are doing it now. So the main effect isnt even on those projects but on the kernel developers. The ABI remains and all the user-space packages and projects remain.
Yes, i thought Qemu would be a prime candidate to be the baseline for tools/kvm/, but i guess that has become socially impossible now after this flamewar. It's not a big problem in the big scheme of things: tools/kvm/ is best grown up from a small towards larger size anyway ...
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 29 lines · Ingo Molnar
Quoted 16 lines · Pekka Enberg
Hi Avi,
Quoted 4 lines · Avi Kivity
Seems like perf is also split, with sysprof being developed outside the kernel. ?Will you bring sysprof into the kernel? ?Will every feature be duplicated in prof and sysprof?
I am glad you brought it up! Sysprof was historically outside of the kernel (with it's own kernel module, actually). While the GUI was nice, it was much harder to set up compared to oprofile so it wasn't all that popular. Things improved slightly when Ingo merged the custom kernel module but the _userspace_ part of sysprof was lagging behind a bit. I don't know what's the situation now that they've switched over to perf syscalls but you probably get my point.
Quoted 4 lines
It would be nice if the two projects merged but I honestly don't see any fundamental problem with two (or more) co-existing projects. Friendly competition will ultimately benefit the users (think KDE and Gnome here).
See my previous mail - what i see as the most healthy project model is to have a full solution reference implementation, connected to a flexible halo of plugins or sub-apps.
Firefox does that, KDE does that, and Gnome as well to a certain degree.
Quoted 8 lines
The 'halo' provides a constant feedback of new features, and it also provides competition and pressure on the 'main' code to be top-notch.
The problem i see with KVM is that there's no reference implementation! There is _only_ the KVM kernel part which is not functional in itself. Surrounded by a 'halo' - where none of the entities is really 'the' reference implementation we call 'KVM'.
The reference implementation is qemu-kvm.git, in the future qemu.git. Like the reference implementation of device-mapper is lvm2/device-mapper, not tools/device-mapper.
Quoted 3 lines
This causes constant quality problems as the developers of the main project dont have constant pressure towards good quality (it is not their responsibility to care about user-space bits after all),
The developers of the main project are very much aware that users don't call the ioctls directly but instead use qemu.
Quoted 5 lines
plus it causes a lack
of focus as well: integration between (friendly) competing user-space components is a lot harder than integration within a single framework such as Firefox.
We are very focused, just not on what you think we should be focused.
Quoted 8 lines
I hope this explains my points about modularization a bit better! I suggested KVM to grow a user-space tool component in the kernel repo in
tools/kvm/, which would become the reference implementation for tooling. User-space projects can still provide alternative tooling or can plug into this tooling, just like they are doing it now. So the main effect isnt even on those projects but on the kernel developers. The ABI remains and all the user-space packages and projects remain.
Seems like wanton duplication of effort. Can we throw so many developer-years away on duplicate projects? Assuming not all are true volunteers (85% for 2.6.33) who will fund this duplicate effort?
Quoted 5 lines
Yes, i thought Qemu would be a prime candidate to be the baseline for
tools/kvm/, but i guess that has become socially impossible now after this flamewar. It's not a big problem in the big scheme of things:tools/kvm/is best grown up from a small towards larger size anyway ...
Qemu is open source, you can cp it into tools/kvm. Rewriting it from scratch is a mammoth effort, there's a reason kvm, Xen, and virtualbox all use qemu. Qemu itself copied code from bochs. Writing this stuff is hard, especially if there is something already working.
You'll probably get much better threading (the qemu device model is still single threaded), but it will take years to reach where qemu is already at.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 4 lines · Ingo Molnar
Yes, i thought Qemu would be a prime candidate to be the baseline for
tools/kvm/, but i guess that has become socially impossible now after this flamewar. It's not a big problem in the big scheme of things:tools/kvm/is best grown up from a small towards larger size anyway ...
I'm curious, where would you put the limit? Let's imagine a tools/kvm appears, be it qemu or not, that's outside the scope of my question. Would you put the legacy PC bios in there (seabios I guess)? The EFI bios? The windows-compiled paravirtual drivers? The Xorg paravirtual DDX ? Mesa (which includes the pv gallium drivers)? The libvirt-equivalent? The GUI?
That's not a rhetorical question btw, I really wonder where the limit should be.
OG.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityQuoted 9 lines · Avi Kivity
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Avi Kivity
IMO the reason perf is more usable than oprofile has less to do with the kernel/userspace boundary and more do to with effort and attention spent on the userspace/user boundary.
[...]
Quoted 7 lines
Quoted 4 lines
If you are interested in the first-hand experience of the people who are doing the perf work then here it is: by far the biggest reason for perf success and perf usability is the integration of the user-space tooling with the kernel-space bits, into a single repository and project.
Please take a look at the kvm integration code in qemu as a fraction of the whole code base.
You have to admit that much of Qemu's past 2-3 years of development was motivated by Linux/KVM (i'd say more than 50% of the code). As such it's one and the same code base - you just continue to define Qemu to be different from KVM.
I very much remember how Qemu looked like _before_ KVM: it was a struggling, dying project. KVM clearly changed that.
Quoted 3 lines
Quoted 1 line
The very move you are opposing so vehemently for KVM.
I don't want to fracture a working community.
Would you accept (or at least not NAK) a new tools/kvm/ tool that builds tooling from grounds up, while leaving Qemu untouched? [assuming it's all clean code, etc.]
Although i have doubts about how well that would work 'against' your opinion:
such a tool would need lots of KVM-side features and a positive attitude from you to be really useful. There's a lot of missing functionality to cover.
Quoted 9 lines
Quoted 6 lines
Oprofile went the way you proposed, and it was a failure. It failed not because it was bad technology (it was pretty decent and people used it), it was not a failure because the wrong people worked on it (to the contrary, very capable people worked on it), it was a failure in hindsight because it simply incorrectly split into two projects which stiffled the progress of each other.
Every project that has some kernel footprint, except perf, is split like that. Are they all failures?
No. Did i ever claim KVM was a failure? I said it's hindered by this design aspect.
Are other Linux kernel tool projects affected by similar problems? You bet ...
Quoted 3 lines
Seems like perf is also split, with sysprof being developed outside the kernel. Will you bring sysprof into the kernel? Will every feature be duplicated in prof and sysprof?
I'd prefer if sysprof merged into perf as 'perf view' - but its maintainer does not want that - which is perfectly OK. So we are building equivalent functionality into perf instead.
Think about it like Firefox plugins: the main Firefox project picks up the functionality of the most popular Firefox plugins all the time. Session Saver, Tab Mix Plus, etc. were all in essence 'merged' (in functionality, not in code) into the 'reference' Firefox project.
I think that's a fundamentally healthy model: it allows extensions and thus give others an honest chance to show that you are potentially coding an inferior piece of code - but also express a clear opinion about what you consider a full, usable, high-quality reference implementation and constantly improve this reference implementation.
I dont think that can be argued to be a bad model. Yes, it takes a bit of thinking outside the box to do tools/kvm/ but of all people i'd expect some of that from you.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Ingo Molnar
Quoted 9 lines
Quoted 6 lines
If you are interested in the first-hand experience of the people who are doing the perf work then here it is: by far the biggest reason for perf success and perf usability is the integration of the user-space tooling with the kernel-space bits, into a single repository and project.
Please take a look at the kvm integration code in qemu as a fraction of the whole code base.
You have to admit that much of Qemu's past 2-3 years of development was motivated by Linux/KVM (i'd say more than 50% of the code).
kvm certainly revitalized qemu development.
Quoted 4 lines
As such it's one
and the same code base - you just continue to define Qemu to be different from KVM.
It's not the same code base. kvm provides a cpu virtualization service, qemu uses it. There could be other users. qemu could go away one day and be replaced by something else (tools/kvm?), and kvm would be unaffected.
Quoted 3 lines
I very much remember how Qemu looked like _before_ KVM: it was a struggling, dying project. KVM clearly changed that.
I'm a hero.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
The very move you are opposing so vehemently for KVM.
I don't want to fracture a working community.
Would you accept (or at least not NAK) a new
tools/kvm/tool that builds tooling from grounds up, while leaving Qemu untouched? [assuming it's all clean code, etc.]
I couldn't NAK tools/kvm any more than I could NAK a new project outside the kernel repository. IMO it would be duplicated effort, but like I mentioned before, I can't tell volunteers what to do, only recommend that they join the existing effort.
Quoted 4 lines
Although i have doubts about how well that would work 'against' your opinion:
such a tool would need lots of KVM-side features and a positive attitude from you to be really useful. There's a lot of missing functionality to cover.
Functionality that can be implemented in userspace will not be accepted into kvm unless there are very good reasons why it should be. Things that belong in kvm will be more than welcome.
Quoted 6 lines
Quoted 4 lines
Seems like perf is also split, with sysprof being developed outside the kernel. Will you bring sysprof into the kernel? Will every feature be duplicated in prof and sysprof?
I'd prefer if sysprof merged into perf as 'perf view' - but its maintainer does not want that - which is perfectly OK.
You spared him the flamewar, I hope.
Quoted 3 lines
So we are building equivalent
functionality into perf instead.
Ah, duplicating effort. Great.
Quoted 5 lines
Think about it like Firefox plugins: the main Firefox project picks up the functionality of the most popular Firefox plugins all the time. Session Saver, Tab Mix Plus, etc. were all in essence 'merged' (in functionality, not in code) into the 'reference' Firefox project.
There's a difference between absorbing a small plugin and duplicating a project.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 1 line · Ingo Molnar
Lets see one example of that thought process in action: Oprofile.
Since you are talking so much about oProfile in this thread I think it is important to mention that the problem with oProfile was not the repository separation.
The problem was (and is) that the kernel and the user-space parts are maintained by different people who dont talk to each other or have a direction where they want to go with the project. Basically the reason of the oProfile failure is a disfunctional community. I told the kernel-maintainer several times to also maintain user-space but he didn't want that.
The situation with KVM is entirely different. Avi commits to kvm.git and qemu-kvm.git so he maintains both. Anthony is working to integrate the qemu-kvm changes into upstream qemu. Further these people work very closely together and the community around KVM works well too. The problems that oProfile has are not even in sight for KVM.
Joerg
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · oerg Roedel
Quoted 1 line · Ingo Molnar
Lets see one example of that thought process in action: Oprofile.
Since you are talking so much about oProfile in this thread I think it is important to mention that the problem with oProfile was not the repository separation.
The problem was (and is) that the kernel and the user-space parts are maintained by different people [...]
Caused by: repository separation and the inevitable code and social fork a decade later.
Quoted 2 lines
[...] who dont talk to each other or have a direction where they want to go with the project. [...]
Caused by: repository separation and the inevitable code and social fork a decade later.
Quoted 2 lines
[...] Basically the reason of the oProfile failure is a disfunctional community. [...]
Caused by: repository separation and the inevitable code and social fork a decade later.
Quoted 5 lines
[...] I told the kernel-maintainer several times to also maintain user-space but he didn't want that.
The situation with KVM is entirely different. Avi commits to kvm.git and qemu-kvm.git so he maintains both. [...]
What you fail to realise (or what you fail to know, you werent around when Oprofile was written, i was) is that Oprofile _did_ have a functional single community when it was written. The tooling and the kernel bits was written by the same people.
But a decade is a long time and the drift happened due to the inevitability of the repository separation, and due to the _inability_ to reach a sane, usable solution within that framework of separation.
So i dont see much of a difference to the Oprofile situation really and i see many parallels. I also see similar kinds of desktop usability problems.
The difference is that we dont have KVM with a decade of history and we dont have a 'told you so' KVM reimplementation to show that proves the point. I guess it's a matter of time before that happens, because Qemu usability is so absymal today - so i guess we should suspend any discussions until that happens, no need to waste time on arguing hypoteticals.
I think you are rationalizing the status quo.
It's as if you argued in 1990 that the unification of East and West Germany wouldnt make much sense because despite clear problems and incompatibilites and different styles westerners were still allowed to visit eastern relatives and they both spoke the same language after all ;-)
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Ingo Molnar
Quoted 2 lines · Joerg Roedel
[...] Basically the reason of the oProfile failure is a disfunctional community. [...]
Caused by: repository separation and the inevitable code and social fork a decade later.
No, the split-repository situation was the smallest problem after all. Its was a community thing. If the community doesn't work a single-repo project will also fail. Look at the state of the alpha arch in Linux today, it is maintained in one repository but nobody really cares about it. Thus it is miles behine most other archs Linux supports today in quality and feature completeness.
Quoted 4 lines
What you fail to realise (or what you fail to know, you werent around when Oprofile was written, i was) is that Oprofile _did_ have a functional single community when it was written. The tooling and the kernel bits was written by the same people.
Yes, this was probably the time when everybody was enthusiastic about the feature and they could attract lots of developers. But situation changed over time.
Quoted 2 lines
So i dont see much of a difference to the Oprofile situation really and i see many parallels. I also see similar kinds of desktop usability problems.
The difference is that KVM has a working community with good developers and maintainers.
Quoted 5 lines
The difference is that we dont have KVM with a decade of history and we dont have a 'told you so' KVM reimplementation to show that proves the point. I guess it's a matter of time before that happens, because Qemu usability is so absymal today - so i guess we should suspend any discussions until that happens, no need to waste time on arguing hypoteticals.
We actually have lguest which is small. But it lacks functionality and the developer community KVM has attracted.
Quoted 1 line
I think you are rationalizing the status quo.
I see that there are issues with KVM today in some areas. You pointed out the desktop usability already. I personally have trouble with the qem-kvm.git because it is unbisectable. But repository unification doesn't solve the problem here.
The point for a single repository is that it simplifies the development process. I agree with you here. But the current process of KVM is not too difficult after all. I don't have to touch qemu sources for most of my work on KVM.
Quoted 4 lines
It's as if you argued in 1990 that the unification of East and West Germany wouldnt make much sense because despite clear problems and incompatibilites and different styles westerners were still allowed to visit eastern relatives and they both spoke the same language after all ;-)
Um, hmm. I don't think these situations have enough in common to compare them ;-)
Joerg
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 3 lines · Joerg Roedel
[...] Look at the state of the alpha arch in Linux today, it is maintained in one repository but nobody really cares about it. Thus it is miles behine most other archs Linux supports today in quality and feature completeness.
I dont know how you can find the situation of Alpha comparable, which is a legacy architecture for which no new CPU was manufactored in the past ~10 years.
The negative effects of physical obscolescence cannot be overcome even by the very best of development models ...
So this is a total non-argument in this context.
Quoted 7 lines · Ingo Molnar
Quoted 6 lines · Joerg Roedel
Quoted 3 lines
[...] Basically the reason of the oProfile failure is a disfunctional community. [...]
Quoted 6 lines
Quoted 2 lines
Caused by: repository separation and the inevitable code and social fork a decade later.
No, the split-repository situation was the smallest problem after all. Its was a community thing. If the community doesn't work a single-repo project will also fail. [...]
So, what do you think creates code communities and keeps them alive? Developers and code. And the wellbeing of developers are primarily influenced by the repository structure and by the development/maintenance process - i.e. by the 'fun' aspect. (i'm simplifying things there but that's the crux of it.)
So yes, i do claim that what stiffled and eventually killed off the Oprofile community was the split repository. None of the other Oprofile shortcomings were really unfixable, but this one was. It gave no way for the community to grow in a healthy way, after the initial phase. Features were more difficult and less fun to develop.
And yes, there were times when there was still active Oprofile development but the development process warning signs should have been noticed, and the community could have been kept alive by unification and similar measures. Instead what happened was a complete rewrite and a competitive replacement by perf. (Which isnt particularly nice to users btw. - they prefer more gradual transitions - but there was no other option, so many problems accumulated in Oprofile.)
I simply do not want to see KVM face the same fate, and yes i do see similar warnings signs.
Quoted 8 lines
Quoted 4 lines
What you fail to realise (or what you fail to know, you werent around when Oprofile was written, i was) is that Oprofile _did_ have a functional single community when it was written. The tooling and the kernel bits was written by the same people.
Yes, this was probably the time when everybody was enthusiastic about the feature and they could attract lots of developers. But situation changed over time.
The thing is, the drift was pre-programmed by having a split ...
Quoted 6 lines
Quoted 3 lines
So i dont see much of a difference to the Oprofile situation really and i see many parallels. I also see similar kinds of desktop usability problems.
The difference is that KVM has a working community with good developers and maintainers.
Oprofile certainly had good developers and maintainers as well. In the end it wasnt enough ...
Also, a project can easily still be 'alive' but not reach its full potential.
Why do you assume that my argument means that KVM isnt viable today? It can very well still be viable and even healthy - just not _as healthy_ as it could be ...
Quoted 9 lines
Quoted 6 lines
The difference is that we dont have KVM with a decade of history and we dont have a 'told you so' KVM reimplementation to show that proves the point. I guess it's a matter of time before that happens, because Qemu usability is so absymal today - so i guess we should suspend any discussions until that happens, no need to waste time on arguing hypoteticals.
We actually have lguest which is small. But it lacks functionality and the developer community KVM has attracted.
I suggested long ago to merge lguest into KVM to cover non-VMX/non-SVM execution.
Quoted 6 lines
Quoted 1 line
I think you are rationalizing the status quo.
I see that there are issues with KVM today in some areas. You pointed out the desktop usability already. I personally have trouble with the qem-kvm.git because it is unbisectable. But repository unification doesn't solve the problem here.
Why doesnt it solve the bisectability problem? The kernel repo is supposed to be bisectable so that problem would be solved.
Quoted 4 lines
The point for a single repository is that it simplifies the development process. I agree with you here. But the current process of KVM is not too difficult after all. I don't have to touch qemu sources for most of my work on KVM.
In my judgement you'd have to do that more frequently, if KVM was properly weighting its priorities. For example regarding this recent KVM commit of yours:
| commit ec1ff79084fccdae0dca9b04b89dcdf3235bbfa1 | Author: Joerg Roedel <[email protected]> | Date: Fri Oct 9 16:08:31 2009 +0200 | | KVM: SVM: Add tracepoint for invlpga instruction | | This patch adds a tracepoint for the event that the guest | executed the INVLPGA instruction.
With integrated KVM tooling i might have insisted for that new tracepoint to be available to users as well via some more meaningful tooling than just a pure tracepoint.
There's synergies like that all around the place.
You should realize that naturally developers will gravitate towards the most 'fun' aspects of a project. It is the task of the maintainer to keep the balance between fun and utility, bugs and features, quality and code-rot.
Quoted 8 lines
Quoted 5 lines
It's as if you argued in 1990 that the unification of East and West Germany wouldnt make much sense because despite clear problems and incompatibilites and different styles westerners were still allowed to visit eastern relatives and they both spoke the same language after all ;-)
Um, hmm. I don't think these situations have enough in common to compare them ;-)
Probably, but it's an interesting parallel nevertheless ;-)
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · mingo
[...]
Quoted 3 lines
No, the split-repository situation was the smallest problem after all. Its was a community thing. If the community doesn't work a single-repo project will also fail. [...]
Quoted 7 lines
So, what do you think creates code communities and keeps them alive? Developers and code. And the wellbeing of developers are primarily influenced by the repository structure and by the development/maintenance process - i.e. by the 'fun' aspect. (i'm simplifying things there but that's the crux of it.)
So yes, i do claim that what stiffled and eventually killed off the Oprofile community was the split repository. [...]
In your very previous paragraphs, you enumerate two separate causes:
"repository structure" and "development/maintenance process" as being sources of "fun". Please simply accept that the former is considered by many as absolutely trivial compared to the latter, and additional verbose repetition of your thesis will not change this.
- FChE
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Hi Frank,
Quoted 5 lines · Frank Ch. Eigler
In your very previous paragraphs, you enumerate two separate causes:
"repository structure" and "development/maintenance process" as being sources of "fun". Please simply accept that the former is considered by many as absolutely trivial compared to the latter, and additional verbose repetition of your thesis will not change this.
I can accept that many people consider it trivial but the problem is that we have _real data_ on kmemtrace and now perf that the amount of contributors is significantly smaller when your code is outside the kernel repository. Now admittedly both of them are pretty intimate with the kernel but Ingo's suggestion of putting kvm-qemu in tools/ is an interesting idea nevertheless.
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have _real world_ experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Pekka Enberg
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have
_realworld_experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.
qemu has non-Linux developers. Not all of their contributions are relevant to kvm but some are. If we pull qemu into tools/kvm, we lose them.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Avi Kivity
Quoted 7 lines · Pekka Enberg
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have
_realworld_experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.qemu has non-Linux developers. Not all of their contributions are relevant to kvm but some are. If we pull qemu into
tools/kvm, we lose them.
Qemu had very few developers before KVM made use of it - i know it because i followed the project prior KVM.
So whatever development activitity Qemu has today, it's 99% [WAG] attributable to KVM. It might have non-Linux contributors, but they wouldnt be there if it wasnt for all the Linux contributors ...
Furthermore, those contributors wouldnt have to leave - they could simply use a different Git URI ...
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 12 lines · Ingo Molnar
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Pekka Enberg
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have
_realworld_experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.
Quoted 6 lines
Quoted 3 lines
qemu has non-Linux developers. Not all of their contributions are relevant to kvm but some are. If we pull qemu into
tools/kvm, we lose them.Qemu had very few developers before KVM made use of it - i know it because i followed the project prior KVM.
No argument.
Quoted 7 lines
So whatever development activitity Qemu has today, it's 99% [WAG] attributable to KVM. It might have non-Linux contributors, but they wouldnt be there if it wasnt for all the Linux contributors ...
Furthermore, those contributors wouldnt have to leave - they could simply use a different Git URI ...
tools/kvm would drop support for non-Linux hosts, for tcg, and for architectures which kvm doesn't support ("clean and minimal"). That would be the real win, not sharing the repository. But those other contributors would just stay with the original qemu.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityHi Avi,
Quoted 10 lines · Avi Kivity
Quoted 7 lines
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have
_realworld_experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.qemu has non-Linux developers. Not all of their contributions are relevant to kvm but some are. If we pull qemu into
tools/kvm, we lose them.
Yeah, you probably would but the hypothesis is that you'd end up with a bigger net developer base for the _Linux_ version. Now you might not think that's important but I certainly do and I think Ingo does as well. ;-)
That said, pulling 400 KLOC of code into the kernel sounds really excessive. Would we need all that if we just do native virtualization and no actual emulation?
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 12 lines · Pekka Enberg
Hi Avi,
Quoted 8 lines · Avi Kivity
Quoted 8 lines
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have
_realworld_experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.
Quoted 8 lines
Quoted 3 lines
qemu has non-Linux developers. Not all of their contributions are relevant to kvm but some are. If we pull qemu into
tools/kvm, we lose them.Yeah, you probably would but the hypothesis is that you'd end up with a bigger net developer base for the _Linux_ version. Now you might not think that's important but I certainly do and I think Ingo does as well. ;-)
You're probably correct, but the point is that non-Linux developers also contribute things which kvm benefits from. Not a whole lot, but some.
Quoted 4 lines
That said, pulling 400 KLOC of code into the kernel sounds really excessive. Would we need all that if we just do native virtualization and no actual emulation?
What is native virtualization and no actual emulation?
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Avi Kivity
Quoted 3 lines
That said, pulling 400 KLOC of code into the kernel sounds really excessive. Would we need all that if we just do native virtualization and no actual emulation?
What is native virtualization and no actual emulation?
What I meant with "actual emulation" was running architecture A code on architecture B what was qemu's traditional use case. So the question was how much of the 400 KLOC do we need for just KVM on all the architectures that it supports?
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 6 lines · Pekka Enberg
Quoted 4 lines · Avi Kivity
Quoted 4 lines
That said, pulling 400 KLOC of code into the kernel sounds really excessive. Would we need all that if we just do native virtualization and no actual emulation?
Quoted 7 lines
Quoted 2 lines
What is native virtualization and no actual emulation?
What I meant with "actual emulation" was running architecture A code on architecture B what was qemu's traditional use case. So the question was how much of the 400 KLOC do we need for just KVM on all the architectures that it supports?
qemu is 620 KLOC. Without cpu emulation that drops to ~480 KLOC. Much of that is device emulation that is not supported by kvm now (like ARM) but some might be needed again in the future (like ARM).
x86-only is perhaps 300 KLOC, but kvm is not x86 only.
And that is with a rudimentary GUI. GUIs are heavy.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Pekka EnbergQuoted 9 lines · Pekka Enberg
Hi Frank,
Quoted 5 lines · Frank Ch. Eigler
In your very previous paragraphs, you enumerate two separate causes:
"repository structure" and "development/maintenance process" as being sources of "fun". ?Please simply accept that the former is considered by many as absolutely trivial compared to the latter, and additional verbose repetition of your thesis will not change this.
Quoted 6 lines
I can accept that many people consider it trivial but the problem is that we have
_realdata_on kmemtrace and now perf that the amount of contributors is significantly smaller when your code is outside the kernel repository. Now admittedly both of them are pretty intimate with the kernel but Ingo's suggestion of putting kvm-qemu intools/is an interesting idea nevertheless.
Correct.
Quoted 6 lines
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have
_realworld_experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.
Yeah.
Also, if in fact the claim that the 'repository does not matter' is true then it doesnt matter that it's hosted in tools/kvm/ either, right?
I.e. it's a win-win situation. Worst-case nothing happens beyond a Git URI change. Best-case the project is propelled to never seen heights due to contribution advantages not contemplated and not experienced by the KVM guys before ...
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Ingo Molnar
Quoted 8 lines
It's kinda funny to see people argue that having an external repository is not a problem and that it's not a big deal if building something from the repository is slightly painful as long as it doesn't require a PhD when we have
_realworld_experience that it _does_ limit developer base in some cases. Whether or not that applies to kvm remains to be seen but I've yet to see a convincing argument why it doesn't.
Quoted 5 lines
Yeah.
Also, if in fact the claim that the 'repository does not matter' is true then it doesnt matter that it's hosted in
tools/kvm/either, right?
Again, the second it's moved to tools/kvm/ we strip it off anything that kvm can't use.
Quoted 5 lines
I.e. it's a win-win situation. Worst-case nothing happens beyond a Git URI change. Best-case the project is propelled to never seen heights due to contribution advantages not contemplated and not experienced by the KVM guys before ...
You're exaggerating. There were 773 commits into qemu.git (excluding qemu-kvm.git) in the past three months. 162 for the same period for tools/perf. The pool is not that deep.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 6 lines · Ingo Molnar
So, what do you think creates code communities and keeps them alive? Developers and code. And the wellbeing of developers are primarily influenced by the repository structure and by the development/maintenance process - i.e. by the 'fun' aspect. (i'm simplifying things there but that's the crux of it.)
There is nothing fun about having one repository or two. Who cares about this anyway?
tools/kvm/ probably will draw developers, simply because of the glory associated with kernel work. That's a bug, not a feature. It means that effort is not distributed according to how it's needed, but because of irrelevant considerations.
Quoted 3 lines
I simply do not want to see KVM face the same fate, and yes i do see similar warnings signs.
The number of kvm and qemu developers keeps increasing.
We're having a kvm forum in August where we all meet. Come and see for yourself.
Quoted 6 lines
Quoted 3 lines
We actually have lguest which is small. But it lacks functionality and the developer community KVM has attracted.
I suggested long ago to merge lguest into KVM to cover non-VMX/non-SVM execution.
Rusty posted some initial patches for pv-only kvm but he lost interest before they were completed. No one followed up.
btw, lguest has a single repository, userspace and kernel in the same repository, yet is practically dead.
Quoted 10 lines
Quoted 7 lines
Quoted 2 lines
I think you are rationalizing the status quo.
I see that there are issues with KVM today in some areas. You pointed out the desktop usability already. I personally have trouble with the qem-kvm.git because it is unbisectable. But repository unification doesn't solve the problem here.
Why doesnt it solve the bisectability problem? The kernel repo is supposed to be bisectable so that problem would be solved.
These days qemu-kvm.git is bisectable (though not always trivially). qemu.git doesn't have this problem.
Quoted 18 lines
Quoted 5 lines
The point for a single repository is that it simplifies the development process. I agree with you here. But the current process of KVM is not too difficult after all. I don't have to touch qemu sources for most of my work on KVM.
In my judgement you'd have to do that more frequently, if KVM was properly weighting its priorities. For example regarding this recent KVM commit of yours:
| commit ec1ff79084fccdae0dca9b04b89dcdf3235bbfa1 | Author: Joerg Roedel<[email protected]> | Date: Fri Oct 9 16:08:31 2009 +0200 | | KVM: SVM: Add tracepoint for invlpga instruction | | This patch adds a tracepoint for the event that the guest | executed the INVLPGA instruction.
Quoted 4 lines
With integrated KVM tooling i might have insisted for that new tracepoint to be available to users as well via some more meaningful tooling than just a pure tracepoint.
Something I've wanted for a long time is to port kvm_stat to use tracepoints instead of the home-grown instrumentation. But that is unrelated to this new tracepoint. Other than that we're satisfied with ftrace.
Quoted 4 lines
You should realize that naturally developers will gravitate towards the most 'fun' aspects of a project. It is the task of the maintainer to keep the balance between fun and utility, bugs and features, quality and code-rot.
There are plenty of un-fun tasks (like fixing bugs and providing RAS features) that we're doing. We don't do this for fun but to satisfy our users.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Avi Kivity
Quoted 6 lines · Ingo Molnar
So, what do you think creates code communities and keeps them alive? Developers and code. And the wellbeing of developers are primarily influenced by the repository structure and by the development/maintenance process - i.e. by the 'fun' aspect. (i'm simplifying things there but that's the crux of it.)
Quoted 7 lines
There is nothing fun about having one repository or two. Who cares about this anyway?
tools/kvm/probably will draw developers, simply because of the glory associated with kernel work. That's a bug, not a feature. It means that effort is not distributed according to how it's needed, but because of irrelevant considerations.
And yet your solution to that is to ... do all your work in the kernel space and declare the tooling as something that does not interest you? ;-)
Quoted 3 lines
Something I've wanted for a long time is to port
kvm_statto use tracepoints instead of the home-grown instrumentation. But that is unrelated to this new tracepoint. Other than that we're satisfied with ftrace.
Despite it being another in-kernel subsystem that by your earlier arguments should be done via a user-space package? ;-)
Quoted 8 lines
Quoted 4 lines
You should realize that naturally developers will gravitate towards the most 'fun' aspects of a project. It is the task of the maintainer to keep the balance between fun and utility, bugs and features, quality and code-rot.
There are plenty of un-fun tasks (like fixing bugs and providing RAS features) that we're doing. We don't do this for fun but to satisfy our users.
So which one is it, KVM developers are volunteers that do fun stuff and cannot be told about project priorities, or KVM developers are pros who do unfun stuff because they can be told about priorities?
I posit that it's both: and that priorities can be communicated - if only you try as a maintainer. All i'm suggesting is to add 'usable, unified user-space' to the list of unfun priorities, because it's possible and because it matters.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Ingo Molnar
I posit that it's both: and that priorities can be communicated - if only you try as a maintainer. All i'm suggesting is to add 'usable, unified user-space' to the list of unfun priorities, because it's possible and because it matters.
I've spent the past few months dealing with customers using the libvirt/qemu/kvm stack. Usability is a major problem and is a top priority for me. That is definitely a shift but that occurred before you started your thread.
But I disagree with your analysis of what the root of the problem is. It's a very kernel centric view and doesn't consider the interactions between userspace.
Regards,
Anthony Liguori
Quoted 2 lines
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 14 lines · Ingo Molnar
Quoted 11 lines · Avi Kivity
Quoted 6 lines · Ingo Molnar
So, what do you think creates code communities and keeps them alive? Developers and code. And the wellbeing of developers are primarily influenced by the repository structure and by the development/maintenance process - i.e. by the 'fun' aspect. (i'm simplifying things there but that's the crux of it.)
There is nothing fun about having one repository or two. Who cares about this anyway?
Quoted 8 lines
Quoted 5 lines
tools/kvm/probably will draw developers, simply because of the glory associated with kernel work. That's a bug, not a feature. It means that effort is not distributed according to how it's needed, but because of irrelevant considerations.And yet your solution to that is to ... do all your work in the kernel space and declare the tooling as something that does not interest you? ;-)
I have done plenty of userspace work in qemu. I don't have a lack of interest in qemu, just in a desktop GUI. I'm not a GUI person and my employer doesn't have a desktop-on-desktop virtualization product that I know of.
Quoted 7 lines
Quoted 4 lines
Something I've wanted for a long time is to port
kvm_statto use tracepoints instead of the home-grown instrumentation. But that is unrelated to this new tracepoint. Other than that we're satisfied with ftrace.Despite it being another in-kernel subsystem that by your earlier arguments should be done via a user-space package? ;-)
I'm satisfied with it as a user. Architecturally, I'd have preferred it to be a userspace tool. It might have improved usability as well to have something with --help instead of a set of debugfs files. But I'm a lot happier with ftrace existing as a kernel component than not at all.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
You should realize that naturally developers will gravitate towards the most 'fun' aspects of a project. It is the task of the maintainer to keep the balance between fun and utility, bugs and features, quality and code-rot.
Quoted 8 lines
Quoted 4 lines
There are plenty of un-fun tasks (like fixing bugs and providing RAS features) that we're doing. We don't do this for fun but to satisfy our users.
So which one is it, KVM developers are volunteers that do fun stuff and cannot be told about project priorities, or KVM developers are pros who do unfun stuff because they can be told about priorities?
From my point of view as maintainer, all contributors are volunteers, I can't tell any of them what to do. From the point of view of many of these volunteer's employers, they are wage slaves who do as they're told or else.
So: when someone sends me a patch I gratefully accept if it is good or point out the issues if not. At the secret Red Hat headquarters and the kvm weekly conference call I participate in deciding priorities and task assignments.
Quoted 4 lines
I posit that it's both: and that priorities can be communicated - if only you try as a maintainer. All i'm suggesting is to add 'usable, unified user-space' to the list of unfun priorities, because it's possible and because it matters.
So: I require a volunteer to write some GUI code before I accept a patch. Back at the Red Hat lair, we think of what features we drop from the product because the kvm maintainer has gone nuts.
The 'unified' part of your suggestion is not a requirement, but an implementation detail.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 3 lines · Ingo Molnar
I posit that it's both: and that priorities can be communicated - if only you try as a maintainer. All i'm suggesting is to add 'usable, unified user-space' to the list of unfun priorities, because it's possible and because it matters.
IMHO blaming anybody for it but qemu maintainership is very unfair. They intentionally reinveinted a less self contained, inferior, underperforming, underfeatured wheel instead of doing the right thing and just making sure that it as self contained enough as possible to avoid risking destabilizing their existing codebase. What can anybody (without qemu git commit access) do about it unless qemu git maintainer change attitude, dumps its qemu/kvm-all.c nosense for good, and do the right thing so we can unify for real?
We need to move forward, including multithread the qemu core and be ready to include desktop virtualization protocol when they're ready for submission without being suggested to extend vnc instead to gain a similar speedup (i.e. yet another inferior wheel).
Unification means that _all_ qemu users, pure research, theoretical interest, Xen, virtualbox, weird pure software architecture, will be able to push their stuff in for the common good, but that also shall apply to KVM! It has to become clear that reinveinting inferior wheels instead of merging the real thing, is absolutely time wasteful, unnecessary, and it won't make any difference as far as KVM is concerned, proof is that 0% of userbase runs qemu git to run KVM (except the kvm-all.c developers to test it perhaps or somebody by mistake not adding -kvm prefix to command line maybe). I don't pretend to rate KVM as more important than all the rest of niche usages for qemu but it shall be _as_ important as the rest and it'd be nice one day to be able to install only qemu on a system and get something actually usable in production.
I very much like that qemu gets contributions from everywhere, it's also nice it can run without KVM (that is purely useful as a debugging tool to me but still...). I think it can all happen and unification should be the object for the gain of everyone in both qemu/kvm and even xen and all the rest.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 6 lines · Ingo Molnar
I dont know how you can find the situation of Alpha comparable, which is a legacy architecture for which no new CPU was manufactored in the past ~10 years.
The negative effects of physical obscolescence cannot be overcome even by the very best of development models ...
The maintainers of that architecture could at least continue to maintain it. But that is not the case. Most newer syscalls are not available and overall stability on alpha sucks (kernel crashed when I tried to start Xorg for example) but nobody cares about it. Hardware is still around and there are still some users of it.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line · Joerg Roedel
No, the split-repository situation was the smallest problem after all. Its was a community thing. If the community doesn't work a single-repo project will also fail. [...]
So, what do you think creates code communities and keeps them alive? Developers and code. And the wellbeing of developers are primarily influenced by the repository structure and by the development/maintenance process - i.e. by the 'fun' aspect. (i'm simplifying things there but that's the crux of it.)
Right. A living community needs developers that write new code. And the repository structure is one important thing. But in my opinion it is not the most important one. With my 3-4 years experience in the kernel community I made the experience that the maintainers are the most important factor. I find a maintainer not commiting or caring about patches or not releasing new versions much worse than the wrong repository structure.
oProfile has this problem with its userspace part. I partly made this bad experience with x86-64 before the architecture merge. KVM does not have this problem.
Quoted 5 lines
So yes, i do claim that what stiffled and eventually killed off the Oprofile community was the split repository. None of the other Oprofile shortcomings were really unfixable, but this one was. It gave no way for the community to grow in a healthy way, after the initial phase. Features were more difficult and less fun to develop.
The biggest problem oProfile has is that it does not support per-process measuring. This is indeed not unfixable but it also doesn't fit well in the overall oProfile concept.
Quoted 2 lines
I simply do not want to see KVM face the same fate, and yes i do see similar warnings signs.
In fact, the development process in KVM has improved over time. In the early beginnings everything was kept in svn. Avi switched to git some day but at the time when we had these kvm-XX releases both kernel- and user-space together were unbisectable. This has improved to a point where the kernel-part could be bisected. The KVM maintainers and community have shown in the past that they can address problems with the development process if they come up.
Quoted 8 lines
Oprofile certainly had good developers and maintainers as well. In the end it wasnt enough ...
Also, a project can easily still be 'alive' but not reach its full potential.
Why do you assume that my argument means that KVM isnt viable today? It can very well still be viable and even healthy - just not
_ashealthy_as it could be ...
I am not aware that I made you say anything ;-)
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
The difference is that we dont have KVM with a decade of history and we dont have a 'told you so' KVM reimplementation to show that proves the point. I guess it's a matter of time before that happens, because Qemu usability is so absymal today - so i guess we should suspend any discussions until that happens, no need to waste time on arguing hypoteticals.
Quoted 5 lines
Quoted 2 lines
We actually have lguest which is small. But it lacks functionality and the developer community KVM has attracted.
I suggested long ago to merge lguest into KVM to cover non-VMX/non-SVM execution.
That would have been the best. Rusty already started this work and presented it at the first KVM Forum. But I have never seen patches ...
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
I think you are rationalizing the status quo.
I see that there are issues with KVM today in some areas. You pointed out the desktop usability already. I personally have trouble with the qem-kvm.git because it is unbisectable. But repository unification doesn't solve the problem here.
Why doesnt it solve the bisectability problem? The kernel repo is supposed to be bisectable so that problem would be solved.
Because Marcelo and Avi try to keep as close to upstream qemu as possible. So the qemu repo is regularly merged in qemu-kvm and if you want to bisect you may end up somewhere in the middle of the qemu repository which has only very minimal kvm-support.
The problem here is that two qemu repositorys exist. But the current effort of Anthony is directed to create a single qemu repository. But thats not done overnight.
Merging qemu into the kernel would make Linus in fact a qemu maintainer. I am not sure he wants to be that ;-)
Quoted 13 lines
In my judgement you'd have to do that more frequently, if KVM was properly weighting its priorities. For example regarding this recent KVM commit of yours:
| commit ec1ff79084fccdae0dca9b04b89dcdf3235bbfa1 | Author: Joerg Roedel <[email protected]> | Date: Fri Oct 9 16:08:31 2009 +0200 | | KVM: SVM: Add tracepoint for invlpga instruction | | This patch adds a tracepoint for the event that the guest | executed the INVLPGA instruction.
Quoted 5 lines
With integrated KVM tooling i might have insisted for that new tracepoint to be available to users as well via some more meaningful tooling than just a pure tracepoint.
There's synergies like that all around the place.
True. Tools for better analyzing kvm traces is for sure something that belongs to tools/kvm. I am not sure if anyone has such tools. If yes, they should send it upstream.
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
It's as if you argued in 1990 that the unification of East and West Germany wouldnt make much sense because despite clear problems and incompatibilites and different styles westerners were still allowed to visit eastern relatives and they both spoke the same language after all ;-)
Um, hmm. I don't think these situations have enough in common to compare them ;-)
Probably, but it's an interesting parallel nevertheless ;-)
That for sure ;-)
Joerg
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 4 lines · Joerg Roedel
Quoted 4 lines
Why doesnt it solve the bisectability problem? The kernel repo is supposed to be bisectable so that problem would be solved.
Quoted 8 lines
Because Marcelo and Avi try to keep as close to upstream qemu as possible. So the qemu repo is regularly merged in qemu-kvm and if you want to bisect you may end up somewhere in the middle of the qemu repository which has only very minimal kvm-support.
The problem here is that two qemu repositorys exist. But the current effort of Anthony is directed to create a single qemu repository. But thats not done overnight.
It's in fact possible to bisect qemu-kvm.git. If you end up in qemu.git, do a 'git bisect skip'. If you end up in a merge, call the merge point A, bisect A^1..A^2, each time merging A^1 before compiling (the merge is always trivial due to the way we do it).
Not fun, but it works. When we complete merging kvm integration into qemu.git, this problem will disappear.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Joerg RoedelQuoted 5 lines · Joerg Roedel
Quoted 4 lines · Ingo Molnar
I dont know how you can find the situation of Alpha comparable, which is a legacy architecture for which no new CPU was manufactored in the past ~10 years.
Quoted 8 lines
Quoted 2 lines
The negative effects of physical obscolescence cannot be overcome even by the very best of development models ...
The maintainers of that architecture could at least continue to maintain it. But that is not the case. Most newer syscalls are not available and overall stability on alpha sucks (kernel crashed when I tried to start Xorg for example) but nobody cares about it. Hardware is still around and there are still some users of it.
You are arguing why maintainers do not act as you suggest, against the huge negative effects of physical obscolescence?
Please use common sense: they dont act because ... there are huge negative effects due to physical obscolescence?
No amount of development model engineering can offset that negative.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 10 lines · Ingo Molnar
Quoted 7 lines
If you want to improve this, you need to do the following:
1) Add a userspace daemon that uses vmchannel that runs in the guest and can fetch kallsyms and arbitrary modules. If that daemon lives in
tools/perf, that's fine.Adding any new daemon to an existing guest is a deployment and usability nightmare.
Quoted 9 lines
The basic rule of good instrumentation is to be transparent. The moment we have to modify the user-space of a guest just to monitor it, the purpose of transparent instrumentation is defeated.
That was one of the fundamental usability mistakes of Oprofile.
There is no 'perf' daemon - all the perf functionality is
_builtin_, and for very good reasons. It is one of the main reasons for perf's success as well.
The solution should be a long lived piece of code that runs without kernel privileges. How the code is delivered to the user is a separate problem.
If you want to argue that the kernel should build an initramfs that contains some things that always should be shipped with the kernel but don't need to be within the kernel, I think that's something that's long over due.
We could make it a kernel thread, but what's the point? It's much safer for it to be a userspace thread and it doesn't need to interact with the kernel in an intimate way.
Regards,
Anthony Liguori
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 11 lines · Ingo Molnar
Quoted 8 lines · Avi Kivity
Quoted 6 lines
There were two negative reactions immediately, both showed a fundamental server versus desktop bias:
- you did not accept that the most important usecase is when there is a single guest running.
Well, it isn't.
Quoted 9 lines
Erm, my usability points are _doubly_ true when there are multiple guests ...
The inconvenience of having to type:
perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ --guestmodules=/home/ymzhang/guest/modules topis very obvious even with a single guest. Now multiply that by more guests ...
Yes. That's why I asked how this is handled.
Quoted 11 lines
The crux is: we are working on improving KVM instrumentation. There are working patches posted to this thread and we would like to have/implement an automatism to allow the discovery of all this information. The information should be available to the developer who wants it, and easily/transparently so
- in true Linux fashion.Quoted 4 lines
Quoted 4 lines
- the reaction to the 'how do we get symbols out of the guest' sub-question
was, paraphrased: 'we dont want that due to<unspecified> security threat
to XYZ selinux usecase with lots of guests'.
Quoted 5 lines
Quoted 3 lines
When I review a patch, I try to think of the difficult cases, not just the easy case.
You havent articulated an actionable reason and you have suggested no solution either,
I did suggest a symbol server, and using a well-known location, though I'm unhappy with it. Multiple guest management should be done by the appropriate tools, not qemu or implicitly.
Quoted 3 lines
you just passive-agressive backed the claim that giving developers access to the symbol space is some sort of vague 'security threat'.
Passive-aggressive? Should I see a doctor?
Quoted 12 lines
If that is not so i'd be glad to be proven wrong.
Quoted 9 lines
Quoted 9 lines
Anyone being aware of how Linux and KVM is being used on the desktop will know how detached that attitude is from the typical desktop usecase ...
Usability _never_ sucks because of lack of patches or lack of suggestions. I bet if you made the next server feature contingent on essential usability fixes they'd happen overnight - for God's sake there's been 1000 commits in the last 3 months in the Qemu repository so there's plenty of manpower...
Quoted 4 lines
Quoted 2 lines
First of all I am not a qemu maintainer. [...]
That is the crux of the matter. My experience in these threads was that no-one really seems to feel in charge of the whole thing.
I am comfortable with having someone I trust maintain qemu. While sometimes Anthony overrides me on issues where I know I'm right and he's wrong, still I prefer that to having to do everything myself, I would surely do a worse job due to overload.
I you actually look at qemu patches, the vast majority have little to do directly with kvm; and I (along with Marcelo) maintain the kvm integration in qemu.
Quoted 3 lines
Should we really wonder why
KVM usability sucks?
That wouldn't change at all if I were to maintain it, since I wouldn't start writing a GUI for it and wouldn't force other contributors to do so as a condition for accepting unrelated patches.
Quoted 9 lines
Quoted 5 lines
[...] Second, from my point of view all contributors are volunteers (perhaps their employer volunteered them, but there's no difference from my perspective). Asking them to repaint my apartment as a condition to get a patch applied is abuse. If a patch is good, it gets applied.
This is one of the weirdest arguments i've seen in this thread. Almost all the time do we make contributions conditional on the general shape of the project. Developers dont get to do just the fun stuff.
So, do you think a reply to a patch along the lines of
NAK. Improving scalability is pointless while we don't have a decent
GUI. I'll review you RCU patches
_after_ you've contributed a usable GUI.
?
Quoted 6 lines
This is a basic quid pro quo: new features introduce risks and create additional workload not just to the originating developer but on the rest of the community as well. You should check how Linus has pulled new features in the past 15 years: he very much requires the existing code to first be top-notch before he accepts new features for a given area of functionality.
For a given area, yes. It makes sense to clean up code before changing it, otherwise cruft accumulates rapidly. What you're describing is completely different and amounts to total disregard of contributors' time and effort.
Quoted 5 lines
Doing that and insisting on developers to see those imbalances as well is absolutely essential to code quality: otherwise everyone would be running around implementing just the features they are interested in, without regard for the general health of the project.
The general health of qemu in terms of code quality was indeed pretty bad and there was (and is) a massive effort to modernise it. If you're interested look at qdev and qmp. Both are efforts to improve the infrastructure rather than add features on rotten code, and very successful IMO. There was no effort to write a GUI since no one appears to be motivated to do it except you.
Quoted 6 lines
Of course, if you keep the project in two halves (KVM and Qemu), and pretend that they are separate and have little relation, imbalances of quality can mount up and you can throw your hands up and say that it's "too bad, I'm not maintaining that". It is your basic duty as a Linux maintainer to keep balances of quality. I do it all day, other maintainers do it all day.
IMO qemu quality has improved dramatically in the last year or two.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Usability suckage - and i'm not going to be popular for saying this out loud - almost always shows a basic maintainer disconnect with the real world. See your very first reactions to my 'KVM usability' observations. Read back your and Anthony's replies: total 'sure, patches welcome' kind of indifference. It is
_yourproject_, not some other project down the road ...
Quoted 9 lines
Quoted 3 lines
I could drop everything and write a gtk GUI for qemu. Is that what you want?
No, my suggestion to you (it's up to you whether you give my opinion any weight) is to accept your mistakes and improve, and to not stand in the way of people who'd like to improve the situation. You are happy with the server features and you also made it clear that you dont feel responsible for the rest of the package - which is a big mistake IMO.
If there were no capable maintainer I would reluctantly step in. That is not the case. If I were to displace Anthony then qemu quality would suffer, or I would have to drop kvm maintainership, or, if some false modesty is allowed, perhaps both.
Quoted 3 lines
Also, you have demonstrated it in this thread that you have near zero technical clue about basic desktop and development usability matters
Neither do you. At least I have spent enough time among real usability people to know this. I don't have any pretences in this area and am happy to leave it to the experts. As infrastructure projects kvm and qemu should concentrate on providing flexible capabilities to consumers, which then expose it to users. These consumers can be server-oriented management applications, or end-user GUIs.
My preferred plan for GUIs, btw, is a plugin based approach where qemu exposes its internal objects (the same ones that are exposed to management applications) to the GUI which can then manipulate them, without being co-maintained in the same code base. This allows multiple GUIs (KDE and GNOME) and allows people with a clue to work on them.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Avi Kivity
Quoted 8 lines
Quoted 4 lines
[...] Second, from my point of view all contributors are volunteers (perhaps their employer volunteered them, but there's no difference from my perspective). Asking them to repaint my apartment as a condition to get a patch applied is abuse. If a patch is good, it gets applied.
This is one of the weirdest arguments i've seen in this thread. Almost all the time do we make contributions conditional on the general shape of the project. Developers dont get to do just the fun stuff.
Quoted 7 lines
So, do you think a reply to a patch along the lines of
NAK. Improving scalability is pointless while we don't have a decent GUI.
I'll review you RCU patches
_after_ you've contributed a usable GUI.?
What does this have to do with RCU?
I'm talking about KVM, which is a Linux kernel feature that is useless without a proper, KVM-specific app making use of it.
RCU is a general kernel performance feature that works across the board. It helps KVM indirectly, and it helps many other kernel subsystems as well. It needs no user-space tool to be useful.
KVM on the other hand is useless without a user-space tool.
[ Theoretically you might have a fair point if it were a critical feature of
RCU for it to have a GUI, and if the main tool that made use of it sucked. But it isnt and you should know that. ]
Had you suggested the following 'NAK', applied to a different, relevant subsystem:
| NAK. Improving scalability is pointless while we don't have a usable | tool. I'll review you perf patches _after_ you've contributed a usable | tool.
you would have a fair point. In fact, we are doing that we are living by that. It makes absolutely zero sense to improve the scalability of perf if its usability sucks.
So where you are trying to point out an inconsistency in my argument there is none.
Quoted 8 lines
Quoted 6 lines
This is a basic quid pro quo: new features introduce risks and create additional workload not just to the originating developer but on the rest of the community as well. You should check how Linus has pulled new features in the past 15 years: he very much requires the existing code to first be top-notch before he accepts new features for a given area of functionality.
For a given area, yes. [...]
That is my precise point.
KVM is a specific subsystem or "area" that makes no sense without the user-space tooling it relates to. You seem to argue that you have no 'right' to insist on good quality of that tooling - and IMO you are fundamentally wrong with that.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Avi Kivity
Quoted 9 lines
Quoted 5 lines
[...] Second, from my point of view all contributors are volunteers (perhaps their employer volunteered them, but there's no difference from my perspective). Asking them to repaint my apartment as a condition to get a patch applied is abuse. If a patch is good, it gets applied.
This is one of the weirdest arguments i've seen in this thread. Almost all the time do we make contributions conditional on the general shape of the project. Developers dont get to do just the fun stuff.
So, do you think a reply to a patch along the lines of
Quoted 8 lines
Quoted 6 lines
NAK. Improving scalability is pointless while we don't have a decent GUI.
I'll review you RCU patches
_after_ you've contributed a usable GUI.?
What does this have to do with RCU?
The example was rcuifying kvm which took place a bit ago. Sorry, it wasn't clear.
Quoted 7 lines
I'm talking about KVM, which is a Linux kernel feature that is useless without a proper, KVM-specific app making use of it.
RCU is a general kernel performance feature that works across the board. It helps KVM indirectly, and it helps many other kernel subsystems as well. It needs no user-space tool to be useful.
Correct. So should I tell someone that has sent a patch that rcu-ified kvm in order to scale it, that I won't accept the patch unless they do some usability userspace work? say, implementing an eject button. That's what I understood you to mean.
Quoted 6 lines
KVM on the other hand is useless without a user-space tool.
[ Theoretically you might have a fair point if it were a critical feature of
RCU for it to have a GUI, and if the main tool that made use of it sucked. But it isnt and you should know that. ]
Quoted 7 lines
Had you suggested the following 'NAK', applied to a different, relevant subsystem:
| NAK. Improving scalability is pointless while we don't have a usable | tool. I'll review you perf patches _after_ you've contributed a usable | tool.
That might hold, but the tool is usable at least for some people - it runs in production. The people running it won't benefit from an eject button or any usability improvement since they run it through a centralized management tool that hides everything. They will benefit from the scalability patches. Should I still make those patches conditional on scalability work that is of no interest to the submitter?
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
This is a basic quid pro quo: new features introduce risks and create additional workload not just to the originating developer but on the rest of the community as well. You should check how Linus has pulled new features in the past 15 years: he very much requires the existing code to first be top-notch before he accepts new features for a given area of functionality.
Quoted 9 lines
Quoted 2 lines
For a given area, yes. [...]
That is my precise point.
KVM is a specific subsystem or "area" that makes no sense without the user-space tooling it relates to. You seem to argue that you have no 'right' to insist on good quality of that tooling - and IMO you are fundamentally wrong with that.
kvm contains many sub-areas. I'm not going to tie unrelated things together like the GUI and sclability, configuration file format and emulator correctness, nested virtualization and qcow2 asynchronity, or other crazy combinations. People either leave en mass or become frustrated if they can't. I do reject patches touching a sub-area that I think need to be done in userspace, for example.
That's not to say kvm development is random. We have a weekly conference call where regular contributors and maintainers of both qemu and kvm participate and where we decide where to focus. Sadly the issue of a qemu GUI is not raised often. Perhaps you can participate and voice your concerns.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 25 lines · Avi Kivity
Quoted 9 lines · Ingo Molnar
Quoted 7 lines · Avi Kivity
Quoted 7 lines
Quoted 4 lines
[...] Second, from my point of view all contributors are volunteers (perhaps their employer volunteered them, but there's no difference from my perspective). Asking them to repaint my apartment as a condition to get a patch applied is abuse. If a patch is good, it gets applied.
This is one of the weirdest arguments i've seen in this thread. Almost all the time do we make contributions conditional on the general shape of the project. Developers dont get to do just the fun stuff.
Quoted 8 lines
Quoted 7 lines
So, do you think a reply to a patch along the lines of
NAK. Improving scalability is pointless while we don't have a decent GUI.
I'll review you RCU patches
_after_ you've contributed a usable GUI.?
What does this have to do with RCU?
The example was rcuifying kvm which took place a bit ago. Sorry, it wasn't clear.
Quoted 3 lines
I'm talking about KVM, which is a Linux kernel feature that is useless without a proper, KVM-specific app making use of it.
Quoted 8 lines
Quoted 3 lines
RCU is a general kernel performance feature that works across the board. It helps KVM indirectly, and it helps many other kernel subsystems as well. It needs no user-space tool to be useful.
Correct. So should I tell someone that has sent a patch that rcu-ified kvm in order to scale it, that I won't accept the patch unless they do some usability userspace work? say, implementing an eject button. That's what I understood you to mean.
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. '
Although this RCU example is 'worst' possible example, as it's a pure speedup change with no functionality effect.
Consider the _other_ examples that are a lot more clear:
' If you expose paravirt spilocks via KVM please also make sure the KVM
tooling can make use of it, has an option for it to configure it, and that it has sufficient efficiency statistics displayed in the tool for admins to monitor.'
' If you create this new paravirt driver then please also make sure it can
be configured in the tooling. '
' Please also add a testcase for this bug to tools/kvm/testcases/ so we dont
repeat this same mistake in the future. '
I'd say most of the high-level feature work in KVM has tooling impact.
And note the important arguement that the 'eject button' thing would not occur naturally in a project that is well designed and has a good quality balance. It would only occur in the transitionary period if a big lump of lower-quality code is unified with higher-quality code. Then indeed a lot of pressure gets created on the people working on the high-quality portion to go over and fix the low-quality portion.
Which, btw., is an unconditonally good thing ...
But even an RCU speedup can be fairly linked/ordered to more pressing needs of a project.
Really, the unification of two tightly related pieces of code has numerous clear advantages. Please give it some thought before rejecting it.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 10 lines · Ingo Molnar
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. '
That would be shooting at my own foot as well as the contributor's since I badly want that RCU stuff, and while a GUI would be nice, that itch isn't on my back.
You're asking a developer and a maintainer to put off the work they're interested in, in order to work on something someone else is interested in, but not contributing the work.
Quoted 10 lines
Although this RCU example is 'worst' possible example, as it's a pure speedup change with no functionality effect.
Consider the _other_ examples that are a lot more clear:
' If you expose paravirt spilocks via KVM please also make sure the KVM
tooling can make use of it, has an option for it to configure it, and that it has sufficient efficiency statistics displayed in the tool for admins to monitor.'
Quoted 6 lines
' If you create this new paravirt driver then please also make sure it can
be configured in the tooling. '' Please also add a testcase for this bug to
tools/kvm/testcases/so we dont
repeat this same mistake in the future. '
All three happen quite commonly in qemu/kvm development. Of course someone who develops a feature also develops a patch that exposes it in qemu. There are several test cases in qemu-kvm.git/kvm/user/test.
Quoted 2 lines
I'd say most of the high-level feature work in KVM has tooling impact.
Usually, pretty low. Plumbing down a feature is usually trivial. There are exceptions, of course - smp is only supported in qemu-kvm.git, not in upstream qemu.git, for example. In any case of course the work is done in both qemu and kvm - do you think people develop features to see them bitrot?
Quoted 7 lines
And note the important arguement that the 'eject button' thing would not occur naturally in a project that is well designed and has a good quality balance. It would only occur in the transitionary period if a big lump of lower-quality code is unified with higher-quality code. Then indeed a lot of pressure gets created on the people working on the high-quality portion to go over and fix the low-quality portion.
It's a matter of priorities.
Quoted 5 lines
Which, btw., is an unconditonally good thing ...
But even an RCU speedup can be fairly linked/ordered to more pressing needs of a project.
Pressing to whom?
Quoted 3 lines
Really, the unification of two tightly related pieces of code has numerous clear advantages. Please give it some thought before rejecting it.
I'm not blind to the advantages. Dropping tcg would be the biggest of them by far (much more than moving the repository, IMO). But there are disadvantages as well.
Around two years ago I seriously considered forking qemu, at this time I do not think it is a good idea.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Avi Kivity
Quoted 9 lines · Ingo Molnar
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. '
Quoted 3 lines
That would be shooting at my own foot as well as the contributor's since I badly want that RCU stuff, and while a GUI would be nice, that itch isn't on my back.
I think this sums up the root cause of all the problems i see with KVM pretty well.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Avi Kivity
Quoted 9 lines · Ingo Molnar
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. '
Quoted 7 lines
Quoted 4 lines
That would be shooting at my own foot as well as the contributor's since I badly want that RCU stuff, and while a GUI would be nice, that itch isn't on my back.
I think this sums up the root cause of all the problems i see with KVM pretty well.
A good maintainer has to strike a balance between asking more of people than what they initially volunteer and getting people to implement the less fun things that are nonetheless required. The kernel can take this to an extreme because at the end of the day, it's the only game in town and there is an unending number of potential volunteers. Most other projects are not quite as fortunate.
When someone submits a patch set to QEMU implementing a new network backend for raw sockets, we can push back about how it fits into the entire stack wrt security, usability, etc. Ultimately, we can arrive at a different, more user friendly solution (networking helpers) and along with some time investment on my part, we can create a much nicer, more user friendly solution. Still command line based though.
Responding to such a patch set with, replace the SDL front end with a GTK one that lets you graphically configure networking, is not reasonable and the result would be one less QEMU contributor in the long run.
Overtime, we can, and are, pushing people to focus more on usability. But that doesn't get you a first class GTK GUI overnight. The only way you're going to get that is by having a contributor be specifically interesting in building such a thing.
We simply haven't had that in the past 5 years that I've been involved in the project. If someone stepped up to build this, I'd certainly support it in every way possible and there are probably some steps we could take to even further encourage this.
Regards,
Anthony Liguori
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 15 lines · Anthony Liguori
Quoted 14 lines · Ingo Molnar
Quoted 12 lines · Avi Kivity
Quoted 8 lines · Ingo Molnar
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. 'That would be shooting at my own foot as well as the contributor's since I badly want that RCU stuff, and while a GUI would be nice, that itch isn't on my back.
Quoted 6 lines
Quoted 2 lines
I think this sums up the root cause of all the problems i see with KVM pretty well.
A good maintainer has to strike a balance between asking more of people than what they initially volunteer and getting people to implement the less fun things that are nonetheless required. [...]
Sorry to be blunt, but i dont think there's a different way to say it: i am a user of the software you are maintaining (Qemu) and i dont think you have the basis to educate people about what a good maintainer should do to achieve a quality end result.
I think you could/should learn much from Linus and others who very much require quality to permeate the full dimension of a contribution (including usability), beyond the narrow, local scope of the contribution.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 14 lines · Ingo Molnar
Quoted 11 lines · Avi Kivity
Quoted 9 lines · Ingo Molnar
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. '
Quoted 7 lines
Quoted 4 lines
That would be shooting at my own foot as well as the contributor's since I badly want that RCU stuff, and while a GUI would be nice, that itch isn't on my back.
I think this sums up the root cause of all the problems i see with KVM pretty well.
I think we agree at last. Neither I nor my employer are interested in running qemu as a desktop-on-desktop tool, therefore I don't invest any effort in that direction, or require it from volunteers.
If you think a good GUI is so badly needed, either write one yourself, or convince someone else to do it.
(btw, why are you interested in desktop-on-desktop? one use case is developers, which don't really need fancy GUIs; a second is people who test out distributions, but that doesn't seem to be a huge population; and a third is people running Windows for some application that doesn't run on Linux - hopefully a small catergory as well. Seems to be quite a small target audience, compared to, say, video editing)
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 15 lines · Avi Kivity
Quoted 14 lines · Ingo Molnar
Quoted 12 lines · Avi Kivity
Quoted 8 lines · Ingo Molnar
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. 'That would be shooting at my own foot as well as the contributor's since I badly want that RCU stuff, and while a GUI would be nice, that itch isn't on my back.
Quoted 6 lines
Quoted 2 lines
I think this sums up the root cause of all the problems i see with KVM pretty well.
I think we agree at last. Neither I nor my employer are interested in running qemu as a desktop-on-desktop tool, therefore I don't invest any effort in that direction, or require it from volunteers.
Obviously your employer at least in part defers to you when it comes to KVM priorities.
So, just to make this really clear, _you_ are not interested in running qemu as a desktop-on-desktop tool, subsequently this kind of disinterest-for-desktop-usability trickled through the whole KVM stack and poisoned your attitude and your contributor's attitude.
Too sad really and it's doubly sad that you dont feel anything wrong about that.
Quoted 2 lines
If you think a good GUI is so badly needed, either write one yourself, or convince someone else to do it.
To a certain degree we are trying to do a small bit of that (see this very thread) - and you are NAK-ing and objecting the heck out of it via your unreasonable microkernelish and server-centric views.
With constant maintainer disinterest there's no wonder a non-desktop-oriented KVM becomes a self-fulfilling prophecy: you think the desktop does not matter, hence it becomes a reality in KVM space which you can constantly refer back to as a 'fact'.
Which i find dishonest and disingenious at best.
Quoted 6 lines
(btw, why are you interested in desktop-on-desktop? one use case is developers, which don't really need fancy GUIs; a second is people who test out distributions, but that doesn't seem to be a huge population; and a third is people running Windows for some application that doesn't run on Linux - hopefully a small catergory as well. Seems to be quite a small target audience, compared to, say, video editing)
I'm interested in desktop-on-desktop because i walk this world with open eyes and i care about Linux, and these days qemu-kvm is the first thing a new Linux user sees about Linux virtualization. I've observed several people i know in person to turn away from Linux and go back to Windows or go over to Apple because they had a much more mature solution.
I'd probably turn away from Linux myself if i were a newbie and if i were forced to use KVM on the desktop today.
Again, you dont seem to realize that you as a maintainer are at a central point where you have the ability to turn the self-fulfilling prophecy that 'nobody cares about the Linux desktop' into a reality - or where you have the ability to prevent it from happening. It is hugely harmful process, especially as you seem to delude yourself that you have nothing to do with it.
Anyway, it's good you expressed your views about this as this will help the chances of a fresh restart. (which chances are still not too good though)
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 28 lines · Ingo Molnar
Quoted 15 lines · Avi Kivity
Quoted 14 lines · Ingo Molnar
Quoted 12 lines · Avi Kivity
Quoted 8 lines · Ingo Molnar
Of course you could say the following:
' Thanks, I'll mark this for v2.6.36 integration. Note that we are not
able to add this to the v2.6.35 kernel queue anymore as the ongoing usability work already takes up all of the project's maintainer and testing bandwidth. If you want the feature to be merged sooner than that then please help us cut down on the TODO and BUGS list that can be found at XYZ. There's quite a few low hanging fruits there. 'That would be shooting at my own foot as well as the contributor's since I badly want that RCU stuff, and while a GUI would be nice, that itch isn't on my back.
Quoted 6 lines
Quoted 2 lines
I think this sums up the root cause of all the problems i see with KVM pretty well.
I think we agree at last. Neither I nor my employer are interested in running qemu as a desktop-on-desktop tool, therefore I don't invest any effort in that direction, or require it from volunteers.
Obviously your employer at least in part defers to you when it comes to KVM priorities.
Quoted 7 lines
So, just to make this really clear, _you_ are not interested in running qemu as a desktop-on-desktop tool, subsequently this kind of disinterest-for-desktop-usability trickled through the whole KVM stack and poisoned your attitude and your contributor's attitude.
Too sad really and it's doubly sad that you dont feel anything wrong about that.
Please, don't jump to unjust conclusions.
The whole point is that there's no money behind desktop-on-desktop virtualization. Thus nobody pays people to work on it. Thus nothing significant happens in that space.
If there was someone standing up to create a really decent desktop qemu front-end I'm confident we'd even officially suggest using that. In fact, that whole discussion did come up in the weekly Qemu/KVM community call and everybody agreed heavily that we do need a desktop client.
The problem is just that there is nobody standing up. And I hope you don't expect Avi to be the one creating a GUI.
Alex
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Am Montag, den 22.03.2010, 12:23 +0100 schrieb Alexander Graf:
Quoted 21 lines
Quoted 7 lines
Quoted 3 lines
I think we agree at last. Neither I nor my employer are interested in running qemu as a desktop-on-desktop tool, therefore I don't invest any effort in that direction, or require it from volunteers.
Obviously your employer at least in part defers to you when it comes to KVM priorities.
Quoted 7 lines
So, just to make this really clear, _you_ are not interested in running qemu as a desktop-on-desktop tool, subsequently this kind of disinterest-for-desktop-usability trickled through the whole KVM stack and poisoned your attitude and your contributor's attitude.
Too sad really and it's doubly sad that you dont feel anything wrong about that.
Please, don't jump to unjust conclusions.
The whole point is that there's no money behind desktop-on-desktop virtualization. Thus nobody pays people to work on it. Thus nothing significant happens in that space.
Quoted 8 lines
If there was someone standing up to create a really decent desktop qemu front-end I'm confident we'd even officially suggest using that. In fact, that whole discussion did come up in the weekly Qemu/KVM community call and everybody agreed heavily that we do need a desktop client.
The problem is just that there is nobody standing up. And I hope you don't expect Avi to be the one creating a GUI.
Besides, Ingo could just go ahead and use libvirt together with virt-manager. It solves a few of the usability issues he came up with somewhere in this thread, is available even in every current distribution, and *actually* works quite well for the desktop usecase. It just desparatly needs more brainpower and manpower to make it a competitor to VirtualBox & Co, because its not as polished and featurecomplete yet. But I bet virt-managers maintainers welcome patches to fix and enhance usability. Most of the needed fixes probably wouldn't touch qemu at all, let alone kvm.
Sorry to chime in with my opinion, but this whole thread is incredibly boring and full of non-arguments yet really highly amusing.
Signature · 1 line
Lukas
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 8 lines · Ingo Molnar
Quoted 5 lines
I think we agree at last. Neither I nor my employer are interested in running qemu as a desktop-on-desktop tool, therefore I don't invest any effort in that direction, or require it from volunteers.
Obviously your employer at least in part defers to you when it comes to KVM priorities.
In part, yes.
Quoted 5 lines
So, just to make this really clear, _you_ are not interested in running qemu as a desktop-on-desktop tool, subsequently this kind of disinterest-for-desktop-usability trickled through the whole KVM stack and poisoned your attitude and your contributor's attitude.
I am also disinterested in ppc virtualization, yet it happened. I am disinterested in ia64 virtualization, yet it happened. I am disinterested in s390 virtualization, yet it happened.
Linus doesn't care about virtualization, yet it happened.
I don't tell my contributor what to be interested in, only whether their patches are good or not. I can tell you that Red Hat contributors don't work on a desktop kvm GUI not because I discourage them, but because the product we are working on does not contain a desktop kvm GUI. Jan Kiszka contributed a lot of debugger features, fixes, and improvement, presumably he and/or his employer need that more than a kvm desktop GUI.
I can't see why you see anything wrong with this. People write patches for their own interest, not yours or mine.
Quoted 3 lines
Too sad really and it's doubly sad that you dont feel anything wrong about that.
It would be lovely to have a desktop kvm GUI. I don't feel I have to write it myself or compel others to write it. I don't feel sad about it.
Quoted 7 lines
Quoted 3 lines
If you think a good GUI is so badly needed, either write one yourself, or convince someone else to do it.
To a certain degree we are trying to do a small bit of that (see this very thread) - and you are NAK-ing and objecting the heck out of it via your unreasonable microkernelish and server-centric views.
The perf bits have nothing to do with a GUI or usability for general users. Calling them "unreasonable microkernelish sever-centric views" is just a way of not addressing them.
Quoted 5 lines
With constant maintainer disinterest there's no wonder a non-desktop-oriented KVM becomes a self-fulfilling prophecy: you think the desktop does not matter, hence it becomes a reality in KVM space which you can constantly refer back to as a 'fact'.
It's a fact that virtualization is happening in the data center, not on the desktop. You think a kvm GUI can become a killer application? fine, write one. You don't need any consent from me as kvm maintainer (if patches are needed to kvm that improve the desktop experience, I'll accept them, though they'll have to pass my unreasonable microkernelish filters). If you're right then the desktop kvm GUI will be a huge hit with zillions of developers and people will drop Windows and switch to Linux just to use it.
But my opinion is that it will end up like virtualbox, a nice app that you can use to run Windows-on-Linux, but is not all that useful.
Quoted 2 lines
Which i find dishonest and disingenious at best.
If you're going to use words like 'dishonest' then please don't send me any more email.
Quoted 7 lines
Quoted 7 lines
(btw, why are you interested in desktop-on-desktop? one use case is developers, which don't really need fancy GUIs; a second is people who test out distributions, but that doesn't seem to be a huge population; and a third is people running Windows for some application that doesn't run on Linux - hopefully a small catergory as well. Seems to be quite a small target audience, compared to, say, video editing)
Quoted 6 lines
I'm interested in desktop-on-desktop because i walk this world with open eyes and i care about Linux, and these days qemu-kvm is the first thing a new Linux user sees about Linux virtualization. I've observed several people i know in person to turn away from Linux and go back to Windows or go over to Apple because they had a much more mature solution.
Which distribution are they using? Most people would see virt-manager as the first thing, not open gnome-terminal and start typing in the qemu command line. While it's not perfect, it does have a shiny GUI with lots of tabs and buttons.
Quoted 9 lines
I'd probably turn away from Linux myself if i were a newbie and if i were forced to use KVM on the desktop today.
Again, you dont seem to realize that you as a maintainer are at a central point where you have the ability to turn the self-fulfilling prophecy that 'nobody cares about the Linux desktop' into a reality - or where you have the ability to prevent it from happening. It is hugely harmful process, especially as you seem to delude yourself that you have nothing to do with it.
It doesn't have to be me. Better to pick someone who has a clue about usability to design and guide this effort. That someone can work on qemu, or if they prefer, tools/kvm (we worked hard to avoid making kvm tied to a single userspace).
The kvm toolstack is maintained by multiple people - Marcelo and myself at the kernel level, Anthony and the other qemu maintainers at the qemu single-guest level, Daniel Veillard and Dan Berrange at the libvirt or host level, and Cole Robinson at the virt-manager or GUI level. It's unreasonable to ask one person to do all of this, just like Linus doesn't maintain the scheduler even though it is so important.
Quoted 3 lines
Anyway, it's good you expressed your views about this as this will help the chances of a fresh restart. (which chances are still not too good though)
All that's needed is to find someone with the skills, time, and interest.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 15 lines · Avi Kivity
Quoted 6 lines · Ingo Molnar
Quoted 4 lines
I think we agree at last. Neither I nor my employer are interested in running qemu as a desktop-on-desktop tool, therefore I don't invest any effort in that direction, or require it from volunteers.
Obviously your employer at least in part defers to you when it comes to KVM priorities.
In part, yes.
Quoted 4 lines
So, just to make this really clear, _you_ are not interested in running qemu as a desktop-on-desktop tool, subsequently this kind of disinterest-for-desktop-usability trickled through the whole KVM stack and poisoned your attitude and your contributor's attitude.
Quoted 5 lines
I am also disinterested in ppc virtualization, yet it happened. I am disinterested in ia64 virtualization, yet it happened. I am disinterested in s390 virtualization, yet it happened.
Linus doesn't care about virtualization, yet it happened.
You should know the answer yourself: the difference is that usability is a core quality of any project.
I as a maintainer can be neutral towards a number of features and patch attributes that i dont consider key aspects. (although they can grow out to become key features in the future. SMP was a fringe thing 15 years ago.)
Usability is not an attribute you can ignore and i for sure am never neutral towards usability deficiencies in patches - i consider usability a key quality.
Quoted 2 lines
I don't tell my contributor what to be interested in, only whether their patches are good or not. [...]
Whether a feature is usable or not is sure a metric of 'goodness'.
You have restricted your metric of goodness artificially to not include usability. You do that by claiming that the user-space tooling of KVM, while being functionally absolutely essential for any user to even try out KVM, is 'separate' and has no quality connection with the kernel bits of KVM.
It is a convenient argument that allows you to do the kernel bits only. It is absolutely catastrophic to the user who'd like to see a usable solution and a single project who stands behind their tech.
Thus, _today_, after years of neglect, you can claim that none of the dozens of usability problems of KVM has anything to do with the features you are working on today. It's in a separate project (the so-called 'Qemu' package) after all - none of KVM's business.
In reality if you consider it a single project then those bugs were all usability problems introduced earlier on, years ago, when a piece of functionality was exposed via KVM. It adds up and now you claim they have nothing to do with current work.
This is why i consider that line of argument rather dishonest ...
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 2 lines · Ingo Molnar
This is why i consider that line of argument rather dishonest ...
I am not going to reply to any more email from you on this thread.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 4 lines · Avi Kivity
Quoted 1 line · Ingo Molnar
This is why i consider that line of argument rather dishonest ...
I am not going to reply to any more email from you on this thread.
Because i pointed out that i consider a line of argument intellectually dishonest?
I did not say _you_ as a person are dishonest - doing that would be an ad honimen attack against your person. (In fact i dont think you are, to the contrary)
An argument can certainly be labeled dishonest in a fair discussion and it is not a personal attack against you to express my opinion about that.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 12 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 2 lines · Ingo Molnar
This is why i consider that line of argument rather dishonest ...
I am not going to reply to any more email from you on this thread.
Because i pointed out that i consider a line of argument intellectually dishonest?
Quoted 7 lines
I did not say _you_ as a person are dishonest - doing that would be an ad honimen attack against your person. (In fact i dont think you are, to the contrary)
An argument can certainly be labeled dishonest in a fair discussion and it is not a personal attack against you to express my opinion about that.
You're being excessively rude in this thread. That might be acceptable on LKML but it's not how the QEMU and KVM communities behave. This thread is a good example of why LKML has the reputation it has. Avi and I argue all of the time on qemu-devel and kvm-devel and it's never degraded into a series of personal attacks like this.
I've been trying very hard to turn this into a productive thread attempting to capture your feedback and give clear suggestions about how you can solve achieve your desired functionality.
What are you looking to achieve? To you just want to piss and moan about how terrible you think Avi and I are? Or do you want to try to actually help make things better?
If you want to help make things better, please focus on making constructive suggestions and clarifying what you see as requirements.
Regards,
Anthony Liguori
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Anthony Liguori
[...]
I've been trying very hard to turn this into a productive thread attempting to capture your feedback and give clear suggestions about how you can solve achieve your desired functionality.
I'm glad that we are at this more productive stage. I'm still trying to achieve the very same technological capabilities that i expressed in the first few mails when i reviewed the 'perf kvm' patch that was submitted by Yanmin.
The crux of the problem is very simple. To quote my earlier mail:
| | - The inconvenience of having to type: | perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ | --guestmodules=/home/ymzhang/guest/modules top | | | is very obvious even with a single guest. Now multiply that by more guests ... |
For example we want 'perf kvm top' to do something useful by default: it should find the first guest running and it should report its profile.
The tool shouldnt have to guess about where the guests are, what their namespaces is and how to talk to them. We also want easy symbolic access to guest, for example:
perf kvm -g OpenSuse-2 record sleep 1
I.e.:
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
- Guest-transparent VFS integration into the host, to recover symbols and debug info in binaries, etc.
There were a few responses to that but none really addressed those problems - they mostly tried to re-define the problem and suggested that i was wrong to want such capabilities and suggested various inferior approaches instead. See the thread for the details - i think i covered every technical suggestion that was made.
So we are still at an impasse as far as i can see. If i overlooked some suggestion that addresses these problems then please let me know ...
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 24 lines · Ingo Molnar
Quoted 6 lines · Anthony Liguori
[...]
I've been trying very hard to turn this into a productive thread attempting to capture your feedback and give clear suggestions about how you can solve achieve your desired functionality.
I'm glad that we are at this more productive stage. I'm still trying to achieve the very same technological capabilities that i expressed in the first few mails when i reviewed the 'perf kvm' patch that was submitted by Yanmin.
The crux of the problem is very simple. To quote my earlier mail:
| | - The inconvenience of having to type: | perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ | --guestmodules=/home/ymzhang/guest/modules top | | | is very obvious even with a single guest. Now multiply that by more guests ... |
Quoted 9 lines
For example we want 'perf kvm top' to do something useful by default: it should find the first guest running and it should report its profile.
The tool shouldnt have to guess about where the guests are, what their namespaces is and how to talk to them. We also want easy symbolic access to guest, for example:
perf kvm -g OpenSuse-2 record sleep 1
Two things are needed. The first thing needed is to be able to enumerate running guests and identify a symbolic name. I have a patch for this and it'll be posted this week or so. perf will need to have a QMP client and it will need to look in ${HOME}/.qemu/qmp/ to sockets to connect to.
This is too much to expect from a client and we've got a GSoC idea posted to make a nice library for tools to use to simplify this.
The sockets are named based on UUID and you'll have to connect to a guest and ask it for it's name. Some guests don't have names so we'll have to come up with a clever way to describe a nameless VM.
Quoted 7 lines
I.e.:
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
A guest is not a KVM concept. It's a qemu concept so it needs to be something provided by qemu. The other caveat is that you won't see guests created by libvirt because we're implementing this in terms of a default QMP device and libvirt will disable defaults. This is desired behaviour. libvirt wants to be in complete control and doesn't want a tool like perf interacting with a guest directly.
Quoted 3 lines
- Guest-transparent VFS integration into the host, to recover symbols and debug info in binaries, etc.
The way I'd like to see this implemented is a guest userspace daemon. I think having the guest userspace daemon be something that can be updated by the host is reasonable.
In terms of exposing that on the host, my preferred approach is QMP. I'd be happy with a QMP command that is essentially, guest_fs_read(filename) and guest_fd_readdir(path).
If desired, one could implement a fuse filesystem that interacted with all local qemu instances to expose this on the host. There's a lot of ugly things about fuse though so I think sticking to QMP is best (particularly with respect to root access of a fuse filesystem).
With just those couple things in place, perf should be able to do exactly what you want it to do.
Regards,
Anthony Liguroi
Quoted 13 lines
There were a few responses to that but none really addressed those problems - they mostly tried to re-define the problem and suggested that i was wrong to want such capabilities and suggested various inferior approaches instead. See the thread for the details - i think i covered every technical suggestion that was made.
So we are still at an impasse as far as i can see. If i overlooked some suggestion that addresses these problems then please let me know ...
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 32 lines · Anthony Liguori
Quoted 22 lines · Ingo Molnar
Quoted 5 lines · Anthony Liguori
[...]
I've been trying very hard to turn this into a productive thread attempting to capture your feedback and give clear suggestions about how you can solve achieve your desired functionality.
I'm glad that we are at this more productive stage. I'm still trying to achieve the very same technological capabilities that i expressed in the first few mails when i reviewed the 'perf kvm' patch that was submitted by Yanmin.
The crux of the problem is very simple. To quote my earlier mail:
| | - The inconvenience of having to type: | perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ | --guestmodules=/home/ymzhang/guest/modules top | | | is very obvious even with a single guest. Now multiply that by more guests ... |Quoted 8 lines
For example we want 'perf kvm top' to do something useful by default: it should find the first guest running and it should report its profile.
The tool shouldnt have to guess about where the guests are, what their namespaces is and how to talk to them. We also want easy symbolic access to guest, for example:
perf kvm -g OpenSuse-2 record sleep 1
Quoted 7 lines
Two things are needed. The first thing needed is to be able to enumerate running guests and identify a symbolic name. I have a patch for this and it'll be posted this week or so. perf will need to have a QMP client and it will need to look in ${HOME}/.qemu/qmp/ to sockets to connect to.
This is too much to expect from a client and we've got a GSoC idea posted to make a nice library for tools to use to simplify this.
Ok, that sounds interesting! I'd rather see some raw mechanism that 'perf kvm' could use instead of having to require yet another library (which generally dampens adoption of a tool). So i think we can work from there.
Btw., have you considered using Qemu's command name (task->comm[]) as the symbolic name? That way we could see the guest name in 'top' on the host - a nice touch.
Quoted 3 lines
The sockets are named based on UUID and you'll have to connect to a guest and ask it for it's name. Some guests don't have names so we'll have to come up with a clever way to describe a nameless VM.
I think just exposing the UUID in that lazy case would be adequate? It creates pressure for VM launchers to use better symbolic names.
Quoted 7 lines
Quoted 6 lines
I.e.:
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
Quoted 6 lines
A guest is not a KVM concept. It's a qemu concept so it needs to be something provided by qemu. The other caveat is that you won't see guests created by libvirt because we're implementing this in terms of a default QMP device and libvirt will disable defaults. This is desired behaviour. libvirt wants to be in complete control and doesn't want a tool like perf interacting with a guest directly.
Hm, this sucks for multiple reasons. Firstly, perf isnt a tool that 'interacts', it's an observation tool: just like 'top' is an observation tool.
We want to enable developers to see all activities on the system - regardless of who started the VM or who started the process. Imagine if we had a way to hide tasks to hide from 'top'. It would be rather awful.
Secondly, it tells us that the concept is fragile if it doesnt automatically enumerate all guests, regardless of how they were created.
Full system enumeration is generally best left to the kernel, as it can offer coherent access.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Ingo Molnar
Ok, that sounds interesting! I'd rather see some raw mechanism that 'perf kvm' could use instead of having to require yet another library (which generally dampens adoption of a tool). So i think we can work from there.
You can access the protocol directly if you don't want a library dependency.
Quoted 4 lines
Btw., have you considered using Qemu's command name (task->comm[]) as the symbolic name? That way we could see the guest name in 'top' on the host - a nice touch.
qemu-system-x86_64 -name Fedora,process=qemu-Fedora
Does exactly that. We don't make this default based on the element of least surprise. Many users expect to be able to do killall qemu-system-x86 and if we did this by default, that wouldn't work.
Quoted 7 lines
Quoted 4 lines
The sockets are named based on UUID and you'll have to connect to a guest and ask it for it's name. Some guests don't have names so we'll have to come up with a clever way to describe a nameless VM.
I think just exposing the UUID in that lazy case would be adequate? It creates pressure for VM launchers to use better symbolic names.
Yup.
Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
I.e.:
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
Quoted 7 lines
A guest is not a KVM concept. It's a qemu concept so it needs to be something provided by qemu. The other caveat is that you won't see guests created by libvirt because we're implementing this in terms of a default QMP device and libvirt will disable defaults. This is desired behaviour. libvirt wants to be in complete control and doesn't want a tool like perf interacting with a guest directly.
Hm, this sucks for multiple reasons. Firstly, perf isnt a tool that 'interacts', it's an observation tool: just like 'top' is an observation tool.
Quoted 7 lines
We want to enable developers to see all activities on the system - regardless of who started the VM or who started the process. Imagine if we had a way to hide tasks to hide from 'top'. It would be rather awful.
Secondly, it tells us that the concept is fragile if it doesnt automatically enumerate all guests, regardless of how they were created.
Perf does interact with a guest though because it queries a guest to read it's file system.
I understand the point you're making though. If instead of doing a pull interface where the host queries the guest for files, if the guest pushed a small set of files at startup which the host cached, then you could potentially unconditionally expose a "read-only" socket that only exposed limited information.
Quoted 3 lines
Full system enumeration is generally best left to the kernel, as it can offer coherent access.
I don't see why qemu can't offer coherent access. The limitation today is intentional and if it's overly restrictive, we can figure out a means to change it.
Regards,
Anthony Liguori
Quoted 2 lines
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Anthony LiguoriQuoted 6 lines · Anthony Liguori
Quoted 4 lines
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
A guest is not a KVM concept. [...]
Well, in a sense a guest is a KVM concept too: it's in essence represented via the 'vcpu state attached to a struct mm' abstraction that is attached to the /dev/kvm file descriptor attached to a Linux process.
Multiple vcpus can be started by the same process to represent SMP, but the whole guest notion is present: a Linux MM that carries KVM state.
In that sense when we type 'perf kvm list' we'd like to get a list of all currently present guests that the developer has permission to profile: i.e. we'd like a list of all [debuggable] Linux tasks that have a KVM instance attached to them.
A convenient way to do that would be to use the Qemu process's ->comm[] name, and to have a KVM ioctl that gets us a list of all vcpus that the querying task has ptrace permission to. [the standard permission check we do for instrumentation]
No need for communication with Qemu for that - just an ioctl, and an always-guaranteed result that works fine on a whole-system and on a per user basis as well.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 22 lines · Ingo Molnar
Quoted 7 lines · Anthony Liguori
Quoted 5 lines
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
A guest is not a KVM concept. [...]
Well, in a sense a guest is a KVM concept too: it's in essence represented via the 'vcpu state attached to a struct mm' abstraction that is attached to the
/dev/kvmfile descriptor attached to a Linux process.Multiple vcpus can be started by the same process to represent SMP, but the whole guest notion is present: a Linux MM that carries KVM state.
In that sense when we type 'perf kvm list' we'd like to get a list of all currently present guests that the developer has permission to profile: i.e. we'd like a list of all [debuggable] Linux tasks that have a KVM instance attached to them.
Quoted 9 lines
A convenient way to do that would be to use the Qemu process's ->comm[] name, and to have a KVM ioctl that gets us a list of all vcpus that the querying task has ptrace permission to. [the standard permission check we do for instrumentation]
No need for communication with Qemu for that - just an ioctl, and an always-guaranteed result that works fine on a whole-system and on a per user basis as well.
You need a way to interact with the guest which means you need some type of device. All of the interesting devices are implemented in qemu so you're going to have to interact with qemu if you want meaningful interaction with a guest.
Regards,
Anthony Liguori
Quoted 4 lines
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 5 lines · Ingo Molnar
Quoted 2 lines · Anthony Liguori
[...]
Quoted 8 lines
Quoted 4 lines
I've been trying very hard to turn this into a productive thread attempting to capture your feedback and give clear suggestions about how you can solve achieve your desired functionality.
I'm glad that we are at this more productive stage. I'm still trying to achieve the very same technological capabilities that i expressed in the first few mails when i reviewed the 'perf kvm' patch that was submitted by Yanmin.
No, you're not. You're trying to fracture the qemu community with your tools/kvm proposal, you're explaining to me how I'm working on the wrong thing by concentrating on things that my employer needs rather than what you think kvm needs, and attaching various unsavoury labels to Anthony and myself. Any wonder we aren't getting anything done?
If you can commit to a reasonable conversation we might be able to make progress. Is this actually possible?
Quoted 18 lines
The crux of the problem is very simple. To quote my earlier mail:
| | - The inconvenience of having to type: | perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ | --guestmodules=/home/ymzhang/guest/modules top | | | is very obvious even with a single guest. Now multiply that by more guests ... |For example we want 'perf kvm top' to do something useful by default: it should find the first guest running and it should report its profile.
The tool shouldnt have to guess about where the guests are, what their namespaces is and how to talk to them. We also want easy symbolic access to guest, for example:
Quoted 9 lines
perf kvm -g OpenSuse-2 record sleep 1
I.e.:
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
Usually 'layering violation' is trotted out at such suggestions. I don't like using the term, because sometimes the layers are incorrect and need to be violated. But it should be done explicitly, not as a shortcut for a minor feature (and profiling is a minor feature, most users will never use it, especially guest-from-host).
The fact is we have well defined layers today, kvm virtualizes the cpu and memory, qemu emulates devices for a single guest, libvirt manages guests. We break this sometimes but there has to be a good reason. So perf needs to talk to libvirt if it wants names. Could be done via linking, or can be done using a pluging libvirt drops into perf.
Quoted 9 lines
- Guest-transparent VFS integration into the host, to recover symbols and debug info in binaries, etc.
There were a few responses to that but none really addressed those problems - they mostly tried to re-define the problem and suggested that i was wrong to want such capabilities and suggested various inferior approaches instead. See the thread for the details - i think i covered every technical suggestion that was made.
You simply kept ignoring me when I said that if something can be kept out of the kernel without impacting performance, it should be. I don't want emergency patches closing some security hole or oops in a kernel symbol server.
The usability argument is a red herring. True, it takes time for things to trickle down to distributions and users. Those who can't wait can download the code and compile, it isn't that difficult.
Quoted 3 lines
So we are still at an impasse as far as i can see. If i overlooked some suggestion that addresses these problems then please let me know ...
The impasse is mostly due to you insisting on doing everything your way, in the kernel, and disregarding how libvirt/qemu/kvm does things. Learn the kvm ecosystem, you'll find it is quite easy to contribute code.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Avi Kivity
Quoted 5 lines
There were a few responses to that but none really addressed those problems - they mostly tried to re-define the problem and suggested that i was wrong to want such capabilities and suggested various inferior approaches instead. See the thread for the details - i think i covered every technical suggestion that was made.
You simply kept ignoring me when I said that if something can be kept out of the kernel without impacting performance, it should be. I don't want emergency patches closing some security hole or oops in a kernel symbol server.
Or rather, explained how I am a wicked microkernelist. The herring were out in force today.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Avi Kivity
Quoted 4 lines
You simply kept ignoring me when I said that if something can be kept out of the kernel without impacting performance, it should be. I don't want emergency patches closing some security hole or oops in a kernel symbol server.
Or rather, explained how I am a wicked microkernelist. The herring were out in force today.
Well, if it's not being a "wicked microkernelist" then what is it? Performance is hardly the only motivation to put things into the kernel. Think kernel mode-setting and devtmpfs (with the ironic twist of original devfs being removed from the kernel) here, for example.
Pekka
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Pekka Enberg
Quoted 5 lines · Avi Kivity
Quoted 5 lines
You simply kept ignoring me when I said that if something can be kept out of the kernel without impacting performance, it should be. I don't want emergency patches closing some security hole or oops in a kernel symbol server.
Quoted 5 lines
Quoted 3 lines
Or rather, explained how I am a wicked microkernelist. The herring were out in force today.
Well, if it's not being a "wicked microkernelist" then what is it?
I know I'm bad.
Quoted 4 lines
Performance is hardly the only motivation to put things into the kernel. Think kernel mode-setting and devtmpfs (with the ironic twist of original devfs being removed from the kernel) here, for example.
Motivations include privileged device access, needing to access physical memory, security, and keeping the userspace interface sane. There are others. I don't think any of them hold here.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityQuoted 11 lines · Avi Kivity
Quoted 11 lines
The crux of the problem is very simple. To quote my earlier mail:
| | - The inconvenience of having to type: | perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ | --guestmodules=/home/ymzhang/guest/modules top | | | is very obvious even with a single guest. Now multiply that by more guests ... |
Quoted 8 lines
Quoted 8 lines
For example we want 'perf kvm top' to do something useful by default: it should find the first guest running and it should report its profile.
The tool shouldnt have to guess about where the guests are, what their namespaces is and how to talk to them. We also want easy symbolic access to guest, for example:
perf kvm -g OpenSuse-2 record sleep 1
[ Sidenote: i still received no adequate suggestions about how to provide this
category of technical features. ]
Quoted 9 lines
Quoted 6 lines
I.e.:
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
Usually 'layering violation' is trotted out at such suggestions. [...]
That's weird, how can a feature request be a 'layering violation'?
If something that users find straightforward and usable is a layering violation to you (such as easily being able to access their own files on the host as well ...) then i think you need to revisit the definition of that term instead of trying to fix the user.
Quoted 20 lines
[...] I don't like using the term, because sometimes the layers are incorrect and need to be violated. But it should be done explicitly, not as a shortcut for a minor feature (and profiling is a minor feature, most users will never use it, especially guest-from-host).
The fact is we have well defined layers today, kvm virtualizes the cpu and memory, qemu emulates devices for a single guest, libvirt manages guests. We break this sometimes but there has to be a good reason. So perf needs to talk to libvirt if it wants names. Could be done via linking, or can be done using a pluging libvirt drops into perf.
Quoted 8 lines
- Guest-transparent VFS integration into the host, to recover symbols and debug info in binaries, etc.
There were a few responses to that but none really addressed those problems - they mostly tried to re-define the problem and suggested that i was wrong to want such capabilities and suggested various inferior approaches instead. See the thread for the details - i think i covered every technical suggestion that was made.
Quoted 4 lines
You simply kept ignoring me when I said that if something can be kept out of the kernel without impacting performance, it should be. I don't want emergency patches closing some security hole or oops in a kernel symbol server.
I never suggested an "in kernel space symbol server" which could oops, why would i have suggested that? Please point me to an email where i suggested that.
Quoted 3 lines
The usability argument is a red herring. True, it takes time for things to trickle down to distributions and users. Those who can't wait can download the code and compile, it isn't that difficult.
It's not just "download and compile", it's also "configure correctly for several separate major distributions" and "configure to per guest instance local rules".
It's far more fragile in practice than you make it appear to be, and since you yourself expressed that you are not interested much in the tooling side, how can you have adequate experience to judge such matters?
In fact for instrumentation it's beyond a critical threshold of fragility - instrumentation above all needs to be accessible, transparent and robust.
If you cannot see the advantages of a properly integrated solution then i suspect there's not much i can do to convince you.
And you ignored not just me but you ignored several people in this thread who thought the current status quo was inadequate and expressed interest in both the VFS integration and in the guest enumeration features.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 17 lines · Ingo Molnar
Quoted 14 lines · Avi Kivity
Quoted 14 lines
The crux of the problem is very simple. To quote my earlier mail:
| | - The inconvenience of having to type: | perf kvm --host --guest --guestkallsyms=/home/ymzhang/guest/kallsyms \ | --guestmodules=/home/ymzhang/guest/modules top | | | is very obvious even with a single guest. Now multiply that by more guests ... |For example we want 'perf kvm top' to do something useful by default: it should find the first guest running and it should report its profile.
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
The tool shouldnt have to guess about where the guests are, what their namespaces is and how to talk to them. We also want easy symbolic access to guest, for example:
perf kvm -g OpenSuse-2 record sleep 1
[ Sidenote: i still received no adequate suggestions about how to provide this
category of technical features. ]
You need to integrate with libvirt to convert guest names something that can be used to obtain guest symbols.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
I.e.:
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
Quoted 5 lines
Quoted 3 lines
Usually 'layering violation' is trotted out at such suggestions. [...]
That's weird, how can a feature request be a 'layering violation'?
The 'something trustable and kernel-provided'. The kernel knows nothing about guest names.
Quoted 5 lines
If something that users find straightforward and usable is a layering violation to you (such as easily being able to access their own files on the host as well ...) then i think you need to revisit the definition of that term instead of trying to fix the user.
Here is the explanation, you left it quoted:
Quoted 11 lines
Quoted 10 lines
[...] I don't like using the term, because sometimes the layers are incorrect and need to be violated. But it should be done explicitly, not as a shortcut for a minor feature (and profiling is a minor feature, most users will never use it, especially guest-from-host).
The fact is we have well defined layers today, kvm virtualizes the cpu and memory, qemu emulates devices for a single guest, libvirt manages guests. We break this sometimes but there has to be a good reason. So perf needs to talk to libvirt if it wants names. Could be done via linking, or can be done using a pluging libvirt drops into perf.
Quoted 9 lines
Quoted 5 lines
You simply kept ignoring me when I said that if something can be kept out of the kernel without impacting performance, it should be. I don't want emergency patches closing some security hole or oops in a kernel symbol server.
I never suggested an "in kernel space symbol server" which could oops, why would i have suggested that? Please point me to an email where i suggested that.
You insisted that it be in the kernel. Later you relaxed that and said a daemon is fine. I'm not going to reread this thread, once is more than enough.
Quoted 8 lines
Quoted 4 lines
The usability argument is a red herring. True, it takes time for things to trickle down to distributions and users. Those who can't wait can download the code and compile, it isn't that difficult.
It's not just "download and compile", it's also "configure correctly for several separate major distributions" and "configure to per guest instance local rules".
That's life in Linux-land. Either you let distributions feed you cooked packages and relax, or you do the work yourself. If we had tools/everything/ it wouldn't be this way, but we don't.
Quoted 4 lines
It's far more fragile in practice than you make it appear to be, and since you yourself expressed that you are not interested much in the tooling side, how can you have adequate experience to judge such matters?
People on kvm-devel manage to build and run release tarballs and even directly from git. I build packages from source occasionally. It isn't fun but it doesn't take a PhD.
Quoted 6 lines
In fact for instrumentation it's beyond a critical threshold of fragility - instrumentation above all needs to be accessible, transparent and robust.
If you cannot see the advantages of a properly integrated solution then i suspect there's not much i can do to convince you.
Integration in Linux happens at the desktop or distribution level. You want to move it to the kernel level. It works for perf, great, but that doesn't mean it will work for everything else. Once perf grows a GUI, I expect it will stop working for perf as well (for example, if gtk breaks its API in a major release, which version will perf code for?)
Quoted 4 lines
And you ignored not just me but you ignored several people in this thread who thought the current status quo was inadequate and expressed interest in both the VFS integration and in the guest enumeration features.
I'm sorry. I don't reply to every email. If you want my opinion on something, you can ask me again.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Avi Kivity
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
- Easy default reference to guest instances, and a way for tools to reference them symbolically as well in the multi-guest case. Preferably something trustable and kernel-provided - not some indirect information like a PID file created by libvirt-manager or so.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Usually 'layering violation' is trotted out at such suggestions. [...]
That's weird, how can a feature request be a 'layering violation'?
The 'something trustable and kernel-provided'. The kernel knows nothing about guest names.
The kernel certainly knows about other resources such as task names or network interface names or tracepoint names. This is kernel design 101.
Quoted 5 lines
Quoted 4 lines
If something that users find straightforward and usable is a layering violation to you (such as easily being able to access their own files on the host as well ...) then i think you need to revisit the definition of that term instead of trying to fix the user.
Quoted 12 lines
Here is the explanation, you left it quoted:
Quoted 10 lines
Quoted 10 lines
[...] I don't like using the term, because sometimes the layers are incorrect and need to be violated. But it should be done explicitly, not as a shortcut for a minor feature (and profiling is a minor feature, most users will never use it, especially guest-from-host).
The fact is we have well defined layers today, kvm virtualizes the cpu and memory, qemu emulates devices for a single guest, libvirt manages guests. We break this sometimes but there has to be a good reason. So perf needs to talk to libvirt if it wants names. Could be done via linking, or can be done using a pluging libvirt drops into perf.
This is really just the much-discredited microkernel approach for keeping global enumeration data that should be kept by the kernel ...
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
- Those special files can get corrupted, mis-setup, get out of sync, or can be hard to discover.
- The ${HOME}/.qemu/qmp/ solution suggested by Anthony has a very obvious design flaw: it is per user. When i'm root i'd like to query _all_ current guest images, not just the ones started by root. A system might not even have a notion of '${HOME}'.
- Apps might start KVM vcpu instances without adhering to the ${HOME}/.qemu/qmp/ access method.
- There is no guarantee for the Qemu process to reply to a request - while the kernel can always guarantee an enumeration result. I dont want 'perf kvm' to hang or misbehave just because Qemu has hung.
Really, for such reasons user-space is pretty poor at doing system-wide enumeration and resource management. Microkernels lost for a reason.
You are committing several grave design mistakes here.
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 7 lines · Ingo Molnar
Quoted 4 lines
The 'something trustable and kernel-provided'. The kernel knows nothing about guest names.
The kernel certainly knows about other resources such as task names or network interface names or tracepoint names. This is kernel design 101.
But it doesn't know about guest names. You can't trust task names since any user can create a task with any name. Network interfaces are root only so you can trust their names.
There are dozens or even hundreds of object classes the kernel does not know about and cannot enumerate. User names, for instance. X sessions. Windows (the screen artifact, not the OS). CIFS shares exported by this machine. Currently running applications (not processes).
btw, network interfaces would have been much better of using /dev/netif/name rather than having their own namespace, IMO, like disks.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
[...] I don't like using the term, because sometimes the layers are incorrect and need to be violated. But it should be done explicitly, not as a shortcut for a minor feature (and profiling is a minor feature, most users will never use it, especially guest-from-host).
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
The fact is we have well defined layers today, kvm virtualizes the cpu and memory, qemu emulates devices for a single guest, libvirt manages guests. We break this sometimes but there has to be a good reason. So perf needs to talk to libvirt if it wants names. Could be done via linking, or can be done using a pluging libvirt drops into perf.
This is really just the much-discredited microkernel approach for keeping global enumeration data that should be kept by the kernel ...
I disagree it should be kept in the kernel. Why introduce a new namespace, with APIs to query it, manage it, rules regarding conflicts, then virtualize it for containers.
Quoted 3 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
I don't like it either. We have libvirt for enumerating guests.
Quoted 11 lines
- Those special files can get corrupted, mis-setup, get out of sync, or can be hard to discover.
- The ${HOME}/.qemu/qmp/ solution suggested by Anthony has a very obvious design flaw: it is per user. When i'm root i'd like to query _all_ current guest images, not just the ones started by root. A system might not even have a notion of '${HOME}'.
- Apps might start KVM vcpu instances without adhering to the
${HOME}/.qemu/qmp/ access method.
- it doesn't work with nfs.
Quoted 4 lines
- There is no guarantee for the Qemu process to reply to a request - while the kernel can always guarantee an enumeration result. I dont want 'perf kvm' to hang or misbehave just because Qemu has hung.
If qemu doesn't reply, your guest is dead anyway.
Quoted 3 lines
Really, for such reasons user-space is pretty poor at doing system-wide enumeration and resource management. Microkernels lost for a reason.
Take a look at your desktop, userspace is doing all of that everywhere, from enumerating users and groups, to deciding how your disks are named. The kernel only provides the bare facilities.
Quoted 2 lines
You are committing several grave design mistakes here.
I am committing on the shoulders of giants.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 4 lines · Avi Kivity
Quoted 2 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
I don't like it either. We have libvirt for enumerating guests.
We're stuck in a rut with libvirt and I think a lot of the dissatisfaction with qemu is rooted in that. It's not libvirt that's the probably, but the relationship between qemu and libvirt.
We add a feature to qemu and maybe after six month it gets exposed by libvirt. Release time lines of the two projects complicate the situation further. People that write GUIs are limited by libvirt because that's what they're told to use and when they need something simple, they're presented with first getting that feature implemented in qemu, then plumbed through libvirt.
It wouldn't be so bad if libvirt was basically a passthrough interface to qemu but it tries to model everything in a generic way which is more or less doomed to fail when you're adding lots of new features (as we are).
The list of things that libvirt doesn't support and won't any time soon is staggering.
libvirt serves an important purpose, but we need to do a better job in qemu with respect to usability. We can't just punt to libvirt.
Regards,
Anthony Liguori
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Anthony Liguori
Quoted 5 lines · Avi Kivity
Quoted 3 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony.
There's numerous ways that this can break:I don't like it either. We have libvirt for enumerating guests.
We're stuck in a rut with libvirt and I think a lot of the dissatisfaction with qemu is rooted in that. It's not libvirt that's the probably, but the relationship between qemu and libvirt.
Quoted 6 lines
We add a feature to qemu and maybe after six month it gets exposed by libvirt. Release time lines of the two projects complicate the situation further. People that write GUIs are limited by libvirt because that's what they're told to use and when they need something simple, they're presented with first getting that feature implemented in qemu, then plumbed through libvirt.
That is somewhat unfair as a blanket statement!
While some features have had a long time delay & others are not supported at all, in many cases we have had zero delay. We have been supporting QMP, qdev, vhost-net since before the patches for those features were even merged in QEMU GIT! It varies depending on how closely QEMU & libvirt people have been working together on a feature, and on how strongly end users are demanding the features.
Quoted 6 lines
It wouldn't be so bad if libvirt was basically a passthrough interface to qemu but it tries to model everything in a generic way which is more or less doomed to fail when you're adding lots of new features (as we are).
The list of things that libvirt doesn't support and won't any time soon is staggering.
As previously discussed, we want to improve both the set of features supported, and make it much easier to support new features promptly. The QMP & qdev stuff has been a very good step forward in making it easier to support QEMU management. There have been a proposals from several people, yourself included, on how to improve libvirt's support for the full range of QEMU features. We're committed to looking at this and figuring out which proposals are practical to support, so we can improve QEMU & libvirt interaction for everyone.
Regards,
Daniel
Signature · 4 lines
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 14 lines · Daniel P. Berrange
Quoted 12 lines · Anthony Liguori
Quoted 6 lines · Avi Kivity
Quoted 4 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony.
There's numerous ways that this can break:I don't like it either. We have libvirt for enumerating guests.
We're stuck in a rut with libvirt and I think a lot of the dissatisfaction with qemu is rooted in that. It's not libvirt that's the probably, but the relationship between qemu and libvirt.
Quoted 9 lines
Quoted 7 lines
We add a feature to qemu and maybe after six month it gets exposed by libvirt. Release time lines of the two projects complicate the situation further. People that write GUIs are limited by libvirt because that's what they're told to use and when they need something simple, they're presented with first getting that feature implemented in qemu, then plumbed through libvirt.
That is somewhat unfair as a blanket statement!
Sorry, you're certainly correct. Some features appear quickly, but others can take an awfully long time.
Quoted 7 lines
Quoted 7 lines
It wouldn't be so bad if libvirt was basically a passthrough interface to qemu but it tries to model everything in a generic way which is more or less doomed to fail when you're adding lots of new features (as we are).
The list of things that libvirt doesn't support and won't any time soon is staggering.
Quoted 9 lines
As previously discussed, we want to improve both the set of features supported, and make it much easier to support new features promptly. The QMP& qdev stuff has been a very good step forward in making it easier to support QEMU management. There have been a proposals from several people, yourself included, on how to improve libvirt's support for the full range of QEMU features. We're committed to looking at this and figuring out which proposals are practical to support, so we can improve QEMU& libvirt interaction for everyone.
Regards,
Anthony Liguori
Quoted 3 lines
Regards,
Daniel
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Daniel P. BerrangeQuoted 19 lines · Daniel P. Berrange
Quoted 11 lines · Anthony Liguori
Quoted 5 lines · Avi Kivity
Quoted 3 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony.
There's numerous ways that this can break:I don't like it either. We have libvirt for enumerating guests.
We're stuck in a rut with libvirt and I think a lot of the dissatisfaction with qemu is rooted in that. It's not libvirt that's the probably, but the relationship between qemu and libvirt.
Quoted 6 lines
We add a feature to qemu and maybe after six month it gets exposed by libvirt. Release time lines of the two projects complicate the situation further. People that write GUIs are limited by libvirt because that's what they're told to use and when they need something simple, they're presented with first getting that feature implemented in qemu, then plumbed through libvirt.
Quoted 8 lines
That is somewhat unfair as a blanket statement!
While some features have had a long time delay & others are not supported at all, in many cases we have had zero delay. We have been supporting QMP, qdev, vhost-net since before the patches for those features were even merged in QEMU GIT! It varies depending on how closely QEMU & libvirt people have been working together on a feature, and on how strongly end users are demanding the features.
Yes. I think the point was that every layer in between brings potential slowdown and loss of features.
Hopefully this will go away with QMP. By then people can decide if they want to be hypervisor agnostic (libvirt) or tightly coupled with qemu (QMP). The best of both worlds would of course be a QMP pass-through in libvirt. No idea if that's easily possible.
Either way, things are improving. What people see at the end is virt-manager though. And if you compare if feature-wise as well as looks-wise vbox is simply superior. Several features lacking in lower layers too (pv graphics, always working absolute pointers, clipboard sharing, ...).
That said it doesn't mean we should resign. It means we know which areas to work on :-). And we know that our problem is not the kernel/userspace interface, but the qemu and above interfaces.
Alex
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 2 lines · Alexander Graf
Yes. I think the point was that every layer in between brings potential slowdown and loss of features.
Exactly. The more 'fragmented' a project is into sub-projects, without a single, unified, functional reference implementation in the center of it, the longer it takes to fix 'unsexy' problems like trivial usability bugs.
Furthermore, another negative effect is that many times features are implemented not in their technically best way, but in a way to keep them local to the project that originates them. This is done to keep deployment latencies and general contribution overhead down to a minimum. The moment you have to work with yet another project, the overhead adds up.
So developers rather go for the quicker (yet inferior) hack within the sub-project they have best access to.
Tell me this isnt happening in this space ;-)
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Ingo Molnar
Quoted 2 lines · Alexander Graf
Yes. I think the point was that every layer in between brings potential slowdown and loss of features.
Exactly. The more 'fragmented' a project is into sub-projects, without a single, unified, functional reference implementation in the center of it, the longer it takes to fix 'unsexy' problems like trivial usability bugs.
I agree to that part. As previously stated there are few people working on qemu that would go and implement higher level things though. So some solution is needed there.
Quoted 5 lines
Furthermore, another negative effect is that many times features are implemented not in their technically best way, but in a way to keep them local to the project that originates them. This is done to keep deployment latencies and general contribution overhead down to a minimum. The moment you have to work with yet another project, the overhead adds up.
I disagree there. Keeping things local and self-contained has been the UNIX secret. It works really well as long as the boundaries are well defined.
The problem we're facing is that we're simply lacking an active GUI / desktop user development community. We have desktop users, but nobody feels like tackling the issue of doing a great GUI project while talking to qemu-devel about his needs.
Quoted 2 lines
So developers rather go for the quicker (yet inferior) hack within the sub-project they have best access to.
Well - not necessarily hacks. It's more about project boundaries. Nothing is bad about that. You wouldn't want "ls" implemented in the Linux kernel either, right? :-)
Alex
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 8 lines · Alexander Graf
Quoted 5 lines
Furthermore, another negative effect is that many times features are implemented not in their technically best way, but in a way to keep them local to the project that originates them. This is done to keep deployment latencies and general contribution overhead down to a minimum. The moment you have to work with yet another project, the overhead adds up.
I disagree there. Keeping things local and self-contained has been the UNIX secret. It works really well as long as the boundaries are well defined.
The 'UNIX secret' works for text driven pipelined commands where we are essentially programming via narrow ASCII input of mathematical logic.
It doesnt work for a GUI that is a 2D/3D environment of millions of pixels, shaped by human visual perception of prettiness, familiarity and efficiency.
Quoted 4 lines
The problem we're facing is that we're simply lacking an active GUI / desktop user development community. We have desktop users, but nobody feels like tackling the issue of doing a great GUI project while talking to qemu-devel about his needs.
Have you made thoughts about why that might be so?
I think it's because of what i outlined above - that you are trying to apply the "UNIX secret" to GUIs - and that is a mistake.
A good GUI is almost at the _exact opposite spectrum_ of good command-line
tool: tightly integrated, with 'layering violations' designed into it all over the place:
look i can paste the text from an editor straight into a firefox form. I didnt go through any hiearchy of layers, i just took the shortest path between the apps!
In other words: in a GUI the output controls the design, for command-line tools the design controls the output.
It is no wonder Unix always had its problems with creating good GUIs that are efficient to humans. A good GUI works like the human brain, and the human brain does not mind 'layering violations' when that gets it a more efficient result.
Quoted 6 lines
Quoted 2 lines
So developers rather go for the quicker (yet inferior) hack within the sub-project they have best access to.
Well - not necessarily hacks. It's more about project boundaries. Nothing is bad about that. You wouldn't want "ls" implemented in the Linux kernel either, right? :-)
I guess you are talking to the wrong person as i actually have implemented ls functionality in the kernel, using async IO concepts and extreme threading ;-) It was a bit crazy, but was also the fastest FTP server ever running on this planet.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 9 lines · Ingo Molnar
Quoted 6 lines · Alexander Graf
Quoted 6 lines
Furthermore, another negative effect is that many times features are implemented not in their technically best way, but in a way to keep them local to the project that originates them. This is done to keep deployment latencies and general contribution overhead down to a minimum. The moment you have to work with yet another project, the overhead adds up.
Quoted 9 lines
Quoted 3 lines
I disagree there. Keeping things local and self-contained has been the UNIX secret. It works really well as long as the boundaries are well defined.
The 'UNIX secret' works for text driven pipelined commands where we are essentially programming via narrow ASCII input of mathematical logic.
It doesnt work for a GUI that is a 2D/3D environment of millions of pixels, shaped by human visual perception of prettiness, familiarity and efficiency.
Modularization is needed when a project exceeds the average developer's capacity. For kvm, it is logical to separate privileged cpu virtualization, from guest virtualization, from host management, from cluster management.
Quoted 10 lines
Quoted 5 lines
The problem we're facing is that we're simply lacking an active GUI / desktop user development community. We have desktop users, but nobody feels like tackling the issue of doing a great GUI project while talking to qemu-devel about his needs.
Have you made thoughts about why that might be so?
I think it's because of what i outlined above - that you are trying to apply the "UNIX secret" to GUIs - and that is a mistake.
Quoted 8 lines
A good GUI is almost at the
_exactoppositespectrum_of good command-line
tool: tightly integrated, with 'layering violations' designed into it all over the place:look i can paste the text from an editor straight into a firefox form. I didnt go through any hiearchy of layers, i just took the shortest path between the apps!
Nope. You copied text from one application into the clipboard (or selection, or PRIMARY, or whatever
) and pasted text from the clipboard to another application. If firefox and your editor had to interact directly, all would be lost.
See - there was a global (for the session) third party, and it wasn't the kernel.
Quoted 3 lines
In other words: in a GUI the output controls the design, for command-line tools the design controls the output.
Not in GUIs that I've seen the internals of.
Quoted 5 lines
It is no wonder Unix always had its problems with creating good GUIs that are efficient to humans. A good GUI works like the human brain, and the human brain does not mind 'layering violations' when that gets it a more efficient result.
The problem is that only developers are involved, not people who understand human-computer interaction (in many cases, not human-human interaction either). Another problem is that a good GUI takes a lot of work so you need a lot of committed resources. A third problem is that it isn't a lot of fun, at least not the 20% of the work that take 800% of the time.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarOn Mon, 2010-03-22 at 21:21 +0100, Ingo Molnar wrote:
[...]
Quoted 1 line
Have you made thoughts about why that might be so?
Yes.
Forword: I assume with "GUI" you mean "a user interface for the classical desktop user with next to no interest in learning details or basics".
That doesn't mean the classical desktop user is silly, stupid or otherwise handicapped - it's just the lack of interest and/or time.
Quoted 2 lines
I think it's because of what i outlined above - that you are trying to apply the "UNIX secret" to GUIs - and that is a mistake.
No, it's the very same mechanism. But you just have to start at the correct point. In the kernel/device driver world, you start at the device.
And in the GUI world, you better start at the GUI (and not some kernel API, library API, GUI tool or toolchains or anywhere else).
Quoted 9 lines
A good GUI is almost at the
_exactoppositespectrum_of good command-line
tool: tightly integrated, with 'layering violations' designed into it all over the place:look i can paste the text from an editor straight into a firefox form. I didnt go through any hiearchy of layers, i just took the shortest path between the apps!
In other words: in a GUI the output controls the design, for command-line
ACK, because you to make the GUI understandable to the intended users. If that means "hiding 90% of all possibilities and features", you just hide them.
Of course, the user of such an UI is quite limited doesn't use much of the functionality - because s/he can't access it through the GUI - (but presenting 100% - or even 40% - doesn't help either as s/he won't understand it anyways).
Quoted 1 line
tools the design controls the output.
ACK, because the user in this case (which is most of the time a developer, sys-admin, or similar techie) *wants* an 1:1 picture of the underlying model because s/he already *knows* the underlying model (and is willing and able to adapt the own workflow to the underlying models).
Quoted 1 line
It is no wonder Unix always had its problems with creating good GUIs that are
ACK. The clichee-Unix-person doesn't come from the "GUI world". So most of them are "trained" and used to look what's there and improve on it.
Quoted 3 lines
efficient to humans. A good GUI works like the human brain, and the human brain does not mind 'layering violations' when that gets it a more efficient result.
If this is the case, the layering/structure/design of the GUI is (very) badly defined/chosen (for whatever reason).
[ Most probably because some seasoned software developer designed the GUI-app *without* designing (and testing!) the GUI (or more to the
point: the look - how does it look like - and feel - how does it behave, what are the possible workflows, ... - of it) first. ]
Bernd
Signature · 2 lines
Bernd Petrovitsch Email : [email protected] LUGA : http://www.luga.at
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Ingo MolnarQuoted 14 lines · Ingo Molnar
* Alexander Graf<[email protected]> wrote
Quoted 3 lines
Yes. I think the point was that every layer in between brings potential slowdown and loss of features.
Exactly. The more 'fragmented' a project is into sub-projects, without a single, unified, functional reference implementation in the center of it, the longer it takes to fix 'unsexy' problems like trivial usability bugs.
Furthermore, another negative effect is that many times features are implemented not in their technically best way, but in a way to keep them local to the project that originates them. This is done to keep deployment latencies and general contribution overhead down to a minimum. The moment you have to work with yet another project, the overhead adds up.
Quoted 5 lines
So developers rather go for the quicker (yet inferior) hack within the sub-project they have best access to.
Tell me this isnt happening in this space ;-)
Integration is hard, requires a wider set of technical skills and getting good test coverage becomes more difficult.
But I agree that it is worth the effort, kvm could reap large rewards from putting a greater emphasis on integration (ala vbox) - no matter how it is achieved (cowardly not taking sides on implementation decisions like repository locations).
Antoine
Quoted 8 lines
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Anthony LiguoriQuoted 7 lines · Anthony Liguori
Quoted 4 lines · Avi Kivity
Quoted 2 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
I don't like it either. We have libvirt for enumerating guests.
We're stuck in a rut with libvirt and I think a lot of the dissatisfaction with qemu is rooted in that. It's not libvirt that's the probably, but the relationship between qemu and libvirt.
+1
The obvious reason why so many people still use shell scripts rather than libvirt is because if it just doesn't provide what they need.
Every time I've looked at it (and I've been looking for a better solution for many years), it seems that it would have provided most of the things I needed, but the remaining bits were unsolvable.
Shell scripts can be ugly, but you get total control.
Antoine
Quoted 16 lines
We add a feature to qemu and maybe after six month it gets exposed by libvirt. Release time lines of the two projects complicate the situation further. People that write GUIs are limited by libvirt because that's what they're told to use and when they need something simple, they're presented with first getting that feature implemented in qemu, then plumbed through libvirt.
It wouldn't be so bad if libvirt was basically a passthrough interface to qemu but it tries to model everything in a generic way which is more or less doomed to fail when you're adding lots of new features (as we are).
The list of things that libvirt doesn't support and won't any time soon is staggering.
libvirt serves an important purpose, but we need to do a better job in qemu with respect to usability. We can't just punt to libvirt.
Regards,
Anthony Liguori
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Antoine Martin
Quoted 10 lines · Anthony Liguori
Quoted 5 lines · Avi Kivity
Quoted 3 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony.
There's numerous ways that this can break:I don't like it either. We have libvirt for enumerating guests.
We're stuck in a rut with libvirt and I think a lot of the dissatisfaction with qemu is rooted in that. It's not libvirt that's the probably, but the relationship between qemu and libvirt.
Quoted 6 lines
+1
The obvious reason why so many people still use shell scripts rather than libvirt is because if it just doesn't provide what they need. Every time I've looked at it (and I've been looking for a better solution for many years), it seems that it would have provided most of the things I needed, but the remaining bits were unsolvable.
If you happen to remember what missing features prevented you choosing libvirt, that would be invaluable information for us, to see if there are quick wins that will help out. We got very useful feedback when recently asking people this same question
http://rwmj.wordpress.com/2010/01/07/quick-quiz-what-stops-you-from-using-libvirt/
Allowing arbitrary passthrough of QEMU commands/args will solve some of these issues, but certainly far from solving all of them. eg guest cut+ paste, host side control of guest screen resolution, easier x509/TLS configuration for remote management, soft reboot, Windows desktop support for virt-manager, host network interface management/setup, etc
Regards,
Daniel
Signature · 4 lines
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
In reply to Avi KivityQuoted 4 lines · Avi Kivity
Quoted 2 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
I don't like it either. We have libvirt for enumerating guests.
Which has pretty much the same problems to the ${HOME}/.qemu/qmp/ solution, obviously.
Quoted 8 lines
Quoted 8 lines
- Those special files can get corrupted, mis-setup, get out of sync, or can be hard to discover.
- The ${HOME}/.qemu/qmp/ solution suggested by Anthony has a very obvious design flaw: it is per user. When i'm root i'd like to query _all_ current guest images, not just the ones started by root. A system might not even have a notion of '${HOME}'.
Quoted 4 lines
Quoted 2 lines
- Apps might start KVM vcpu instances without adhering to the ${HOME}/.qemu/qmp/ access method.
- it doesn't work with nfs.
So out of a list of 4 disadvantages your reply is that you agree with 3?
Quoted 5 lines
Quoted 3 lines
- There is no guarantee for the Qemu process to reply to a request - while the kernel can always guarantee an enumeration result. I dont want 'perf kvm' to hang or misbehave just because Qemu has hung.
If qemu doesn't reply, your guest is dead anyway.
Erm, but i'm talking about a dead tool here. There's a world of a difference between 'kvm top' not showing new entries (because the guest is dead), and 'perf kvm top' hanging due to Qemu hanging.
So it's essentially 4 our of 4. Yet your reply isnt "Ingo you are right" but "hey, too bad" ?
Quoted 6 lines
Quoted 2 lines
Really, for such reasons user-space is pretty poor at doing system-wide enumeration and resource management. Microkernels lost for a reason.
Take a look at your desktop, userspace is doing all of that everywhere, from enumerating users and groups, to deciding how your disks are named. The kernel only provides the bare facilities.
We dont do that for robust system instrumentation, for heaven's sake!
By your argument it would be perfectly fine to implement /proc purely via user-space, correct?
Quoted 3 lines
Quoted 1 line
You are committing several grave design mistakes here.
I am committing on the shoulders of giants.
Really, this is getting outright ridiculous. You agree with me that Anothony suggested a technically inferior solution, yet you even seem to be proud of it and are joking about it?
And _you_ are complaining about lkml-style hard-talk discussions?
Thanks,
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 11 lines · Ingo Molnar
Quoted 5 lines · Avi Kivity
Quoted 3 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
I don't like it either. We have libvirt for enumerating guests.
Which has pretty much the same problems to the ${HOME}/.qemu/qmp/ solution, obviously.
It doesn't follow. The libvirt daemon could/should own guests from all users. I don't know if it does so now, but nothing is preventing it technically.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
- Those special files can get corrupted, mis-setup, get out of sync, or can be hard to discover.
- The ${HOME}/.qemu/qmp/ solution suggested by Anthony has a very obvious design flaw: it is per user. When i'm root i'd like to query _all_ current guest images, not just the ones started by root. A system might not even have a notion of '${HOME}'.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
- Apps might start KVM vcpu instances without adhering to the
${HOME}/.qemu/qmp/ access method.- it doesn't work with nfs.
So out of a list of 4 disadvantages your reply is that you agree with 3?
I agree with 1-3, disagree with 4, and add 5. Yes.
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
- There is no guarantee for the Qemu process to reply to a request - while the kernel can always guarantee an enumeration result. I dont want 'perf kvm' to hang or misbehave just because Qemu has hung.
If qemu doesn't reply, your guest is dead anyway.
Erm, but i'm talking about a dead tool here. There's a world of a difference between 'kvm top' not showing new entries (because the guest is dead), and 'perf kvm top' hanging due to Qemu hanging.
If qemu hangs, the guest hangs a few milliseconds later.
Quoted 3 lines
So it's essentially 4 our of 4. Yet your reply isnt "Ingo you are right" but "hey, too bad" ?
My reply is "you are right" (phrased earlier as "I don't like it either" meaning I agree with your dislike). One of your criticisms was invalid, IMO, and I pointed it out.
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
Really, for such reasons user-space is pretty poor at doing system-wide enumeration and resource management. Microkernels lost for a reason.
Take a look at your desktop, userspace is doing all of that everywhere, from enumerating users and groups, to deciding how your disks are named. The kernel only provides the bare facilities.
We dont do that for robust system instrumentation, for heaven's sake!
If qemu fails, you lose your guest. If libvirt forgets about a guest, you can't do anything with it any more. These are more serious problems than 'perf kvm' not working. Qemu and libvirt have to be robust anyway, we can rely on them. Like we have to rely on init, X, sshd, and a zillion other critical tools.
Quoted 3 lines
By your argument it would be perfectly fine to implement /proc purely via user-space, correct?
I would have preferred /proc to be implemented via syscalls called directly from tools, and good tools written to expose the information in it. When computers were slower 'top' would spend tons of time opening and closing all those tiny files and parsing them. Of course the kernel needs to provide the information.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
You are committing several grave design mistakes here.
I am committing on the shoulders of giants.
Really, this is getting outright ridiculous. You agree with me that Anothony suggested a technically inferior solution, yet you even seem to be proud of it and are joking about it?
The bit above this was:
Quoted 3 lines
Really, for such reasons user-space is pretty poor at doing system-wide enumeration and resource management. Microkernels lost for a reason.
In every Linux system userspace is doing or proxying much of the enumeration and resource management. So if enumerating guests in userspace is a mistake, then I am not alone in making it.
Quoted 2 lines
And _you_ are complaining about lkml-style hard-talk discussions?
There is a difference between joking and insulting people. I enjoy jokes but I dislike being insulted.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Avi Kivity
Quoted 4 lines · Ingo Molnar
Quoted 2 lines · Avi Kivity
Quoted 2 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
I don't like it either. We have libvirt for enumerating guests.
Which has pretty much the same problems to the ${HOME}/.qemu/qmp/ solution, obviously.
It doesn't follow. The libvirt daemon could/should own guests from all users. I don't know if it does so now, but nothing is preventing it technically.
It's hard for me to argue against a hypothetical implementation, but all user-space driven solutions for resource enumeration i've seen so far had weaknesses that kernel-based solutions dont have.
Quoted 18 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
- Those special files can get corrupted, mis-setup, get out of sync, or can be hard to discover.
- The ${HOME}/.qemu/qmp/ solution suggested by Anthony has a very obvious design flaw: it is per user. When i'm root i'd like to query _all_ current guest images, not just the ones started by root. A system might not even have a notion of '${HOME}'.
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
- Apps might start KVM vcpu instances without adhering to the ${HOME}/.qemu/qmp/ access method.
- it doesn't work with nfs.
So out of a list of 4 disadvantages your reply is that you agree with 3?
I agree with 1-3, disagree with 4, and add 5. Yes.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
- There is no guarantee for the Qemu process to reply to a request - while the kernel can always guarantee an enumeration result. I dont want 'perf kvm' to hang or misbehave just because Qemu has hung.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
If qemu doesn't reply, your guest is dead anyway.
Erm, but i'm talking about a dead tool here. There's a world of a difference between 'kvm top' not showing new entries (because the guest is dead), and 'perf kvm top' hanging due to Qemu hanging.
If qemu hangs, the guest hangs a few milliseconds later.
I think you didnt understand my point. I am talking about 'perf kvm top' hanging if Qemu hangs.
With a proper in-kernel enumeration the kernel would always guarantee the functionality, even if the vcpu does not make progress (i.e. it's "hung").
With this implemented in Qemu we lose that kind of robustness guarantee.
And especially during development (when developers use instrumentation the most) is it important to have robust instrumentation that does not hang along with the Qemu process.
Quoted 3 lines
If qemu fails, you lose your guest. If libvirt forgets about a guest, you can't do anything with it any more. These are more serious problems than 'perf kvm' not working. [...]
How on earth can you justify a bug ("perf kvm top" hanging) with that there are other bugs as well?
Basically you are arguing the equivalent that a gdb session would be fine to become unresponsive if the debugged task hangs. Fortunately ptrace is kernel-based and it never 'hangs' if the user-space process hangs somewhere.
This is an essential property of good instrumentation.
So the enumeration method you suggested is a poor, sub-part solution, simple as that.
Quoted 2 lines
[...] Qemu and libvirt have to be robust anyway, we can rely on them. Like we have to rely on init, X, sshd, and a zillion other critical tools.
We can still profile any of those tools without the profiler breaking if the debugged tool breaks ...
Quoted 8 lines
Quoted 2 lines
By your argument it would be perfectly fine to implement /proc purely via user-space, correct?
I would have preferred /proc to be implemented via syscalls called directly from tools, and good tools written to expose the information in it. When computers were slower 'top' would spend tons of time opening and closing all those tiny files and parsing them. Of course the kernel needs to provide the information.
(Then you'll be enjoyed to hear that perf has enabled exactly that, and that we are working towards that precise usecase.)
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 16 lines · Ingo Molnar
Quoted 13 lines · Avi Kivity
Quoted 11 lines · Ingo Molnar
Quoted 5 lines · Avi Kivity
Quoted 3 lines
Lets look at the ${HOME}/.qemu/qmp/ enumeration method suggested by Anthony. There's numerous ways that this can break:
I don't like it either. We have libvirt for enumerating guests.
Which has pretty much the same problems to the ${HOME}/.qemu/qmp/ solution, obviously.
Quoted 8 lines
Quoted 4 lines
It doesn't follow. The libvirt daemon could/should own guests from all users. I don't know if it does so now, but nothing is preventing it technically.
It's hard for me to argue against a hypothetical implementation, but all user-space driven solutions for resource enumeration i've seen so far had weaknesses that kernel-based solutions dont have.
Correct. kernel-based solutions also have issues.
Quoted 5 lines
Quoted 2 lines
If qemu hangs, the guest hangs a few milliseconds later.
I think you didnt understand my point. I am talking about 'perf kvm top' hanging if Qemu hangs.
Use non-blocking I/O, report that guest as dead. No point in profiling it, it isn't making any progress.
Quoted 5 lines
With a proper in-kernel enumeration the kernel would always guarantee the functionality, even if the vcpu does not make progress (i.e. it's "hung").
With this implemented in Qemu we lose that kind of robustness guarantee.
If qemu has a bug in the resource enumeration code, you can't profile one guest. If the kernel has a bug in the resource enumeration code, the system either panics or needs to be rebooted later.
Quoted 4 lines
And especially during development (when developers use instrumentation the most) is it important to have robust instrumentation that does not hang along with the Qemu process.
It's nice not to have kernel oopses either. So when code can be in userspace, that's where it should be.
Quoted 7 lines
Quoted 4 lines
If qemu fails, you lose your guest. If libvirt forgets about a guest, you can't do anything with it any more. These are more serious problems than 'perf kvm' not working. [...]
How on earth can you justify a bug ("perf kvm top" hanging) with that there are other bugs as well?
There's no reason for 'perf kvm top' to hang if some process is not responsive. That would be a perf bug.
Quoted 4 lines
Basically you are arguing the equivalent that a gdb session would be fine to become unresponsive if the debugged task hangs. Fortunately ptrace is kernel-based and it never 'hangs' if the user-space process hangs somewhere.
Neither gdb nor perf should hang.
Quoted 5 lines
This is an essential property of good instrumentation.
So the enumeration method you suggested is a poor, sub-part solution, simple as that.
Or, you misunderstood it.
Quoted 6 lines
Quoted 3 lines
[...] Qemu and libvirt have to be robust anyway, we can rely on them. Like we have to rely on init, X, sshd, and a zillion other critical tools.
We can still profile any of those tools without the profiler breaking if the debugged tool breaks ...
You can't profile without qemu.
Quoted 12 lines
Quoted 9 lines
Quoted 3 lines
By your argument it would be perfectly fine to implement /proc purely via user-space, correct?
I would have preferred /proc to be implemented via syscalls called directly from tools, and good tools written to expose the information in it. When computers were slower 'top' would spend tons of time opening and closing all those tiny files and parsing them. Of course the kernel needs to provide the information.
(Then you'll be enjoyed to hear that perf has enabled exactly that, and that we are working towards that precise usecase.)
Are you exporting /proc/pid data via the perf syscall? If so, I think that's a good move.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 5 lines · Avi Kivity
Quoted 2 lines
I think you didnt understand my point. I am talking about 'perf kvm top' hanging if Qemu hangs.
Use non-blocking I/O, report that guest as dead. No point in profiling it, it isn't making any progress.
Erm, at what point do i decide that a guest is 'dead' versus 'just lagged due to lots of IO' ?
Also, do you realize that you increase complexity (the use of non-blocking IO), just to protect against something that wouldnt happen if the right solution was used in the first place?
Quoted 8 lines
Quoted 4 lines
With a proper in-kernel enumeration the kernel would always guarantee the functionality, even if the vcpu does not make progress (i.e. it's "hung").
With this implemented in Qemu we lose that kind of robustness guarantee.
If qemu has a bug in the resource enumeration code, you can't profile one guest. If the kernel has a bug in the resource enumeration code, the system either panics or needs to be rebooted later.
This is really simple code, not rocket science. If there's a bug in it we'll fix it. On the other hand a 500KLOC+ piece of Qemu code has lots of places to hang, so that is a large cross section.
Ingo
Re: [RFC] Unify KVM kernel-space and user-space code into a single project
Quoted 12 lines · Ingo Molnar
Quoted 6 lines · Avi Kivity
Quoted 3 lines
I think you didnt understand my point. I am talking about 'perf kvm top' hanging if Qemu hangs.
Use non-blocking I/O, report that guest as dead. No point in profiling it, it isn't making any progress.
Erm, at what point do i decide that a guest is 'dead' versus 'just lagged due to lots of IO' ?
qemu shouldn't block due to I/O (it does now, but there is work to fix it). Of course it could be swapping or other things.
Pick a timeout, everything we do has timeouts these days. It's the price we pay for protection: if you put something where a failure can't hurt you, you have to be prepared for failure, and you might have false alarms.
Is it so horrible for 'perf kvm top'? No user data loss will happen, surely?
On the other hand, if it's in the kernel and it fails, you will lose service or perhaps data.
Quoted 4 lines
Also, do you realize that you increase complexity (the use of non-blocking IO), just to protect against something that wouldnt happen if the right solution was used in the first place?
It's a tradeoff. Increasing the kernel code size vs. increasing userspace size.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
With a proper in-kernel enumeration the kernel would always guarantee the functionality, even if the vcpu does not make progress (i.e. it's "hung").
With this implemented in Qemu we lose that kind of robustness guarantee.
Quoted 9 lines
Quoted 4 lines
If qemu has a bug in the resource enumeration code, you can't profile one guest. If the kernel has a bug in the resource enumeration code, the system either panics or needs to be rebooted later.
This is really simple code, not rocket science. If there's a bug in it we'll fix it. On the other hand a 500KLOC+ piece of Qemu code has lots of places to hang, so that is a large cross section.
The kernel has tons of very simple code (and some very complex code as well), and tons of -stable updates as well.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.