Skip to contentSkip to conversation

Cleaning up /proc/xen

RFC Anthony Liguori 4 participants 5 messages Sep 8, 2005 – Sep 9, 2005

lore
Share & tools
lore
#0 lore raw

Today, in /proc/xen we have:

/proc/xen/balloon - displays information about memory allocations and allows for ballooning by echoing a byte value into file

/proc/xen/privcmd - allows for userspace invocation of hypercalls and mapping of other domains memory

/proc/xen/grant - allows grant table operations to be accessed from userspace

/proc/xen/xenbus - allows xenbus to be accessed from userspace (in domUs)

I propose we do the following:

Change /proc/xen/{privcmd,grant,xenbus} to character devices (that use random major/minors; we'll always access them by name). We have a few options for /proc/xen/balloon. We could:

1) Get rid of it completely--not sure it's a good idea but it's been suggested since it's redundant (in dom0 at least).
2) Move it to /proc/sys/
3) Move it to /sys/xen

I'm partial to the last option (maybe even /sys/hypervisor/xen--that seems to compliment /sys/firmware).

Thoughts?

Regards,

Anthony Liguori

#1 lore raw
Quoted 15 lines · Anthony Liguori

Today, in /proc/xen we have:

/proc/xen/balloon - displays information about memory allocations and
allows for ballooning by echoing a byte value into file

/proc/xen/privcmd - allows for userspace invocation of hypercalls and mapping of other domains memory

/proc/xen/grant - allows grant table operations to be accessed from
userspace

/proc/xen/xenbus - allows xenbus to be accessed from userspace (in domUs)

I propose we do the following:

Quoted 9 lines

Change /proc/xen/{privcmd,grant,xenbus} to character devices (that use random major/minors; we'll always access them by name). We have a few options for /proc/xen/balloon. We could:

1) Get rid of it completely--not sure it's a good idea but it's been suggested since it's redundant (in dom0 at least).
2) Move it to /proc/sys/
3) Move it to /sys/xen

The good thing about /proc is that we do not need to register any major/minor stuffs (which is very annoying), like what we do with device.

So I vote for moving things to under /sys. But hold on, that would not be compatible with others OS like *BSD, correct ?

Thanks,
Hieu.

#2 lore raw
Quoted 3 lines · NAHieu

The good thing about /proc is that we do not need to register any major/minor stuffs (which is very annoying), like what we do with device.

It's much less annoying if you just don't rely on static major/minor numbers and require udev.

Quoted 2 lines

So I vote for moving things to under /sys. But hold on, that would not be compatible with others OS like *BSD, correct ?

There's also plan9 and other things to consider. I reckon it's better to just implement first class drivers in each OS.

Regards,

Anthony Liguori

Quoted 4 lines

Thanks,
Hieu.

#4 lore raw
In reply to Anthony Liguori
Quoted 24 lines · Anthony Liguori

Today, in /proc/xen we have:

/proc/xen/balloon - displays information about memory allocations and
allows for ballooning by echoing a byte value into file

/proc/xen/privcmd - allows for userspace invocation of hypercalls and mapping of other domains memory

/proc/xen/grant - allows grant table operations to be accessed from
userspace

/proc/xen/xenbus - allows xenbus to be accessed from userspace (in domUs)

I propose we do the following:

Change /proc/xen/{privcmd,grant,xenbus} to character devices (that use random major/minors; we'll always access them by name). We have a few options for /proc/xen/balloon. We could:

1) Get rid of it completely--not sure it's a good idea but it's been suggested since it's redundant (in dom0 at least).
2) Move it to /proc/sys/
3) Move it to /sys/xen

Quoted 4 lines

I'm partial to the last option (maybe even /sys/hypervisor/xen--that seems to compliment /sys/firmware).

Thoughts?

Hi Anthony,

If you're serious about option 3, it might be a good idea to post to lkml and cc the sysfs maintainer - Greg KH. He might have some suggestions.

Thanks,

Dan

#3 lore raw
In reply to Anthony Liguori
Quoted 7 lines · Anthony Liguori
Quoted 2 lines · NAHieu

So I vote for moving things to under /sys. But hold on, that would not be compatible with others OS like *BSD, correct ?

There's also plan9 and other things to consider. I reckon it's better to just implement first class drivers in each OS.

Even the NetBSD port changed a few interface details (e.g., /kern/xen/privcmd, because procfs is for processes only), and it's still rather at odds with the local conventions at best.

Signature · 4 lines
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l))))))  (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k)))))))    '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))