Re: flushing allocated kernel memory on disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 17 August 2005 21:54, Jan Hudec wrote:
> On Wed, Aug 17, 2005 at 12:32:11 +0000, Vincenzo Mallozzi wrote:
 
> > I've also expanded swap memory to include all of the data structures my 
module 
> > creates (up to 3.7 GB).
> 
> And did you also teach the module to swap the data?

No, I'm not because initially I just think that also kernel data can be 
swapped out. And then I read from "Understanding Linux Kernel" and other 
books that the swapout() function acts only on processes address space.
 
> Again, why do the data need to be in kernel. I am not saying there is no
> reason for it, but could you explain what you are doing a bit? There may be
> another solution.

Oh, yes. There's no reason for maintaining data in kernel-space but I know 
that allocation , from within a kernel module, happens by means of kmalloc, 
vmalloc and get_free_pages functions but all of these allocate memory in 
kernel space as they are called from within a kernel module.

Now, I briefly explain what I'm doing.

I'm creating a kernel module by which I do various checkpoint of some threads 
I'm monitoring.
I've to create various system state, each of which contains a snapshot of the 
system at any instant. In other word, I've two data structures, one 
containing usefull info about task_struct of each thread and the other 
containing usefull information about shared memory descriptor (and related 
vmas). this two data structures are contained in a greter data structures the 
describes each state of the system.
I've to create such a state when some events occur (I'll not describe the 
events that have to occur. they're not important for the sake of module 
description).
After I've created such a state, I've to push it on a stack. The problem is 
that after the creation of some states, system memory will going to empty.  
So I need to flush the contents of the stack on disk and consequently free 
memory.
I do it monitoring the memory used by the system.

I hope I've well explained my problem but I don't know how I can allocate this 
memory in Userland from within a module.

I'm very grateful to you for the moral and technical support you gave me.
Thanks.
Vincenzo Mallozzi.

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux