Re: (XFree86) mmap of /proc/XXX/mem

Pavel Machek (pavel@suse.cz)
Thu, 2 Dec 1999 12:00:23 +0100


Hi!

> > > Yes, but how? We need a solution otherwise we won't be able to
> > > use the vm86 mode even on Intel. The emulator makes everything
> > > even slower.
> >
> > Check dosemu. The _real_ problem with /proc/<pid>/mem is that it needs
> > very different behaviour in different parts of process address space. Just
> > aliasing every page and hoping that extra reference will save your day is
> > _very_ bad idea - behaviour of pages on swapout, etc. is determined by
> > vma, not by reference in page table. We _might_ go for /proc/<pid>/object/
> > a-la Slowlaris, and that might be made mmap'able, but that's a separate
> > story. And IMO an overkill.
> >
> > Dosemu does aliasing in very similar situation. Check how it's done.
>
> I don't think dosemu saves my day. It needs just _one_ 1Mb real mode image.
> I know how to do that, too. No problem. As I tried to explain in
> my original posting I need _several_ 1Mb images: one for each graphics
> card. I need to swap them _fast_ without moving around large
> chunks of memory.
> When another card is selected I could in prinicple copy out the
> 1 Meg image of the one previously selected and then copy in the
> 1 Meg of the newly selected one. But this is _slow_ compared to
> just calling munmap()/mmap() to swap cards. If I only did that
> for initialization it's OK. But if I want to do it while the Xserver
> is running and in Operating state (ie for updating pallete or
> whatever else needs to be done) it is painfully slow.
> With mmap() /proc/XXX/mem I can keep all images set up in virtual
> address space and only map in the one I need.

Why don't you just prepare 5 files, 1Mega each, and mmap them when you
need it? What am I missing?
Pavel

-- 
I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel.  Pavel
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/