> > > 3. As we know that the user space process can't access kernel address space and when shmat system call is > > > used the shared memory is mapped to the Process's Virtual Address space, > > > Now the question is from where in the memory does shared memory come from... i mean does it come from > > > User Space or Kernel Space.........or from process's Data Segment.... ?????? > > > > > > It is common for the same page of physical memory to be mapped > > both by userspace processes and by the kernel. > > I think he was more asking ``where does the memory come from?'' and, > excepting the points you mention above, it's most important to > displace any notions that userspace is somehow different from a > process' data segment (from the mail above) - userspace only deals in > one kind of memory, virtual memory, but it's mapped in different vmas. Is n't this holds true for kernel space ?? I realize the fact that both user space process and the kernel can be mapped to the same page and it is only the Discriptor Privilege Level (DPL) flag of segment registers which differ v.i.z 0 -- for kernel mode 3 -- for user mode. what was confusing me.... is the default ratio of Physical Memory i.e Kernel Space : User space (1:3).. v.i.z i was in the impression that if Shared memory comes from Kernel Space, there is a patch which can change this ratio i.e to 2:2 or 3:1 .............and this will let me have more of shared memory. > > Shared memory areas are virtual memory. Kernel address space > > is virtual memory. and what i understand from above discussion and the kindaa experiments which i did yesterday... is that....Here too we have the concept of virtual memory v.i.z by changing /etc/sysctl.conf i was able to get/attach and use (i.e by shmget/shmat) 2.5 GB of Shared memory (In my System RAM is 1GB and Swap Space is 2 GB). If anyone cud clearify the below point it wud be very much appreciated. i.e in 32 bit system 4GB can be addressed and this is how we get User Space = 3Gb & Kernelspace = 1Gb now in 64 bit system this 4gb limit is increased to 512Gb (if i remember this correctly) now....do we have this kindaa ratio....here too..?? i.e User Space = 384 GB and Kernel Space : 128 GB Thank you for your inputs. Vishal. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/