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

Jaeheon Kim jhkim at mantech.co.kr
Fri Mar 11 01:26:10 CET 2016


2016-03-10 23:04 GMT+09:00 Lars Ellenberg <lars.ellenberg at linbit.com>:

> 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.
>
>
I see.


> Though we probably will re-introduce some (resource wide) limit
> on the maximum amount of "in-flight bios" we accept to be queued.
>
>
Could you explain more detail?


> "misc" wait queue is used for a lot of things,
> and a lot of things wake it.
>
>
Yes, I know that.
However, conversely, if anyone do not wake up to this "misc",  this pending
case could be occurred.
This case had generated during the big file copy. And  you can see
"drbd_make_request+0x14a/0x360
[drbd]" at Linux stack which is similar Windows.
So I doubt whether inc_ap_bio is pending forever because the wake-up
condition failed at this dec_ap_bio function.

Anyway, Did you reproduce it in Linux?

Thanks.



> --
> : 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
> _______________________________________________
> drbd-dev mailing list
> drbd-dev at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-dev
>



-- 

[image: 설명: logo]

*JaeHeon Kim.  Director        jhkim*@mantech.co.kr

[image: 본문 이미지 1]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20160311/d7cc1891/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4544 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20160311/d7cc1891/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 16229 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20160311/d7cc1891/attachment-0003.png>


More information about the drbd-dev mailing list