Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-21197

llite: pin user pages for length-only unaligned DIO

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      Unaligned DIO currently uses one flag for both "needs a bounce buffer" and "sends a partial-page BRW". When only the I/O length is not page-aligned (file offset and user buffer starts are page-aligned), user pages already map 1:1 onto file pages, so copying the whole range into a bounce buffer is unnecessary and costs CPU/bandwidth.

      Separate bounce vs pin:

      • Add ll_dio_can_pin(): pin user pages when the file offset and every user segment start on a page boundary, and only the last segment may end mid-page.
      • A mid-page end with more I/O after that segment still bounces (would break 1:1 file-page mapping).
      • Non user-backed iterators and encrypted files (partial page padded to an encryption unit) keep the old rule and pin only fully aligned I/O.
      • Partial last pages still require the OST unaligned_dio feature and llite.unaligned_dio; unaligned AIO remains refused.
      • is_unaligned_directio() / the readv/writev loop path follows the same bounce vs pin split so length-only unaligned DIO is not forced through the per-segment bounce path.

      Test: sanity/119s — length-only DIO (aligned offset/buffer, size not page-aligned) checks vfstrace for the pin path (no ", bounce"), and confirms EINVAL when llite.unaligned_dio=0.

      Related: LU-13805 (unaligned direct i/o)

            kxu Keguang Xu
            kxu Keguang Xu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: