[LU-9347] Getting BLKSSZGET using ioctl Created: 14/Apr/17  Updated: 14/Sep/17  Resolved: 31/Aug/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.7.0
Fix Version/s: Lustre 2.10.1, Lustre 2.11.0

Type: Question/Request Priority: Minor
Reporter: Mahmoud Hanafi Assignee: Emoly Liu
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Rank (Obsolete): 9223372036854775807

 Description   

According to my web searches, the approved way to find out the
needed alignment for the i/o is the result of the BLKSSZGET ioctl:

ioctl (fd, BLKSSZGET, &(align))

However, on Lustre we get the error:

Inappropriate ioctl for device

Is this ioctl supported and I'm just doing it wrong?
Or is this ioctl indeed not allowed on Lustre ? And if so,
what is the approved way to find out the alignment ?



 Comments   
Comment by Peter Jones [ 17/Apr/17 ]

Emoly

Could you please assist with this one?

Thanks

Peter

Comment by Andreas Dilger [ 17/Apr/17 ]

Mahmoud, what is the requirement for the alignment? Is this for O_DIRECT on the client, or something else?

Comment by Mahmoud Hanafi [ 18/Apr/17 ]

The I/O will be issued from a client. We want to ensure alignment of IO for max throughput.

Comment by Andreas Dilger [ 24/Apr/17 ]

The optimal IO size for maximum performance is returned via stat(2) on the filename or fstat(2) on the open file descriptor:

         blksize_t   st_blksize;/* optimal file sys I/O ops blocksize */

For Lustre this is typically 1MB or 2MB. The BLKSSZGET ioctl is for returning the minimum alignment for O_DIRECT. For Lustre this is 4096 bytes (PAGE_SIZE), though on other filesystems it is typically 512 or 4096 bytes (sector size).

Comment by Andreas Dilger [ 24/Apr/17 ]

Emoly, I think for Lustre it would be possible to return PAGE_SIZE from ll_file_ioctl() for this call.

Comment by Gerrit Updater [ 17/Aug/17 ]

Emoly Liu (emoly.liu@intel.com) uploaded a new patch: https://review.whamcloud.com/28578
Subject: LU-9347 ioctl: Add BLKSSZGET ioctl support
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 8db1f7c135b3b482ebb2bacb49a3a1e315b0cf25

Comment by Jay Lan (Inactive) [ 22/Aug/17 ]

Hi Emoly, should I consider #28578 patchset #4 good and cherry-pick that one?

Comment by Peter Jones [ 22/Aug/17 ]

Jay

I would advise holding off until the fix has landed to master if possible - it is still subject to further change until then

Peter

Comment by Gerrit Updater [ 31/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28578/
Subject: LU-9347 ioctl: Add BLKSSZGET ioctl support
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: dcc32cd7d0d89a49f0c73ecf99130a2678442e55

Comment by Peter Jones [ 31/Aug/17 ]

Landed for 2.11

Comment by Gerrit Updater [ 05/Sep/17 ]

Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/28861
Subject: LU-9347 ioctl: Add BLKSSZGET ioctl support
Project: fs/lustre-release
Branch: b2_10
Current Patch Set: 1
Commit: 0f524780288c1a59de0e44c0f839cf7bb0657dde

Comment by Gerrit Updater [ 14/Sep/17 ]

John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/28861/
Subject: LU-9347 ioctl: Add BLKSSZGET ioctl support
Project: fs/lustre-release
Branch: b2_10
Current Patch Set:
Commit: 7d89cc84b7f82fe847d481aa70ea38bb345968ed

Generated at Sat Feb 10 02:25:23 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.