[DRBD-user] cpu affinity (documentation bugs?)

Roland Friedwagner roland.friedwagner at wu.ac.at
Thu Jan 27 12:56:51 CET 2011

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


after reading the available documentation in DRBD User-Guide

  A mask of 12 (00001100) implies DRBD may use the third and fourth CPU.

and the man page drbd.conf:

  The default value of cpu-mask is 0, which means that
  DRBD's kernel threads should be spread over all CPUs of the machine.
  This value must be given in hexadecimal notation.

I set the config parameter cpu-mask in drbd.conf to 255 
(to enable usage of all 8 available cores) but got this:

  # ps u 4387
  root      4387  3.5  0.0      0     0 ?        S     2010 1539:29 [drbd0_worker]
  # taskset -c -p 4387
  pid 4387's current affinity list: 0,2,4,6

But expected this list: 0,1,2,3,4,5,6,7

=> Conclusion:

  1. The example in DRBD User-Guide is simply wrong 
     (drbd.conf: "cpu-mask 12;"   =>   affinity list: 1,4)

  2. The cpu-mask parameter has to be specified, as stated in the man page,
     as Hexstring ("cpu-mask ff;" to get the first 8 cpus) in drbd.conf

  3. But if the parameter cpu-mask is explicit set to zero in drbd.conf
     (to get it run on _all_ cpus) I get only the second cput (affinity list: 1).
     So in this aspect the man page is wrong about the default.

@linbit: Could this be fixed in User-Guide and man page

And I'm not sure, if it can safely fixed by setting the mask on running
[drbd1_worker], [drbd1_receiver] and [drbd1_asender] tasks like

  taskset -c -p 0-7 <drbdX_yyy pids>

(Because I won't like to shutdown drbd resources on primary)
Or may this triggers some race condition and drbd hangs or show other 
erratic behaviour?

Kind Regards,

Roland.Friedwagner at wu.ac.at            Phone: +43 1 31336 5377
IT Services - WU (Vienna University of Economics and Business) 

More information about the drbd-user mailing list