min_chan(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

Hey bestie, welcome to the min_chan(9) manual πŸ’– β€” yes, min_chan(9), the one and only. It finds the channel with min count and in the same NUMA-node as the CPU. That's the whole assignment, and it ate. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

struct dma_chan * min_chan (enum dma_transaction_type cap , int cpu );

🌸 ARGUMENTS 🌸

  • cap β€” the capability to match, aka the specific vibe the channel has to have. ✨
  • cpu β€” the CPU index which the channel should be close to. Think "near this CPU, please." 🫢

πŸ’– DESCRIPTION πŸ’–

Okay so here's the situation: if some channels are close to the given CPU, the one with the lowest reference count is returned. That's the main character pick. πŸ‘‘

Otherwise? The CPU is ignored, and only the reference count is taken into account. Not me ignoring the CPU β€” it's literally what the function does 😭. Lowkey simple, highkey important, iykyk.

🚨 Lock check, bestie: this must be called under dma_list_mutex. Like, dma_list_mutex is not a suggestion. Do not skip it. Periodt.

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/dma/dmaengine.c β€” plus the whole squad (iykyk): dev_to_dma_chan(9), struct dma_chan_tbl_ent(9), dma_chan_is_local(9), dma_channel_rebalance(9), balance_ref_count(9), dma_chan_get(9), dma_chan_put(9), dma_find_channel(9), dma_issue_pending_all(9), dma_get_slave_channel(9), __dma_request_channel(9), dma_request_chan(9), dma_request_chan_by_mask(9), devm_dma_request_chan(9), dmaengine_get(9), dmaengine_put(9), dma_async_device_register(9), dma_async_device_unregister(9), dmaenginem_async_device_register(9), dma_wait_for_async_tx(9), dma_run_dependencies(9).


Catch you later, bestie 🫢 β€” this page comes from ./drivers/dma and is dated October 2026, still repping the min_chan(9) manual. Mwah πŸ’‹

πŸ“¦ where this page comes from