On Tue 13-04-21 15:24:32, Michal Hocko wrote:
> On Tue 13-04-21 12:47:44, Oscar Salvador wrote:
> [...]
> > +static void prep_new_huge_page(struct hstate *h, struct page *page, int
> > nid)
> > +{
> > + __prep_new_huge_page(page);
> > spin_lock_irq(&hugetlb_lock);
> > - h->nr_huge_pages++;
> > - h->nr_huge_pages_node[nid]++;
> > + __prep_account_new_huge_page(h, nid);
> > spin_unlock_irq(&hugetlb_lock);
> > }
>
> Any reason to decouple the locking from the accounting?
OK, I spoke too soon. The next patch already has the locking around when
calling this. Please add a lockdep assert into the helper to make the
locking expectations more obvious.
With that
Acked-by: Michal Hocko <[email protected]>
--
Michal Hocko
SUSE Labs