Re: [PATCH 15/22] Do not disable interrupts in free_page_mlock()

From: KOSAKI Motohiro
Date: Thu Apr 23 2009 - 20:07:30 EST


> > @@ -556,6 +555,7 @@ static void __free_pages_ok(struct page *page, unsigned int order)
> > unsigned long flags;
> > int i;
> > int bad = 0;
> > + int clearMlocked = PageMlocked(page);
> >
> > for (i = 0 ; i < (1 << order) ; ++i)
> > bad += free_pages_check(page + i);
> > @@ -571,6 +571,8 @@ static void __free_pages_ok(struct page *page, unsigned int order)
> > kernel_map_pages(page, 1 << order, 0);
> >
> > local_irq_save(flags);
> > + if (unlikely(clearMlocked))
> > + free_page_mlock(page);
>
> I wonder what the compiler does in the case
> CONFIG_HAVE_MLOCKED_PAGE_BIT=n. If it is dumb, this patch would cause
> additional code generation.

if CONFIG_HAVE_MLOCKED_PAGE_BIT=n, PageMlocked() is {return 0;} then
gcc can remove following code, I think.
if (0)
free_page_mlock(page)



--
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/