mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
write anything beyond 4k to be written in 4k pages (#19269)
we were prematurely not writing 4k pages while we could have due to the fact that most buffers would be multiples of 4k upto some number and there shall be some remainder. We only need to write the remainder without O_DIRECT.
This commit is contained in:
@@ -54,8 +54,6 @@ import (
|
||||
|
||||
const (
|
||||
nullVersionID = "null"
|
||||
// Largest streams threshold per shard.
|
||||
largestFileThreshold = 64 * humanize.MiByte // Optimized for HDDs
|
||||
|
||||
// Small file threshold below which data accompanies metadata from storage layer.
|
||||
smallFileThreshold = 128 * humanize.KiByte // Optimized for NVMe/SSDs
|
||||
@@ -2113,11 +2111,11 @@ func (s *xlStorage) writeAllDirect(ctx context.Context, filePath string, fileSiz
|
||||
|
||||
var bufp *[]byte
|
||||
switch {
|
||||
case fileSize > 0 && fileSize >= largestFileThreshold:
|
||||
case fileSize > 0 && fileSize >= xioutil.BlockSizeReallyLarge:
|
||||
// use a larger 4MiB buffer for a really large streams.
|
||||
bufp = xioutil.ODirectPoolXLarge.Get().(*[]byte)
|
||||
defer xioutil.ODirectPoolXLarge.Put(bufp)
|
||||
case fileSize <= smallFileThreshold:
|
||||
case fileSize <= xioutil.BlockSizeSmall:
|
||||
bufp = xioutil.ODirectPoolSmall.Get().(*[]byte)
|
||||
defer xioutil.ODirectPoolSmall.Put(bufp)
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user