2008-12-02 11:34:19

by peter meng

[permalink] [raw]
Subject: question related page frame reclaim on embedded system

Hi

1, I have a question related page frame reclaim .
As i understood , under low memory pressure page frame reclaiming will
swap Least Recently Used cache to disk .
So my question is assume no swap space ,how to works ?
Whether the Least Recently Used slab cache , inode cache etc will
be discard since no swap space .

2. BTW ,I have already used my gmail account subscribe the linux kernel mail list .but can not post the question to mail list , i used plain text format .
why ? I have seen many people use account of gmail to post question .



Thanks advanced .
Best Regards .
Peter Meng



2008-12-02 11:40:29

by KOSAKI Motohiro

[permalink] [raw]
Subject: Re: question related page frame reclaim on embedded system

> 1, I have a question related page frame reclaim .
> As i understood , under low memory pressure page frame reclaiming will
> swap Least Recently Used cache to disk .
> So my question is assume no swap space ,how to works ?
> Whether the Least Recently Used slab cache , inode cache etc will
> be discard since no swap space .

Yes, page cache and slab cache (include inode cache and dentry cache) can be dropped
although no swap.


> 2. BTW ,I have already used my gmail account subscribe the linux kernel mail list .but can not post the question to mail list , i used plain text format .
> why ? I have seen many people use account of gmail to post question .

I don't know.
I can post by gmail.

But, One caution.
gmail web interface is a bit silly. it can't post patch because
it trim tab and space.



2008-12-03 01:30:35

by peter meng

[permalink] [raw]
Subject: Re: question related page frame reclaim on embedded system


Hi,Kosaki

Thank you very much .
I have another question about share memory . Assume a process create a share memory , seems the page that the process used can not be discard or swap out when they are no longer used by any process or no swap space .

1.whether the maped page of the share memory is persistent in system until
system restart ? if not how page frame reclaiming process it ?


Thanks advanced
Best Regards.
Peter Meng

--- On Tue, 12/2/08, KOSAKI Motohiro <[email protected]> wrote:

> From: KOSAKI Motohiro <[email protected]>
> Subject: Re: question related page frame reclaim on embedded system
> To: [email protected]
> Cc: [email protected], [email protected]
> Date: Tuesday, December 2, 2008, 7:40 PM
> > 1, I have a question related page frame reclaim .
> > As i understood , under low memory pressure page frame
> reclaiming will
> > swap Least Recently Used cache to disk .
> > So my question is assume no swap space ,how to works ?
> > Whether the Least Recently Used slab cache , inode
> cache etc will
> > be discard since no swap space .
>
> Yes, page cache and slab cache (include inode cache and
> dentry cache) can be dropped
> although no swap.
>
>
> > 2. BTW ,I have already used my gmail account subscribe
> the linux kernel mail list .but can not post the question to
> mail list , i used plain text format .
> > why ? I have seen many people use account of gmail to
> post question .
>
> I don't know.
> I can post by gmail.
>
> But, One caution.
> gmail web interface is a bit silly. it can't post patch
> because
> it trim tab and space.


2008-12-03 01:48:30

by KOSAKI Motohiro

[permalink] [raw]
Subject: Re: question related page frame reclaim on embedded system

>
> Hi,Kosaki
>
> Thank you very much .
> I have another question about share memory . Assume a process create a share memory ,
> seems the page that the process used can not be discard or swap out

No. Linux can swap out COW shared memory too. see swap cache related code.
Also, Linux can discard non-dirty and file mapped shared page.

but, yes.
Linux can't discart dirty or anonymous mapped page.


> when they are no longer used by any process or no swap space .
>
> 1.whether the maped page of the share memory is persistent in system until
> system restart ? if not how page frame reclaiming process it ?

No.
Linux manage page reference count.
forrk increment it. exit decrement it.
So, when process exiting, Linux can discard non used page immediately.

IOW, reclaim provide "page discard/swap although page is still used" mechanism.

2008-12-04 09:56:32

by peter meng

[permalink] [raw]
Subject: Re: question related page frame reclaim on embedded system

Hi,Kosaki

1. what happens if used IPC share memory ?
As i knew IPC share memory use anonymous mapping ,but not sure my understand is correctly .

Thanks advanced .
Best Regards.
Peter


--- On Wed, 12/3/08, KOSAKI Motohiro <[email protected]> wrote:

> From: KOSAKI Motohiro <[email protected]>
> Subject: Re: question related page frame reclaim on embedded system
> To: [email protected]
> Cc: [email protected], [email protected]
> Date: Wednesday, December 3, 2008, 9:48 AM
> >
> > Hi,Kosaki
> >
> > Thank you very much .
> > I have another question about share memory . Assume a
> process create a share memory ,
> > seems the page that the process used can not be
> discard or swap out
>
> No. Linux can swap out COW shared memory too. see swap
> cache related code.
> Also, Linux can discard non-dirty and file mapped shared
> page.
>
> but, yes.
> Linux can't discart dirty or anonymous mapped page.
>
>
> > when they are no longer used by any process or no swap
> space .
> >
> > 1.whether the maped page of the share memory is
> persistent in system until
> > system restart ? if not how page frame reclaiming
> process it ?
>
> No.
> Linux manage page reference count.
> forrk increment it. exit decrement it.
> So, when process exiting, Linux can discard non used page
> immediately.
>
> IOW, reclaim provide "page discard/swap although page
> is still used" mechanism.


2008-12-04 10:17:12

by KOSAKI Motohiro

[permalink] [raw]
Subject: Re: question related page frame reclaim on embedded system

> Hi,Kosaki
>
> 1. what happens if used IPC share memory ?
> As i knew IPC share memory use anonymous mapping ,but not sure my understand is correctly .

Yes.
if you don't free IPC share memory, it remain on the system until reboot.



>
> Thanks advanced .
> Best Regards.
> Peter
>
>
> --- On Wed, 12/3/08, KOSAKI Motohiro <[email protected]> wrote:
>
> > From: KOSAKI Motohiro <[email protected]>
> > Subject: Re: question related page frame reclaim on embedded system
> > To: [email protected]
> > Cc: [email protected], [email protected]
> > Date: Wednesday, December 3, 2008, 9:48 AM
> > >
> > > Hi,Kosaki
> > >
> > > Thank you very much .
> > > I have another question about share memory . Assume a
> > process create a share memory ,
> > > seems the page that the process used can not be
> > discard or swap out
> >
> > No. Linux can swap out COW shared memory too. see swap
> > cache related code.
> > Also, Linux can discard non-dirty and file mapped shared
> > page.
> >
> > but, yes.
> > Linux can't discart dirty or anonymous mapped page.
> >
> >
> > > when they are no longer used by any process or no swap
> > space .
> > >
> > > 1.whether the maped page of the share memory is
> > persistent in system until
> > > system restart ? if not how page frame reclaiming
> > process it ?
> >
> > No.
> > Linux manage page reference count.
> > forrk increment it. exit decrement it.
> > So, when process exiting, Linux can discard non used page
> > immediately.
> >
> > IOW, reclaim provide "page discard/swap although page
> > is still used" mechanism.
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/