summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* cephadm: handle "systemctl start" failures during deployment betterAdam King2024-10-246-4/+84
| | | | | | | | | | | | | | | | | Previously it was assumed when the deploy command fails whatever daemon we were trying to deploy does not exist on the host. However, in the specific case where deploy fails trying to start the daemon's systemd unit this is not the case. This leads us to both cleanup the keyring for the daemon and also causes us to not trigger a refresh of the daemons on the host which can make cephadm attempt to deploy another daemon instead of just reporting the existing one as failed. To get around this we need to handle that specific failure as a success in the mgr module's deploy workflow so that we refresh the daemons and report the failure as intended. https://tracker.ceph.com/issues/68536 Signed-off-by: Adam King <adking@redhat.com>
* Merge pull request #59982 from rkachach/fix_issue_mgmt_gw_high_availabilityAdam King2024-10-2411-105/+249
|\ | | | | | | | | | | | | Adding HA support for mgmt-gateway and oauth2-proxy services Reviewed-by: Adam king <adking@redhat.com> Reviewed-by: Anthony D'Atri <anthonyeleven@users.noreply.github.com> Reviewed-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
| * mgr/cephadm: adding UT for new mgmt-gateway functionalityRedouane Kachach2024-10-171-12/+72
| | | | | | | | Signed-off-by: Redouane Kachach <rkachach@ibm.com>
| * mgr/cephadm: fixing deps handling for mgmt-gatewayRedouane Kachach2024-10-172-11/+17
| | | | | | | | | | | | | | | | | | Fixes: https://tracker.ceph.com/issues/68377 this change uses the port also in addition to the daemon name when building mgmt-gateway dependencies Signed-off-by: Redouane Kachach <rkachach@ibm.com>
| * mgr/cephadm: adding HA support for mgmt-gateway and ouath2-proxyRedouane Kachach2024-10-179-84/+155
| | | | | | | | | | | | | | | | | | | | | | | | adding HA support for mgmt-gateway and ouath2-proxy. In addition, logic is add to prevent unnecessary daemons restart during mgr failover. Previously, without the management gateway, some daemons, such as Prometheus, had an explicit dependency on the manager because we needed to point to the active manager. With the management gateway, this explicit dependency is no longer necessary, as it automatically handles routing requests to the active manager. Signed-off-by: Redouane Kachach <rkachach@ibm.com>
| * mgr/cephadm: adding md5_hash stable hash to the utils collectionRedouane Kachach2024-10-171-0/+7
| | | | | | | | Signed-off-by: Redouane Kachach <rkachach@ibm.com>
* | Merge pull request #58898 from neesingh-rh/wip-fix-strict-iec-castRishabh Dave2024-10-242-30/+68
|\ \ | | | | | | | | | | | | | | | | | | src/common : proper handling of units in `strict_iec_cast` Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Rishabh Dave <ridave@redhat.com> Reviewed-by: Dhairya Parmar <dparmar@redhat.com>
| * | src/test: test to check proper handling of units by strict_iec_castneeraj pratap singh2024-09-241-0/+27
| | | | | | | | | | | | | | | Fixes: https://tracker.ceph.com/issues/67169 Signed-off-by: Neeraj Pratap Singh <neesingh@redhat.com>
| * | src/common : proper handling of units in `strict_iec_cast`neeraj pratap singh2024-09-241-30/+41
| | | | | | | | | | | | | | | Fixes: https://tracker.ceph.com/issues/67169 Signed-off-by: Neeraj Pratap Singh <neesingh@redhat.com>
* | | Merge pull request #60119 from rishabh-d-dave/mgr-vol-commentsRishabh Dave2024-10-241-2/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | mgr/vol: add comments to explain queuing data structures Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Jos Collin <jcollin@redhat.com>
| * | | mgr/vol: add comments to explain queuing data structuresRishabh Dave2024-10-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some comment to explains the purpose and details of data structures that are used for queuing of async jobs since right now it's not obvious from initialization. Signed-off-by: Rishabh Dave <ridave@redhat.com>
* | | | Merge pull request #60355 from rhcs-dashboard/carbonize-hosts-formafreen232024-10-245-124/+128
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | mgr/dashboard: carbonize Cluster > Hosts form Reviewed-by: Afreen Misbah <afreen@ibm.com>
| * | | | mgr/dashboard: carbonize Cluster > Hosts formDnyaneshwari2024-10-235-124/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: https://tracker.ceph.com/issues/68264 Signed-off-by: Dnyaneshwari Talwekar <dtalweka@redbat.com>
* | | | | Merge pull request #59027 from hit1943/65971_fixVenky Shankar2024-10-241-0/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | client: fixed a bug that read operation hung Reviewed-by: Venky Shankar <vshankar@redhat.com>
| * | | | | cephfs: Fixed a bug that read operation hung in Client::get_caps ↵chentao.20222024-08-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when the Fc caps is wanted but revoked by the mds, and the Fc cap refs is no-zero Fixes: https://tracker.ceph.com/issues/65971 Signed-off-by: Tod Chen <chentao.2022@bytedance.com>
* | | | | | Merge pull request #60276 from ceph/bypass_srYingxin2024-10-241-0/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test/crimson: disable stall-detector on aarch64 to fix asan failures Reviewed-by: Kefu Chai <tchaikov@gmail.com> Reviewed-by: Matan Breizman <mbreizma@redhat.com> Reviewed-by: Yingxin Cheng <yingxin.cheng@intel.com>
| * | | | | | test/crimson: disable stall-detector on aarch64 to fix asan failurescailianchun2024-10-231-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ceph crimson uses seastar on debug mode which would enable ASAN, while stall-detector uses glibc backtrace function which would cause ASAN failures on aarch64. Reason see scylladb/scylladb#15090 (comment) Because arm ci servers in lab are "elderly", causing stall happened often, this PR is to disable stall-detector until seastar upstream migrated to libunwind, see scylladb/seastar#1878 Seastar does not provide a function to disable stall-detector, at present, increase stall-detector time to avoid stall-detector timeout on arm platform. fixes: https://tracker.ceph.com/issues/65635 Signed-off-by: cailianchun <arm7star@qq.com>
* | | | | | | Merge pull request #60413 from gbregman/mainGil Bregman2024-10-234-4/+44
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Add namespace netmask parameters to nvmeof configuration
| * | | | | | | mgr/cephadm: Add namespace netmask parameters to nvmeof configurationGil Bregman2024-10-223-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://tracker.ceph.com/issues/68542 Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
| * | | | | | | python-common/ceph/deployment: Add namespace netmask parameters to nvmeof ↵Gil Bregman2024-10-221-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configuration Fixes https://tracker.ceph.com/issues/68542 Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
* | | | | | | | Merge pull request #60399 from rhcs-dashboard/rgw-bucket-get-fix-for-accountafreen232024-10-236-28/+87
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mgr/dashboard: fix bucket get for s3 account owned bucket Reviewed-by: Afreen Misbah <afreen@ibm.com>
| * | | | | | | | mgr/dashboard: fix bucket get for s3 account owned bucketNizamudeen A2024-10-226-28/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Issue 1:** When a bucket is created with a user that is owner by the account user, it fails to fetch the info for the bucket because the owner of that bucket is considered as owned by the account rather than the user. dashboard api try to fetch some info for the bucket on the basis of the bucket owner which in this case fails since its not a real user. To keep the existing behavior as it is and fix the current issue, I am doing a check to make sure the user id exists or not. if it doesn't exist, we goes on to fetch using the dashboard user. **Issue 2** Editing the bucket owner by the account is broken. So disabling the ownership change for the bucket owned by account until we have user account management for rgw in the dashboard Fixes: https://tracker.ceph.com/issues/68622 Signed-off-by: Nizamudeen A <nia@redhat.com>
* | | | | | | | | Merge pull request #58647 from rishabh-d-dave/mgr-vol-mod-disableHemanth2024-10-234-11/+109
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | mgr: allow disabling always-on modules
| * | | | | | | | | mon/MgrMonitor: allow disabling always-on MGR modulesRishabh Dave2024-10-194-7/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new command ("ceph mgr module force disable <module>") that allows forcibly disabling an always-on module. This command should ideally only be used to for cluster recovery. Fixes: https://tracker.ceph.com/issues/66005 Signed-off-by: Rishabh Dave <ridave@redhat.com>
| * | | | | | | | | mon/MgrMontitor: add log entry to support debuggingRishabh Dave2024-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It becomes easier to understand logs when whether command succeeded or not are also logged. Signed-off-by: Rishabh Dave <ridave@redhat.com>
| * | | | | | | | | mon/MgrMonitor: improve a log messageRishabh Dave2024-10-192-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following log message has 3 distinct information (enabled modules, modules that are alwats on and total number of commands enabled) printed on the same line which makes it hard to find one of the information and also makes it comparatively hard to read - 2024-07-17T17:21:16.609+0530 7f534ae006c0 0 mon.a@0(leader).mgr e0 create_initial initial modules iostat,nfs,volumes, always on modules balancer,crash,devicehealth,orchestrator,pg_autoscaler,progress,status,telemetry, 50 commands With this commit it would be easier to read and find needed info - 2024-07-17T17:21:16.609+0530 7f534ae006c0 0 mon.a@0(leader).mgr e0 create_initial initial modules: iostat,nfs,volumes 2024-07-17T17:21:16.609+0530 7f534ae006c0 0 mon.a@0(leader).mgr e0 create_initial always on modules: balancer,crash,devicehealth,orchestrator,pg_autoscaler,progress,status,telemetry 2024-07-17T17:21:16.609+0530 7f534ae006c0 0 mon.a@0(leader).mgr e0 create_initial 50 commands Signed-off-by: Rishabh Dave <ridave@redhat.com>
* | | | | | | | | | Merge pull request #60157 from soumyakoduri/wip-skoduri-lc-nullinstanceSoumya Koduri2024-10-235-8/+30
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rgw/lc: Fix issues with non-current objects with instance empty Reviewed-by: Casey Bodley <cbodley@redhat.com>
| * | | | | | | | | | rgw/lc: Fix issues with non-current objects with instance emptySoumya Koduri2024-10-225-8/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the bucket versioning is enabled, old plain object entry is converted to versioned by updating its instance as "null" in its raw head/old object. However its instance remains empty in the bi list entry. Same is the case for the entries created after versioning is suspended and re-enabled. So to access such objects which are non-current, we need to set rgw_obj_key.instance as 1) "null" to read the actual raw obj and 2) empty while accessing/updating their bi entry. Fixes: https://tracker.ceph.com/issues/68402 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* | | | | | | | | | | Merge pull request #60258 from aclamk/wip-aclamk-cbt-improve-show-labelAdam Kupczyk2024-10-231-5/+10
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | os/bluestore/ceph-bluestore-tool: Modify show-label for many devs
| * | | | | | | | | | os/bluestore/ceph-bluestore-tool: Modify show-label for many devsAdam Kupczyk2024-10-111-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was possible to give multiple devices to cbt: > ceph-bluestore-tool show-label --dev /dev/sda --dev /dev/sdb But is any of devices cannot provide valid label, nothing was printed. Now, always print results. Non readable labels are output as empty dictionaries. Exit code: - 0 if any label properly read - 1 if all labels failed Fixes: https://tracker.ceph.com/issues/68505 Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
* | | | | | | | | | | Merge PR #60106 into mainPatrick Donnelly2024-10-222-4/+4
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/pull/60106/head: msg/async/ProtocolV2: pass `desc` as `std::string_view` to write() Reviewed-by: Patrick Donnelly <pdonnell@ibm.com> Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
| * | | | | | | | | | | msg/async/ProtocolV2: pass `desc` as `std::string_view` to write()Max Kellermann2024-10-072-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All callers really pass a C string literal, and declaring a `std::string` parameter will implicitly create two `std::string` instances: one on the caller's stack, and another one inside write() as parameter to the continuation lambda. This causes considerable and unnecessary overhead. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
* | | | | | | | | | | | Merge PR #60174 into mainPatrick Donnelly2024-10-224-84/+70
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/pull/60174/head: common/Finisher: pass name as std::string_view to ctor common/Finisher: add method get_thread_name() mgr/ActivePyModule: build thread name with fmt mgr/ActivePyModule: return std::string_view instead of std::string copy common/Finisher: use fmt to build strings common/Finisher: un-inline ctor and dtor common/Finisher: add `const` to several fields common/Finisher: merge duplicate field initializers common/Finisher: call notify_one() instead of notify_all() common/Finisher: wake up after pushing to the queue common/Finisher: do not wake up the thread if already running common/Finisher: call logger without holding the lock common/Finisher: use `std::lock_guard` instead of `std::unique_lock` common/Finisher: merge all queue() container methods into one template Reviewed-by: Patrick Donnelly <pdonnell@ibm.com>
| * | | | | | | | | | | | common/Finisher: pass name as std::string_view to ctorMax Kellermann2024-10-102-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This eliminates a temporary `std::string`. Additionally, convert the `tn` parameter to an rvalue reference and move it to `thread_name`. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: add method get_thread_name()Max Kellermann2024-10-102-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows eliminating the copy in `ActivePyModule`. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | mgr/ActivePyModule: build thread name with fmtMax Kellermann2024-10-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | mgr/ActivePyModule: return std::string_view instead of std::string copyMax Kellermann2024-10-102-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This impliciy heap allocation is unnecessary. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: use fmt to build stringsMax Kellermann2024-10-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not only more efficient at runtime, but also shaves 500 bytes code off the binary. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: un-inline ctor and dtorMax Kellermann2024-10-102-25/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This aims to speed up compile times because constructor and destructor contain a lot of code that would be compiled in sources that do not call them. Also this allows removing the "common/perf_counters.h" include. Since there is now only one instantiation of these for all call sites, the binary size shrinks by nearly 1 kB. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: add `const` to several fieldsMax Kellermann2024-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are never changed; `const` prevents accidental changes and allows further compiler optimizations. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: merge duplicate field initializersMax Kellermann2024-10-101-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: call notify_one() instead of notify_all()Max Kellermann2024-10-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As noted in commit cc7ec3e18d1, there is only ever a single `Finisher` thread, therefore the overhead for `notify_all()` can be eliminated. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: wake up after pushing to the queueMax Kellermann2024-10-101-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pushing to the queue may take a long time when the `std::vector` needs to allocate more memory. We should wake up the `Finisher` thread only right before unlocking the `finisher_mutex` to reduce lock contention, because it is the more likely that the mutex can really be acquired when the thread really wakes up. This imitates how commit cc7ec3e18d191575c did it - it refactored only one of the `queue()` overloads, leaving less-than-optimal copies of this piece code in all other overloads. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: do not wake up the thread if already runningMax Kellermann2024-10-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If `finisher_running` is set, then the `Finisher` thread will automatically pick up new items queued by other threads. It is therefore not needed to wake it up and we can eliminate one system call. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: call logger without holding the lockMax Kellermann2024-10-101-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `PerfCounters::inc()` method acquires another lock which can block the calling thread while holding the `finisher_lock` which can cause a lot of lock contention. This can be avoided easily by moving the `PerfCounters::inc()` call out of the protected code block. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: use `std::lock_guard` instead of `std::unique_lock`Max Kellermann2024-10-102-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `std::lock_guard` is all we need here, and the added complexity of `std::unique_lock` is not used and is usually optimized away by the compiler. Using `std::lock_guard` directly will reduce the amount of work that the optimizer needs to do and saves some build CPU cycles. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | common/Finisher: merge all queue() container methods into one templateMax Kellermann2024-10-101-31/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This merges some duplicate code. Only two overloads remain: one for single `Context` pointers and one for all containers. I tried to merge the former into the same template but that led to a larger binary (+7kB) because many pointer overloads were instantiated. This patch (with two overloads) only increases the binary by 8 bytes which is acceptable. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
* | | | | | | | | | | | | Merge PR #60214 into mainPatrick Donnelly2024-10-223-136/+122
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/pull/60214/head: mds/MDCache: use `auto` mds/CDir: use the erase() return value mds/MDCache: remove unnecessary empty() check mds/MDCache: use the erase() return value mds/MDCache: pass iterator by value Reviewed-by: Patrick Donnelly <pdonnell@ibm.com>
| * | | | | | | | | | | | | mds/MDCache: use `auto`Max Kellermann2024-10-091-99/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
| * | | | | | | | | | | | | mds/CDir: use the erase() return valueMax Kellermann2024-10-091-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Max Kellermann <max.kellermann@ionos.com>