Skip to content

Relax Throttle::_reset_max conditions and associated unit tests#39

Merged
gregsfortytwo merged 1 commit intomasterfrom
unknown repository
Feb 5, 2013
Merged

Relax Throttle::_reset_max conditions and associated unit tests#39
gregsfortytwo merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Feb 5, 2013

Removes a condition in Throttle::_reset_max by which the waiting queue is only
Signal()ed if the new maximum is lower than the current maximum.
There is no evidence of a use case where such a restriction would be
useful. In addition waking up a thread when the maximum increases
gives it a chance to immediately continue the suspended process
instead of waiting for the next put().

Create a new test file covering 100% of src/Throttle.{cc,h} lines of code.
The following methods are tested:

  • Throttle::Throttle with and without a maximum
  • Throttle::~Throttle when each pending Cond is deleted
  • Throttle::take
  • Throttle::get when updating the maximum ( lower or higher ),
    when going to sleep waiting for the count to lower under
    the maximum, when going to sleep because another thread is
    already asleep waiting
  • Throttle::get_or_fail when there is no maximum,
    when requesting a count that is larger than the maximum, either
    when the current value is under the maximum or above the maximum.
  • Throttle::wait when used to reset the maximum and wake up
    another thread asleep waiting

All asserts checking the arguments sanity are exercised ( negative argument
for Throttle::take etc. ).
Adds the LGPLv2+ licensing terms to COPYING along with the others.
Adds a Contributors section to the AUTHORS file.

Notes:
Testing asserts outputs verbose error messages that should be silenced
but it does not seem possible.

Signed-off-by: Loic Dachary loic@dachary.org

Removes a condition in Throttle::_reset_max by which the waiting queue is only
Signal()ed if the new maximum is lower than the current maximum.
There is no evidence of a use case where such a restriction would be
useful. In addition waking up a thread when the maximum increases
gives it a chance to immediately continue the suspended process
instead of waiting for the next put().

Create a new test file covering 100% of src/Throttle.{cc,h} lines of code.
The following methods are tested:

* Throttle::Throttle with and without a maximum
* Throttle::~Throttle when each pending Cond is deleted
* Throttle::take
* Throttle::get when updating the maximum ( lower or higher ),
  when going to sleep waiting for the count to lower under
  the maximum, when going to sleep because another thread is
  already asleep waiting
* Throttle::get_or_fail when there is no maximum,
  when requesting a count that is larger than the maximum, either
  when the current value is under the maximum or above the maximum.
* Throttle::wait when used to reset the maximum and wake up
  another thread asleep waiting

All asserts checking the arguments sanity are exercised ( negative argument
for Throttle::take etc. ).
Adds the LGPLv2+ licensing terms to COPYING along with the others.
Adds a Contributors section to the AUTHORS file.

Notes:
Testing asserts outputs verbose error messages that should be silenced
but it does not seem possible.

Signed-off-by: Loic Dachary <loic@dachary.org>
gregsfortytwo added a commit that referenced this pull request Feb 5, 2013
Relax Throttle::_reset_max conditions and associated unit tests
@gregsfortytwo gregsfortytwo merged commit 13e2226 into ceph:master Feb 5, 2013
@gregsfortytwo
Copy link
Member

Awesome, thanks!

chamdoo pushed a commit to chamdoo/ceph that referenced this pull request Nov 13, 2015
XinzeChi pushed a commit to XinzeChi/ceph that referenced this pull request Jan 29, 2016
Wip librbd fix qos

Reviewed-by: Zhiqiang Wang <zhiqiang@xsky.com>
Tested-by: Tianshan Qu <tianshan@xsky.com>
ddiss added a commit to ddiss/ceph that referenced this pull request May 17, 2016
…eatures-again

Revert "rbd: update default image features"
ivancich added a commit to ivancich/ceph-fork that referenced this pull request Sep 27, 2017
93f760c Merge pull request ceph#40 from ivancich/wip-change-client-rec-init
824d92d Merge pull request ceph#38 from ivancich/wip-improve-next-request-return
941d1be Change initialization of IndIntruHeapData to C++'s value-initialization to better future-proof the code. Since at the momeent they are scalars they'll be zero-initialized (i.e., to zero). However if they ever become something more complex, their default constructors will be called.
19153d9 Merge pull request ceph#39 from ivancich/wip-delta-rho-plugin
a94c4e0 Allow the calculations of rho and delta to be handled by a "tracker" specified via template parameter (i.e., by static polymorphism). The tracker follows a simple interface constisting of three functions and one static function.
856a26c Clarify code surrounding the return value of do_next_request.
b632cfd Merge pull request ceph#37 from ivancich/wip-fix-uninit-data
e6df585 The coverity scan published in ceph-devel on 2017-09-21 revealed some uninitialized data in a constructor. This fixes that.
165a025 Merge pull request ceph#34 from TaewoongKim/anticipate
72e4df9 Make anticipation_timeout configurable with config file
2f06d63 Add anticipation duration that keeps from resetting tag values to the current time

git-subtree-dir: src/dmclock
git-subtree-split: 93f760c
trociny pushed a commit to trociny/ceph that referenced this pull request Sep 28, 2017
…ot enabled by gmayyyha · Pull Request ceph#17660 · ceph/ceph · GitHub

* striping-feature-21360:
  librbd: fix don't send get_stripe_unit_count if striping is not enabled
rjfd added a commit to rjfd/ceph that referenced this pull request Jan 29, 2018
galsalomon66 added a commit that referenced this pull request Jan 14, 2021
…rescan (#39)

* the purpose fo this commit is to bypass boost::spirit rescan (calling to bind-action more than once per the same text)

Signed-off-by: gal salomon <gal.salomon@gmail.com>

* s3select: fix substring

Align ceph s3select with aws.

Signed-off-by: Albin Antony <aantony@redhat.com>

* add flags to CMAKE_CXX_FLAGS

Signed-off-by: Albin Antony <aantony@redhat.com>

* wip s3select: trim operator

Signed-off-by: Albin Antony <aantony@redhat.com>

Co-authored-by: gal salomon <gal.salomon@gmail.com>
Co-authored-by: Albin Antony <aantony@localhost.localdomain>
jecluis pushed a commit to jecluis/ceph that referenced this pull request Sep 19, 2022
rgw/sfs: add ability to list buckets via meta_list_*() functions
jmolmo pushed a commit to jmolmo/ceph that referenced this pull request Dec 19, 2023
mgr/call_home_agent: add "request_time" to all events payload
athanatos pushed a commit to athanatos/ceph that referenced this pull request Feb 14, 2025
Made delta/rho calculations more flexible via tracker plug-in; make default a borrowing tracker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant