Giter VIP home page Giter VIP logo

Comments (8)

axboe avatar axboe commented on September 15, 2024

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.

from linux.

mronstro avatar mronstro commented on September 15, 2024

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.

from linux.

mronstro avatar mronstro commented on September 15, 2024

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.

from linux.

mronstro avatar mronstro commented on September 15, 2024

Yep, you were right. Seems like it depends on 4k page size. Interesting.

from linux.

mronstro avatar mronstro commented on September 15, 2024

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?

from linux.

axboe avatar axboe commented on September 15, 2024

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);

from linux.

mronstro avatar mronstro commented on September 15, 2024

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.

from linux.

mronstro avatar mronstro commented on September 15, 2024

Thx for the assistance, will close this issue since it is an issue in RonDB rather.

from linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.