On Thu, 2005-06-30 at 11:23 -0700, Dave Hansen wrote:
> On Thu, 2005-06-30 at 11:11 -0700, Chandra Seetharaman wrote:
> > On Thu, 2005-06-30 at 14:52 +0900, YAMAMOTO Takashi wrote:
> > > > +static inline void
> > > > +ckrm_clear_page_class(struct page *page)
> > > > +{
> > > > +       struct ckrm_zone *czone = page_ckrmzone(page);
> > > > +       if (czone == NULL)
> > > > +               return;
> > > > +       sub_use_count(czone->memcls, 0, page_zonenum(page), 1);
> > > > +       kref_put(&czone->memcls->nr_users, memclass_release);
> > > > +       set_page_ckrmzone(page, NULL);
> > > >  }
> > > 
> > > are you sure if it's safe?
> > > this function is called with zone->lock held,
> > > and memclass_release calls kfree.
> > 
> > i don't understand why you think it is a problem to call kfree with lock
> > held( i agree calling kmalloc with wait flag when a lock is being held
> > is not correct).
> 
> kfree->__cache_free
>       ->cache_flusharray
>       ->free_block
>       ->slab_destroy
>       ->kmem_freepages
>       ->free_pages
>       ->__free_pages
>       ->__free_pages_ok
>       ->free_pages_bulk:
> 
>       spin_lock_irqsave(&zone->lock, flags);
> 
Oh.... I did not realize Takashi was mentioning zone->lock... i assumed
zone->lru_lock...

memory controller does not use zone->lock, it only uses zone->lru_lock..
I 'll look thru to see if that leads to a deadlock...

> Deadlock.
> 
> Whew!!!
> 
> -- Dave
> 
-- 

----------------------------------------------------------------------
    Chandra Seetharaman               | Be careful what you choose....
              - [EMAIL PROTECTED]   |      .......you may get it.
----------------------------------------------------------------------




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to