BT GATT DM Workqueue Stack Size

Hello,

I had a question about the BT GATT DM Workqueue used in gatt_dm.c.

In NCS 2.8.0, the BT GATT DM Workqueue was introduced as an alternative to the System Workqueue to allow for scheduling non-blocking callbacks from the GATT Discovery Manager.

One difference between the BT GATT DM Workqueue and the System Workqueue is stack size. The System Workqueue's stack size is configurable while the BT GATT DM Workqueue is a hidden Kconfig option.

When testing GATT Discovery Manager error cases, I found the error handling in my application was just barely exceeding the BT GATT DM Workqueue stack size of 1300 leading to a crash. This same error handling would not crash with the System Workqueue implementation because I could configure the stack size of that queue to be larger.

I would like to continue to use the BT GATT DM Workqueue as recommended, but I would also like to keep the same error handling in my application. For now, I am modifying my copy of NCS to allow myself to configure BT_GATT_DM_WORKQ_STACK_SIZE.

Would Nordic consider allowing CONFIG_BT_GATT_DM_WORKQ_STACK_SIZE to be configurable in the future?

Thanks

Parents
  • An additional question:  Why was CONFIG_BT_GATT_DM_WORKQ_STACK_SIZE deliberately made a hidden option?

    The comment for that CONFIG says "Hidden option for workqueue stack size. Should be derived from system requirements."

    The problem is that that workqueue includes callbacks to our application code, which to me is part of the system. Even though we want to limit the amount of work done in that context as part of the callback, why do we have to limit our stack use too, as constrained by the hidden CONFIG_BT_GATT_DM_WORKQ_STACK_SIZE?

Reply
  • An additional question:  Why was CONFIG_BT_GATT_DM_WORKQ_STACK_SIZE deliberately made a hidden option?

    The comment for that CONFIG says "Hidden option for workqueue stack size. Should be derived from system requirements."

    The problem is that that workqueue includes callbacks to our application code, which to me is part of the system. Even though we want to limit the amount of work done in that context as part of the callback, why do we have to limit our stack use too, as constrained by the hidden CONFIG_BT_GATT_DM_WORKQ_STACK_SIZE?

Children
No Data
Related