resource: avoid unnecessary lookups in find_next_iomem_res()

find_next_iomem_res() shows up to be a source for overhead in dax

Improve performance by not considering children of the tree if the top
level does not match.  Since the range of the parents should include the
range of the children such check is redundant.

Running sysbench on dax (pmem emulation, with write_cache disabled):

  sysbench fileio --file-total-size=3G --file-test-mode=rndwr \
   --file-io-mode=mmap --threads=4 --file-fsync-mode=fdatasync run

Provides the following results:

		events (avg/stddev)
  5.2-rc3:	1247669.0000/16075.39
  w/patch:	1286320.5000/16402.72	(+3%)

Signed-off-by: Nadav Amit <>
Cc: Borislav Petkov <>
Cc: Toshi Kani <>
Cc: Peter Zijlstra <>
Cc: Dave Hansen <>
Cc: Dan Williams <>
Cc: Bjorn Helgaas <>
Cc: Ingo Molnar <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed