Re: Want to know something about mlock or shmctl via SHMLOCK



sorcerer skrev:
> I think I will implement this using get_user_pages at last but I will
> always lock the memory in the beginning when the system starts. I ever
> implemeted memory copy between two processes using get_user_pages
> (in fact, I used it as process_cond_broadcast).

I don't understand what you are trying to do in your kernel module.
You seem to want the module to get at the data sent, fast. But what
will you then do with the data?

>>From what you say it sounds like you will just pass the data on to
another process, which will be waiting for it, or possibly first
ensuring somehow that the other process is "ready for it".

But what about using shared memory in the two processes? If the amount
of data is large, isn't shared memory the fastest? That would be copy
once - to the shared memory. Or rather, generate once - in the shared
memory?

Then what more you need is synchronization. What about using a futex?

> And I doubt what I
> implemented is buggy since I am no linux VMM expert.

You mean you doubt it is free of bugs? (I fail to see how being "no
linux VMM expert" helps avoiding bugs.) Or did I miss something?

> I did not take the
> reference of ptrace.c while I implemented that.

Sorry, what do you mean?

-Enrique

.



Relevant Pages

  • [HPADM] RE: SHMMAX modification
    ... The problem is that you are using a 32bit version of Oracle ... will allow access to as much as 1750 megs of shared memory. ... the kernel maintains a map relating the virtual ...
    (HP-UX-Admin)
  • [HPADM] Re: HP-UX Oracle/ Shared memory segment question
    ... Does this mean if you set the shmax to be the same size of the memory on ... I read the article below about setting the shared memory for Oracle. ... HP-UX Shared Memory Segments for a 64-Bit Oracle Instance ...
    (HP-UX-Admin)
  • Re: OpenOffice does not start when Firefox open
    ... openings and closings of OO so I don't think it's a memory leak) ... you're left with this small sliver dividing up the remaining space. ... able to allocate a total amount of shared memory that is more than the ...
    (comp.os.os2.apps)
  • Re: Windows XP Shared memory woes
    ... What is shared memory? ... One of them is 3 gig in size. ... Using process explorer, and several of my own breadcrumbs, I find that I ...
    (microsoft.public.dotnet.framework.performance)
  • Re: [RFC v11][PATCH 05/13] Dump memory address space
    ... in one or more chunk: each chunk begins with a header that specifies ... should not change in the interim anyways, the locks protects us from, e.g. ... Even scanning over a large amount of memory, you aren't going to see a performance difference for accessing pgarr from an argument vs off of field in ctx which is going to be cache-hot. ... It is strictly necessary when it comes to handling shared memory. ...
    (Linux-Kernel)