You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed Asahi Linux on an Apple M1 Pro laptop and it worked like a charm.
I installed the latest branch of RonDB. This branch is 22.05.
I managed to compile after installing a few extra packages.
I executed a number of test cases using MTR (MysqlTestRun).
Most test cases failed in a method called set_direct_io which sets up the file to
use O_DIRECT using fcntl calls. These calls fail. So I presume that O_DIRECT is
not yet supported by the NVMe driver.
The application is buggy and assumes 4k pages, and asahi runs 16k pages by default. O_DIRECT isn't a property of the storage driver, it's just as read/write as far as that is concerned.
Presume by application that you mean RonDB, RonDB actually always writes in 32 kB chunks, so a 16k page size shouldn't
be an issue I presume. However the bug happens in that fcntl(fileDescriptor, , SETFL, flags | O_DIRECT) fails where flags
is retrieved with a fcntl call using GETFL. This call is done after opening the file.
Debugged the code a bit more, it seems that fstat returns that block_size is 4k, but when one attempts to use this
size in a pread call, the pread returns EINVAL indicating that O_DIRECT cannot be used with 4k alignment only.
However should not the fstat return 16k if that is the minimum alignment for O_DIRECT?
No, stat correctly returns the file system block size, which is not the same thing as required memory alignment. They just happen to overlap on eg x86, because the page size is 4K as well. You can query the latter with sysconf(_SC_PAGESIZE);
Thx, read up a bit on O_DIRECT, seem to be common consensus that it is a bit hard to figure out the alignment size.
But obviously the current code in RonDB needs to be extended to handle the requirements in Asahi Linux.
Activity
axboe commentedon May 16, 2022
The application is buggy and assumes 4k pages, and asahi runs 16k pages by default. O_DIRECT isn't a property of the storage driver, it's just as read/write as far as that is concerned.
mronstro commentedon May 16, 2022
Presume by application that you mean RonDB, RonDB actually always writes in 32 kB chunks, so a 16k page size shouldn't
be an issue I presume. However the bug happens in that fcntl(fileDescriptor, , SETFL, flags | O_DIRECT) fails where flags
is retrieved with a fcntl call using GETFL. This call is done after opening the file.
mronstro commentedon May 16, 2022
Actually looking at the function set_direct_io you might be right, will look another round to see what goes on
in the RonDB code.
mronstro commentedon May 16, 2022
Yep, you were right. Seems like it depends on 4k page size. Interesting.
mronstro commentedon May 16, 2022
Debugged the code a bit more, it seems that fstat returns that block_size is 4k, but when one attempts to use this
size in a pread call, the pread returns EINVAL indicating that O_DIRECT cannot be used with 4k alignment only.
However should not the fstat return 16k if that is the minimum alignment for O_DIRECT?
axboe commentedon May 16, 2022
No, stat correctly returns the file system block size, which is not the same thing as required memory alignment. They just happen to overlap on eg x86, because the page size is 4K as well. You can query the latter with sysconf(_SC_PAGESIZE);
mronstro commentedon May 16, 2022
Thx, read up a bit on O_DIRECT, seem to be common consensus that it is a bit hard to figure out the alignment size.
But obviously the current code in RonDB needs to be extended to handle the requirements in Asahi Linux.
mronstro commentedon May 16, 2022
Thx for the assistance, will close this issue since it is an issue in RonDB rather.
HID: uclogic: Fix user-memory-access bug in uclogic_params_ugee_v2_in…
HID: uclogic: Fix a work->entry not empty bug in __queue_work()
powerpc/rtas: use correct function name for resetting TCE tables
drm/nouveau/firmware: Fix SG_DEBUG error with nvkm_firmware_ctor()
nouveau/firmware: use dma non-coherent allocator
nouveau/firmware: use dma non-coherent allocator
ASoC: da7213: Initialize the mutex
mtd: spi-nor: sst: Fix SST write failure
mtd: spi-nor: sst: Fix SST write failure
i2c: cros-ec-tunnel: defer probe if parent EC is not present
ACPICA: Apply pack(1) to union aml_resource
tty: serial: sh-sci: fix RSCI FIFO overrun handling
tty: serial: sh-sci: fix RSCI FIFO overrun handling
ASoC: da7213: Initialize the mutex
scsi: storvsc: Fix scheduling while atomic on PREEMPT_RT
binder: fix UAF in binder_thread_release()
binder: fix UAF in binder_thread_release()
nstree: check listing permission before taking a namespace reference