Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Lars Ellenberg <lars.ellenberg@linbit.com>
To: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [CASE-30] dec_ap_bio wakeup condition difference between V8.4.7 and V9.0.1
Date: Thu, 10 Mar 2016 15:04:03 +0100	[thread overview]
Message-ID: <20160310140403.GY17669@soda.linbit> (raw)
In-Reply-To: <CAF6H8oHKSrNsOA2UnaT_jOfQgvrBNEQh3B-BUNH=823=a5WhGA@mail.gmail.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.

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

  reply	other threads:[~2016-03-10 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 12:39 [Drbd-dev] [CASE-30] dec_ap_bio wakeup condition difference between V8.4.7 and V9.0.1 Jaeheon Kim
2016-03-10 14:04 ` Lars Ellenberg [this message]
2016-03-11  0:26   ` Jaeheon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160310140403.GY17669@soda.linbit \
    --to=lars.ellenberg@linbit.com \
    --cc=drbd-dev@lists.linbit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox