RE: [PATCH 03/13] dmaengine: up-level reference counting to the module level

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Sosnowski, Maciej
Date: Friday, December 12, 2008 - 7:28 am

Williams, Dan J wrote:

Dan,

General concern I see about this change is that it makes impossible 
to rmmod ioatdma in case of NET_DMA enabled.
This is a specific case of situation when client is permanently registered in dmaengine,
making it impossible to rmmod any device with "public" channels.
Ioatdma is just an example here.
However in ioatdma case it would be problematic now to switch between CPU and DMA copy modes.
It seems that the only way to disable DMA after loading ioatdma would be raising tcp_dma_copybreak
to some high enough value to direct all buffers to CPU copy path.
This way is yet rather more like hacking than "normal" usage way (like "rmmod ioatdma" used so far).

Another issue I find problematic in this solution is that _any_ client 
declaring its presence in dmaengine causes holding reference for _all_ channels (and blocking them),
does not matter if they are used or not.
I agree with Guennadi's doubts here.
Why not at least hold a reference only for channels with capabilities matching client's ones?


In this case show_in_use will not show if the channel is really in use 
but rather how many clients are present, including these with different capabilities.
Thus this number does not even show number of "potential" users of the channel...
Again, maybe it would be better to limit chan->client_count 
to number of at least potential users ( = matching capabilities)?


As cap_mask is per device not per channel, checking capabilites matching 
is not necessary to be repeated for every channel.
It would be more efficient to do it once yet before 
list_for_each_entry(chan, &device->channels, device_node).


Going through this list_for_each_entry() loop makes sense only if there are any clients,
so maybe it would be more efficient to move "if (dmaengine_ref_count)" check before 
list_for_each_entry(chan, &device->channels, device_node)?

Regards,
Maciej--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/13] dmaengine redux, Dan Williams, (Fri Nov 14, 2:34 pm)
[PATCH 02/13] dmaengine: remove dependency on async_tx, Dan Williams, (Fri Nov 14, 2:34 pm)
[PATCH 06/13] net_dma: convert to dma_find_channel, Dan Williams, (Fri Nov 14, 2:34 pm)
[PATCH 08/13] dmatest: convert to dma_request_channel, Dan Williams, (Fri Nov 14, 2:34 pm)
[PATCH 12/13] dmaengine: remove 'bigref' infrastructure, Dan Williams, (Fri Nov 14, 2:35 pm)
[PATCH 13/13] dmaengine: kill enum dma_state_client, Dan Williams, (Fri Nov 14, 2:35 pm)
Re: [PATCH 02/13] dmaengine: remove dependency on async_tx, Andrew Morton, (Fri Nov 14, 11:02 pm)
Re: [PATCH 08/13] dmatest: convert to dma_request_channel, Andrew Morton, (Fri Nov 14, 11:17 pm)
Re: [PATCH 08/13] dmatest: convert to dma_request_channel, Dan Williams, (Tue Nov 18, 11:24 am)
Re: [PATCH 08/13] dmatest: convert to dma_request_channel, Andrew Morton, (Tue Nov 18, 1:58 pm)
Re: [PATCH 07/13] dmaengine: introduce dma_request_channel ..., Guennadi Liakhovetski, (Tue Dec 2, 8:52 am)
Re: [PATCH 07/13] dmaengine: introduce dma_request_channel ..., Guennadi Liakhovetski, (Tue Dec 2, 10:27 am)
Re: [PATCH 07/13] dmaengine: introduce dma_request_channel ..., Guennadi Liakhovetski, (Tue Dec 2, 2:28 pm)
Re: [PATCH 03/13] dmaengine: up-level reference counting t ..., Guennadi Liakhovetski, (Thu Dec 4, 9:56 am)
Re: [PATCH 03/13] dmaengine: up-level reference counting t ..., Guennadi Liakhovetski, (Thu Dec 4, 12:28 pm)
RE: [PATCH 00/13] dmaengine redux, Sosnowski, Maciej, (Fri Dec 12, 7:27 am)
RE: [PATCH 03/13] dmaengine: up-level reference counting t ..., Sosnowski, Maciej, (Fri Dec 12, 7:28 am)
RE: [PATCH 07/13] dmaengine: introduce dma_request_channel ..., Sosnowski, Maciej, (Fri Dec 12, 7:29 am)
RE: [PATCH 11/13] dmaengine: kill struct dma_client and su ..., Sosnowski, Maciej, (Fri Dec 12, 7:29 am)
RE: [PATCH 03/13] dmaengine: up-level reference counting t ..., Sosnowski, Maciej, (Thu Dec 18, 7:26 am)
RE: [PATCH 07/13] dmaengine: introduce dma_request_channel ..., Sosnowski, Maciej, (Thu Dec 18, 7:33 am)
RE: [PATCH 11/13] dmaengine: kill struct dma_client and su ..., Sosnowski, Maciej, (Thu Dec 18, 7:34 am)
Re: [PATCH 07/13] dmaengine: introduce dma_request_channel ..., Guennadi Liakhovetski, (Fri Jan 30, 4:27 pm)