Re: problem with MAP_SHARED|MAP_ANONYMOUS mapping in openMosix-2.4.26-1

Ratna Manoj Bolla <[email protected]>
Newsgroups gmane.linux.cluster.openmosix.devel
Message-ID <[email protected]>
Patch for the problem:

diff -Naur --exclude=CVS --exclude=configs ./old/mm/mmap.c ./new/mm/mmap.c
--- ./old/mm/mmap.c     2005-09-23 14:56:20.000000000 +0530
+++ ./new/mm/mmap.c     2005-09-26 13:57:36.000000000 +0530
@@ -552,6 +552,7 @@
                         vm_flags &= ~(VM_SHARED | VM_MAYSHARE);
                         /* fall through */
                 case MAP_SHARED:
+                       reason_to_come_back |= DSTAY_FOR_MONKEY;
                         break;
                 }
         }

--Ratna Manoj.
On Mon, 26 Sep 2005, Moshe Bar wrote:

> Ratna
>
> Do you have a patch to fix this bug?
>
> Moshe
>
> On 9/25/05, Ratna Manoj Bolla <[email protected]> wrote:
>>
>>
>> Sir,
>>
>> May be you are modifying /proc/pid/migrate manually, in this case -1 will
>> be returned by the write system call because of the condition check in
>> proc_mosix_pid_set_migrate() in hpc/hpcproc.c .
>>
>> 1673 if (task != current)
>> 1674 return (-EPERM);
>>
>>
>> if the process_to_be_migrated, itself (sharing MAP_SHARED|MAP_ANONYMOUS
>> page with some other process) writesB some node no in /proc/pid/migrate
>> then it is migrating(it should not migrate) and giving wrong result.
>>
>> OR if you manually modify /proc/pid/goto, it is migrating.
>>
>> I am attaching the om_test.c which is forking a child and writing a node
>> no in /proc/pid/migrate.
>>
>> Ratna
>>
>> On Sun, 25 Sep 2005, Moshe Bar wrote:
>>
>>> Ratna
>>>
>>> Just tried to recreate the problem and I can't. It's not migrating the
>>> process when I use mmap shared.
>>>
>>> Moshe
>>>
>>> On 9/25/05, Ratna Manoj Bolla <[email protected]> wrote:
>>>>
>>>>
>>>>
>>>>
>> //-----------------------------------------------------------------------------
>>>> #include<stdio.h>
>>>> #include<sys/mman.h>
>>>> #include <sys/types.h>
>>>> #include <sys/stat.h>
>>>> #include <fcntl.h>
>>>> main() {
>>>> int *a =
>>>> mmap(0,4096,PROT_READ|PROT_WRITE,MAP_SHARED|MAP_ANONYMOUS,0,0);
>>>> *a = 0;
>>>> if(fork())
>>>> while(1) { sleep(2); ++(*a); }
>>>> else
>>>> while(1) { printf("%d\n",*a); sleep(2); }
>>>> }
>>>>
>>>>
>>>>
>> //------------------------------------------------------------------------------
>>>>
>>>> The output of this program should be
>>>> 0
>>>> 1
>>>> 2
>>>> 3
>>>> .
>>>> .
>>>>
>>>> but output would remain constant after migrating one of the processes.
>>>>
>>>> openMosix shold not allow migrating processes sharing
>>>> MAP_SHARED|MAP_ANONYMOUS pages.
>>>>
>>>> from,
>>>> Ratna Manoj Bolla,
>>>> M.Tech IInd year,
>>>> dept. of CSE,
>>>> Indian Institute of Technology,
>>>> Guwahati,
>>>> India.
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------
>>>> SF.Net email is sponsored by:
>>>> Tame your development challenges with Apache's Geronimo App Server.
>>>> Download it for free - -and be entered to win a 42" plasma tv or your
>> very
>>>> own Sony(tm)PSP. Click here to play:
>> http://sourceforge.net/geronimo.php
>>>> _______________________________________________
>>>> openMosix-devel mailing list
>>>> openMosix-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>>>> https://lists.sourceforge.net/lists/listinfo/openmosix-devel
>>>>
>>>
>>
>>
>


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.