Re: Why would some process swap in place of reclaiming free(cached) memory

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

 



On Thu, Feb 21, 2013 at 12:19 AM, Soham Chakraborty
<sohamwonderpiku4u@xxxxxxxxx> wrote:
>
>
> On Thu, Feb 21, 2013 at 10:45 AM, Mandeep Sandhu
> <mandeepsandhu.chd@xxxxxxxxx> wrote:
>>
>> > I know the pages are kept on disk initially and then swapped in as
>> > needed/referenced.  Thus if there are code pages where none of the code in
>> > the page has been executed since starting the app, then that page will
>> > remain on disk until the application logic eventually invokes it.  At that
>> > point it will be demand loaded from disk.
>> >
>> > During that early stage, do the never used pages show as swapped out?
>> > If so, why would anyone want all those never used pages to be brought into
>> > ram just to sit there unused?
>>
>> Are you saying that pages of code segment (of an executable) which
>> have not been accessed yet, are copied onto the swap space from their
>> location on the disk when the program is exec'ed? Or do they remain on
>> disk (in their original location) and loaded into memory only when
>> accessed (and _then_ possibly swapped out)? If they remain on disk,
>> then that wouldn't show up in swap space, right?
>
>
> If the code segment of an executable which hasn't been accessed, they will
> remain on disk because they have fixed filesystem backing. Only when they
> are referenced, they will go to cache and then when inactive and/or while
> reclaiming, they will end up in disk again. But, afaik, anything which has a
> filesystem backing, a fixed storage backing, doesn't go to swap. This part
> is pretty clear to me. Only anon pages go to swap and something which is on
> disk, is not anon in first place.

Soham,

I agree with the details you describe.  My question was if the pages
not in RAM, but available in filesystem backing were being included in
the count of pages swapped out that you were asking about.

Let me rephrase my answer:

Total addressable pages = Allocated RAM pages + filesystem Backing
Storage pages + pages swapped out

I don't see the filesystem backing storage pages typically included in
performance tools like top.

Therefore my question was if those userspace reporting tools use the
term swap to represent both the truely swapped out pages and the
filesystem backing storage pages.

Seems like you know the MM system better than me, so I won't argue for
or against my theory. I'll just leave it as a question.

Greg

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[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