Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56c10372 authored by Angelo G. Del Regno -- EternityProject Team Manager's avatar Angelo G. Del Regno -- EternityProject Team Manager Committed by Andrea
Browse files

fs: aio: Optimization for SSD-only machines

If the system is running on NAND-based storage, without
mechanical drives, we don't need to manage the plug/unplug
of the actual block because we don't have to count the
time for the head to reach that disk physical location.
Solid state storage have no head to move and no location
to "physically reach", as the block is being retrieved
in the exact moment we request it.

The do_io_submit function expects the storage device to
be ready to deliver the block (aka - next block of the
queue to process), therefore it's safe to remove useless
waits on systems using only that type of storage.

This patch adds a configuration option to enable the
SSD-only optimization for the Linux Asynchronous IO
framework.
Enabling it on systems with rotational storage (or mixed)
WILL hit storage performance A LOT.
parent 70be84de
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1600,7 +1600,9 @@ long do_io_submit(aio_context_t ctx_id, long nr,
	struct kioctx *ctx;
	long ret = 0;
	int i = 0;
#ifndef CONFIG_AIO_SSD_ONLY
	struct blk_plug plug;
#endif

	if (unlikely(nr < 0))
		return -EINVAL;
@@ -1617,7 +1619,9 @@ long do_io_submit(aio_context_t ctx_id, long nr,
		return -EINVAL;
	}

#ifndef CONFIG_AIO_SSD_ONLY
	blk_start_plug(&plug);
#endif

	/*
	 * AKPM: should this return a partial result if some of the IOs were
@@ -1641,7 +1645,9 @@ long do_io_submit(aio_context_t ctx_id, long nr,
		if (ret)
			break;
	}
#ifndef CONFIG_AIO_SSD_ONLY
	blk_finish_plug(&plug);
#endif

	percpu_ref_put(&ctx->users);
	return i ? i : ret;
+15 −0
Original line number Diff line number Diff line
@@ -1724,6 +1724,21 @@ config AIO
	  by some high performance threaded applications. Disabling
	  this option saves about 7k.

config AIO_SSD_ONLY
	bool "Tune AIO performance for SSDs" if EXPERT
	default n
	depends on AIO
	help
	  Solid state storage have no head to move and no location
	  to "physically reach", as the block is being retrieved
	  in the exact moment we request it.
	  Optimize Asynchronous IO for those conditions.

	  Enabling this option on systems with rotational drives
	  WILL be resulting in bad storage performance.

	  If you've got ONLY SSDs, say Y. If unsure, say N.

config ADVISE_SYSCALLS
	bool "Enable madvise/fadvise syscalls" if EXPERT
	default y