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

From: Michal Hocko
Date: Thu Aug 16 2012 - 14:06:11 EST


On Thu 16-08-12 18:34:59, Will Deacon wrote:
> On Thu, Aug 16, 2012 at 06:25:27PM +0100, Michal Hocko wrote:
> > On Thu 16-08-12 17:09:54, Will Deacon wrote:
> > > On Wed, Aug 08, 2012 at 05:26:07PM +0100, Michal Hocko wrote:
> > > > I guess the cleanest way is to hook into dequeue_huge_page_node and add
> > > > something like arch_clear_hugepage_flags.
> > >
> > > I hooked into enqueue_huge_page instead, but how about something like this?:
> >
> > Do you have any specific reason for that? enqueue_huge_page is called on
> > pages which potentially never get used so isn't that wasting a bit?
> > Not that it would be wrong I was just thinking why shouldn't we do it
> > when the page is actualy going to be used for sure.
>
> I just did it that way to match the flag clearing for normal pages. I can
> move it into dequeue if you think it's worthwhile but in the worst case it
> just adds a clear_bit call, so I doubt it's measurable.

I do not have a strong opinion on that but the flags come in cleared when
they are freshly allocated (gather_surplus_pages) so then it would be
more appropriate in free_huge_page when enqueue_huge_page is called.

But this is just a nit.

>
> Will

--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/