1. 25 9月, 2008 5 次提交
    • C
      Btrfs: Fix streaming read performance with checksumming on · 61b49440
      Chris Mason 提交于
      Large streaming reads make for large bios, which means each entry on the
      list async work queues represents a large amount of data.  IO
      congestion throttling on the device was kicking in before the async
      worker threads decided a single thread was busy and needed some help.
      
      The end result was that a streaming read would result in a single CPU
      running at 100% instead of balancing the work off to other CPUs.
      
      This patch also changes the pre-IO checksum lookup done by reads to
      work on a per-bio basis instead of a per-page.  This results in many
      extra btree lookups on large streaming reads.  Doing the checksum lookup
      right before bio submit allows us to reuse searches while processing
      adjacent offsets.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      61b49440
    • L
      Btrfs: async-thread: fix possible memory leak · 3bf10418
      Li Zefan 提交于
      When kthread_run() returns failure, this worker hasn't been
      added to the list, so btrfs_stop_workers() won't free it.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      3bf10418
    • C
      Btrfs: Worker thread optimizations · 35d8ba66
      Chris Mason 提交于
      This changes the worker thread pool to maintain a list of idle threads,
      avoiding a complex search for a good thread to wake up.
      
      Threads have two states:
      
      idle - we try to reuse the last thread used in hopes of improving the batching
      ratios
      
      busy - each time a new work item is added to a busy task, the task is
      rotated to the end of the line.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      35d8ba66
    • C
    • C
      Btrfs: Add async worker threads for pre and post IO checksumming · 8b712842
      Chris Mason 提交于
      Btrfs has been using workqueues to spread the checksumming load across
      other CPUs in the system.  But, workqueues only schedule work on the
      same CPU that queued the work, giving them a limited benefit for systems with
      higher CPU counts.
      
      This code adds a generic facility to schedule work with pools of kthreads,
      and changes the bio submission code to queue bios up.  The queueing is
      important to make sure large numbers of procs on the system don't
      turn streaming workloads into random workloads by sending IO down
      concurrently.
      
      The end result of all of this is much higher performance (and CPU usage) when
      doing checksumming on large machines.  Two worker pools are created,
      one for writes and one for endio processing.  The two could deadlock if
      we tried to service both from a single pool.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      8b712842