public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Question] Can we release vma that include code when one process is running?
@ 2005-09-15  6:50 liyu@WAN
  2005-09-15 12:46 ` Nick Piggin
  0 siblings, 1 reply; 4+ messages in thread
From: liyu@WAN @ 2005-09-15  6:50 UTC (permalink / raw)
  To: LKML

Hi, All:

    I am writing a patch to swap process memory to swap partition or 
swap file.
We think this make system speed up on PC that more little memory. It have
a bit like with page replacement algorithm depend application hit, but 
ours idea is
more easier.We found, if we try swap out openoffice.org, this way  can 
save more
than 50M memory, and when switch task to run openoffice.org again, it do 
not read
all data that did swapped from swap space at most time.

    According to result of experimmnt, the anonymous memory of one 
process are more than code
and data, even, it look some shared library as private code.

    As general rule, we can only some swap anonymous memory. this's OK! 
I also done that.
However my question is if we release vma that include code when one 
process is running?
Of course, if the refcnt of vma is more than one, it can not be released 
yet. In fact,
I writing one patch to do this, some it do successfully on some simple 
process, but
in more time, I will get a SIGSEGV!

    I am running IA32 architecture, I used one little python script to 
try this. and
get SIGSEGV each time. I dump memory that include that code, they are 
too simple:
   
    ...
    nop
    int $0x80
    ret
    nop
    ...

    It seem that code in other place jump here to enter kernel. this is 
in a anonymous
code area.
    At first time, I think this SIGSEGV will trigger by anonymous code 
that is swapped,
but I wrote one specical condition check to filte out this sort of code, 
IOW, I do
not swap out it. but I still get SIGSEGV.

    May be, we can not be release the vma that include code? or, Is 
there have some errors
 in my words for page fault?

   
   
sailor



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-18  8:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-15  6:50 [Question] Can we release vma that include code when one process is running? liyu@WAN
2005-09-15 12:46 ` Nick Piggin
2005-09-16  8:02   ` liyu@WAN
2005-09-18  8:15     ` Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox