On 08.02.2007 [12:21:31 +1100], David Gibson wrote:
> On Wed, Feb 07, 2007 at 12:47:17PM -0800, Nishanth Aravamudan wrote:
> > On 07.02.2007 [14:27:10 -0600], Adam Litke wrote:
> > > On Wed, 2007-02-07 at 11:37 -0800, Nishanth Aravamudan wrote:
> > > > @@ -831,6 +832,57 @@ static void remap_segments(struct seg_info *seg, 
> > > > int num)
> > > >         /* The segments are all back at this point.
> > > >          * and it should be safe to reference static data
> > > >          */
> > > > +
> > > > +       /*
> > > > +        * This pagecache dropping code should not be used for shared
> > > > +        * segments.  But we currently only share read-only segments, so
> > > > +        * the below check for PROT_WRITE is implicitly sufficient.
> > > > +        *
> > > > +        * Note: if minimal_copy is enabled, it is overkill to try and
> > > > +        * save huge pages here, as we will end up using more than
> > > > +        * normal anyways. Also, due to limitations on certain
> > > > +        * architectures, we would need to avoid prefaulting in the
> > > > +        * extracopy area so as to not use an inordinate number of huge
> > > > +        * pages.
> > > > +        */
> > > > +       if (minimal_copy) {
> > > 
> > > Now the added indent is really making me want to say this is getting
> > > large enough to want its own function.  I think the previous patch to
> > > store the extracopy info in the seg array allows you to pass only one
> > > param (the seg array) into the drop_cache() function.
> > 
> > heh, yep, updated again:
> > 
> > Author: Nishanth Aravamudan <[EMAIL PROTECTED]>
> > Date:   Mon Feb 5 14:22:02 2007 -0800
> > 
> > elflink: drop hugepage cached pages for writable segments
> > 
> > We currently use extra hugepages for writable segments because of the
> > first MAP_SHARED mmap() which stays resident in the page cache.  Use a
> > helper function to force a COW for the filesz portion, as well as the
> > extracopy area, of writable segments and then fadvise() to drop the page
> > cache pages while keeping our PRIVATE mapping. This is mutually
> > exclusive to segment sharing, but is also orthogonal in code because we
> > only allow sharing of read-only segments.  Also, if the minimal_copy
> > algorithm is disabled, we disable this optimization.
> > 
> > Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>
>  
> Looks reasonable.  However, we probably don't want to apply this patch
> for real until the kernel bug which makes the fadvise() screw up the
> reserved pages accounting is fixed.

Yep, agreed. And the fix was sent to Linus today (I posted in response
to my first thread on this topic that Ken Chen's patch fixed it for me).
It also won't be committed until 1.1 is out the door (which should be
soon, just waiting on some benchmarking).

Thanks,
Nish

-- 
Nishanth Aravamudan <[EMAIL PROTECTED]>
IBM Linux Technology Center

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to