commit | 03c2eaeff970d8a909c7ed7a17fc9b8338eb27e8 | [log] [tgz] |
---|---|---|
author | Federico 'Morg' Pareschi <morg@google.com> | Fri Dec 09 02:20:54 2022 +0000 |
committer | crosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Dec 20 06:42:18 2022 +0000 |
tree | 230ed30102aa5c8a8eb3aebfc8f62b8c5c2e4516 | |
parent | a85d391fbba047667b0be41effbce41de4b28c29 [diff] |
Reland "fs: Reduce number of open() calls in passthroughfs" This is a reland of commit 55a9bccead02fe03839f6a31dcd3b4a070f1c481 The fix is to make sure we drop to the lock guard acquired by the inodes mutex, so we don't end up in a deadlock. By splitting the if statement and separating the else block, the guard is dropped automatically. Original change's description: > fs: Reduce number of open() calls in passthroughfs > > Instead of always opening a new file every time we do an entry lookup, > check first if the entry already exists in our inode map. > > I ran a trace test while loading a game on arcvm with and without this > patch. > > Without patch: > System-wide trace: > newfstatat calls = 19211 > openat calls = 13189 > ~68% ratio of all newstat() calls vs openat() call > > virtiofs trace: > newfstatat calls = 11958 > openat calls = 9899 > 82% ratio of virtiofs newstat() calls vs openat() call > > With patch: > System-wide trace: > newfstatat calls = 20242 > openat calls = 12954 > 64% ratio of all newstat() calls vs openat() call > > virtiofs trace: > newfstatat calls = 2223 > openat = 273 > ~12% ratio of virtiofs newstat() calls vs openat() call > > This is a significant reduction of unnecessary syscalls in virtiofs > (82% -> 12%) > > BUG=b:261922849 > TEST=loaded a game in arcvm and compared syscall % count > > Change-Id: I28acbae05900d9735ba3730ee106368ddc792476 > Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4091563 > Auto-Submit: Morg <morg@chromium.org> > Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> > Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org> Bug: b:261922849 Change-Id: Ib885cb5f2b3f725405df2eecc641228042ea2093 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4105201 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org> Auto-Submit: Morg <morg@chromium.org>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on Chrome OS devices.