vpelletier / python-functionfs

Pythonic API for linux's functionfs
GNU General Public License v3.0
40 stars 13 forks source link

get rid of bioset processes? #10

Closed monkey-jsun closed 6 years ago

monkey-jsun commented 6 years ago

Vincent,

After some running, I seem to notice there are quite a few bioset process in the system. Do you know how they are created and what they are for? Should we get rid of them for long running? They seem to be clearly related to USB gadget.

root 33 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 34 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 35 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 36 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 37 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 38 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 39 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 40 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 41 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 42 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 43 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 44 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 45 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 46 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 47 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 48 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 49 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 50 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 51 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 52 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 53 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]
root 54 0.0 0.0 0 0 ? S< 06:25 0:00 [bioset]

vpelletier commented 6 years ago

Hello,

These kernel threads are related to block I/O (BIO). Given the list given, and assuming the number is stable however many times you plug:unplug, bind and unbind the gadget, that they would be proportional to the number of configured endpoints. I would expect their presence to be essentially free, merely dispatching USB I/Os between the UDC and userland. Is their presence causing any issue ?

vpelletier commented 6 years ago

Here is where the thread gets spawned, but it's not related to usb gadgets:

https://elixir.bootlin.com/linux/v4.15.7/source/block/bio.c#L1957

I took a quick look at functionfs but could not wuickly identify the code match leading to this. As by default I consider it to be a non-issue, I prefer not to spend much time investigating it.