Re: [PATCH] mm: hugetlb: flush dcache before returning zeroed huge page to userspace

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

 



On Tue 07-08-12 17:03:37, Will Deacon wrote:
> <resurrecting this thread>
> 
> On Thu, Jul 12, 2012 at 12:57:08PM +0100, Michal Hocko wrote:
> > On Thu 12-07-12 12:26:45, Will Deacon wrote:
> > > Well, the comment in linux/page-flags.h does state that:
> > > 
> > >  * PG_arch_1 is an architecture specific page state bit.  The generic code
> > >  * guarantees that this bit is cleared for a page when it first is entered into
> > >  * the page cache.
> > > 
> > > so it's not completely clear cut that the architecture should be responsible
> > > for clearing this bit when allocating pages from the hugepage pool.
> > 
> > I think the wording is quite clear. It guarantees it gets cleared not
> > clears it. So it is up to an arch specific functions called from the
> > generic code to do that.
> 
> If we have to do this in arch-specific functions then:
> 
> 	1. Where should we do it?
> 	2. Why don't we also do this for normal (non-huge) pages?

As you describe below, it is done during the page freeing but hugetlb
tries to be clever and it doesn't do the reinitialization when the page
is just returned back to the pool. We have arch_release_hugepage and 
arch_prepare_hugepage defined only for s390 and they are not called on
the way in resp. out of the pool because we do not want to pointlessly
go over ptep free&alloc cycle.
I guess the cleanest way is to hook into dequeue_huge_page_node and add
something like arch_clear_hugepage_flags.
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]