[openib-general] [PATCH 3 of 4] IB/mthca: fix non-cache-coherent CPUs with memfree

Michael S. Tsirkin mst at mellanox.co.il
Wed Feb 14 08:04:38 PST 2007


> Quoting Roland Dreier <rdreier at cisco.com>:
> Subject: Re: [PATCH 3 of 4] IB/mthca: fix non-cache-coherent CPUs with memfree
> 
>  > > I don't see anything that ever bumps chunk->nsg if we're allocating a
>  > > coherent region and we end up needing more than one allocation to do
>  > > it.
>  > 
>  > Yes but this is intentional.
> 
>  > No, I think the code is fine and this patch will break things:
>  > chunk->nsg is needed only for non-coherent memory to call pci_unmap_sg:
> 
> what about this code in mthca_memfree.h?
> 
> 	static inline void mthca_icm_next(struct mthca_icm_iter *iter)
> 	{
> 		if (++iter->page_idx >= iter->chunk->nsg) {

Correct. Good catch.
	
> the call to pci_unmap_sg you're worried about is in
> mthca_free_icm_pages(), which can't be called for coherent memory
> anyway, so I don't see a problem with that.
> 
> So I think my patch is correct and needed.

Yes, I agree. I'll also put it in OFED.
Thanks!

-- 
MST




More information about the general mailing list