[Drbd-dev] [CASE-30] dec_ap_bio wakeup condition difference between V8.4.7 and V9.0.1

Lars Ellenberg lars.ellenberg at linbit.com
Thu Mar 10 15:04:03 CET 2016


On Thu, Mar 10, 2016 at 09:39:46PM +0900, Jaeheon Kim wrote:
> 2. Sources
> 
> 1) Ver 9.0.1
> 
>     static inline void inc_ap_bio(struct drbd_device *device, int rw)
>     {
>         wait_event(device->misc_wait, inc_ap_bio_cond(device, rw));
>     }
> 
>     static inline void dec_ap_bio(struct drbd_device *device, int rw)
>     {
>          int ap_bio = atomic_dec_return(&device->ap_bio_cnt[rw]);
>        .........
> 
>          if (ap_bio == 0)
>                 wake_up(&device->misc_wait);
>     }
> 
> 
> 2) Ver 8.4.7
> 
>     static inline void inc_ap_bio(struct drbd_device *device)
>     {
>          wait_event(device->misc_wait, inc_ap_bio_cond(device));
>     }
> 
>     static inline void dec_ap_bio(struct drbd_device *device)
>     {
>          int mxb = drbd_get_max_buffers(device);
>          int ap_bio = atomic_dec_return(&device->ap_bio_cnt);
> 
>         .............
> 
> 
>          /* this currently does wake_up for every dec_ap_bio!
>           * maybe rather introduce some type of hysteresis?
>           * e.g. (ap_bio == mxb/2 || ap_bio == 0) ? */
> 
>           if (ap_bio < mxb)
>                  wake_up(&device->misc_wait);
>     }
> 
> 
> 
> 3. Questions
> 
> 1) See "1. Stacks".
>     I think, The Linux "drbd_make_request+0x14a/0x360 [drbd]" will probably
>     mean the same thing as the Windows "drbd!inc_ap_bio+0x49".
>     What do you think about it?
> 
> 2) In version 8.4.7, dec_ap_bio wakes up misc_wait when condition is
> "ap_bio < max".
>     I mean, this version has greater tolerance than version 9.0.1.
>     My question is Why do you change this condition from "ap_bio < max" to
> "ap_bio == 0"  in version 9.0.1?


Because there is no more "max" in 9, no-one can possibly wait for
count < max. There are however things that still wait for count == 0.

Though we probably will re-introduce some (resource wide) limit
on the maximum amount of "in-flight bios" we accept to be queued.

"misc" wait queue is used for a lot of things,
and a lot of things wake it.


-- 
: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker
: R&D, Integration, Ops, Consulting, Support

DRBD® and LINBIT® are registered trademarks of LINBIT


More information about the drbd-dev mailing list