public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Christoph Rohland <cr@sap.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH,preliminary] cleanup shm handling
Date: Wed, 13 Dec 2000 16:43:25 +0000	[thread overview]
Message-ID: <23640.976725805@warthog.cambridge.redhat.com> (raw)
In-Reply-To: Message from Christoph Rohland <cr@sap.com>  of "13 Dec 2000 14:52:23 +0100." <qwwvgsoig2w.fsf@sap.com>


> There will be a 
> 
> struct file *shmem_file_setup(char * name, loff_t size)
> 
> which gives you an open sruct file to an unlinked file of size
> size. You can then do
> 
> down(&current->mm->mmap_sem);
> user_addr = (void *) do_mmap (file, addr, size, prot, flags, 0);
> up(&current->mm->mmap_sem);
> 
> with that struct file. You can look at shmget/shmat in ipc/shm.c. They
> use the same procedure form kernel space. 

Looks interesting.

There looks to be a logical mapping between CreateFileMapping() + MEM_SHARED
and your shmem_file_setup(), as long as anonymously named sections are catered
for (not difficult).

There also looks to be a logical mapping between MapViewOfFile() and how you
propose do_mmap() should be used.

At the moment, I have to do most of do_mmap for myself when
implementing CreateFileMapping() with SEC_IMAGE as a parameter since I need to
change the VMA ops table. But that only applies to where a file-backed PE
Image (EXE/DLL) is being mapped.

I'm not sure how shared sections in PE Images are handled on all versions of
Windows (ie: whether they are actually shared), but I image I could adapt your
mechanism for that too. I'd probably just have to create a SHMEM file and load
the backing data into it, and then use the SHMEM as the file to attach to the
VMA for that section (and then it's someone else's problem as far as swapping
is concerned).

If you want a look at what I've done, then you can find it at:

   ftp://infradead.org/pub/people/dwh/wineservmod-20001213.tar.bz2

It will hopefully be in CVS on winehq soon as well.

Look at the files called wineservmod/section* these implement the setting up
of VMAs in the current processes address space (though don't actually do the
page-in as yet).

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

  reply	other threads:[~2000-12-13 17:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-08 13:23 [PATCH,preliminary] cleanup shm handling Christoph Rohland
2000-12-08 15:13 ` David Howells
2000-12-08 20:04   ` Christoph Rohland
2000-12-13 11:51     ` David Howells
2000-12-13 13:52       ` Christoph Rohland
2000-12-13 16:43         ` David Howells [this message]
2000-12-13 17:15           ` Christoph Rohland
2000-12-13 17:29             ` David Howells
2000-12-08 18:26 ` Linus Torvalds
2000-12-08 22:21   ` Christoph Rohland
2000-12-08 22:36     ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23640.976725805@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=cr@sap.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox