[arvados] updated: 2.7.0-6111-gbea14966e8

git repository hosting git at public.arvados.org
Sat Mar 9 16:01:42 UTC 2024


Summary of changes:
 services/fuse/arvados_fuse/__init__.py | 48 +++++++++++++++++++---------------
 1 file changed, 27 insertions(+), 21 deletions(-)

       via  bea14966e8b30871dc2d417f98fa95d3faf963ea (commit)
      from  f1a8112ffc7940e3ab4b39c38086ed63d2d87459 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit bea14966e8b30871dc2d417f98fa95d3faf963ea
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Sat Mar 9 10:58:29 2024 -0500

    21541: Process cache management operations with llfuse lock in batch
    
    This avoids flapping the llfuse lock when processing a bunch of kernel
    invalidations.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index 5f06502051..e1334552f8 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -282,39 +282,45 @@ class Inodes(object):
             _logger.debug("del_entry on inode %i with refcount %i", entry.inode, entry.ref_count)
 
     def _inode_remove(self):
+        locked_ops = []
         while True:
             try:
+                locked_ops.clear()
+
                 entry = self._inode_remove_queue.get(True)
-                with llfuse.lock:
-                    # Process this entry
-                    _logger.debug("_inode_remove %s", entry)
-                    self._inode_op(entry)
-
-                    while True:
-                        try:
-                            # Drain the queue of any other entries
-                            entry = self._inode_remove_queue.get(False)
-                            _logger.debug("_inode_remove %s", entry)
-                            self._inode_op(entry)
-                        except queue.Empty:
-                            break
+                # Process this entry
+                _logger.debug("_inode_remove %s", entry)
+                self._inode_op(entry, locked_ops)
+
+                # Drain the queue of any other entries
+                while True:
+                    try:
+                        entry = self._inode_remove_queue.get(False)
+                        _logger.debug("_inode_remove %s", entry)
+                        self._inode_op(entry, locked_ops)
+                    except queue.Empty:
+                        break
 
+                with llfuse.lock:
+                    for lk in locked_ops:
+                        self._inode_op(entry, None)
                     for entry in self.inode_cache.evict_candidates():
                         self._remove(entry)
             except Exception as e:
                 _logger.exception("_inode_remove")
 
-    def _inode_op(self, op):
+    def _inode_op(self, op, locked_ops):
         if op[0] == "remove":
-            self._remove(op[1])
+            if locked_ops is None:
+                self._remove(op[1])
+            else:
+                locked_ops.append(op)
         if op[0] == "invalidate_inode":
-            with llfuse.lock_released:
-                _logger.debug("sending invalidate inode %i", op[1])
-                llfuse.invalidate_inode(op[1])
+            _logger.debug("sending invalidate inode %i", op[1])
+            llfuse.invalidate_inode(op[1])
         if op[0] == "invalidate_entry":
-            with llfuse.lock_released:
-                _logger.debug("sending invalidate to inode %i entry %s", op[1], op[2])
-                llfuse.invalidate_entry(op[1], op[2])
+            _logger.debug("sending invalidate to inode %i entry %s", op[1], op[2])
+            llfuse.invalidate_entry(op[1], op[2])
         if op[0] == "evict_candidates":
             pass
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list