1. 19 11月, 2013 7 次提交
  2. 14 11月, 2013 4 次提交
    • S
      raid5: relieve lock contention in get_active_stripe() · 566c09c5
      Shaohua Li 提交于
      get_active_stripe() is the last place we have lock contention. It has two
      paths. One is stripe isn't found and new stripe is allocated, the other is
      stripe is found.
      
      The first path basically calls __find_stripe and init_stripe. It accesses
      conf->generation, conf->previous_raid_disks, conf->raid_disks,
      conf->prev_chunk_sectors, conf->chunk_sectors, conf->max_degraded,
      conf->prev_algo, conf->algorithm, the stripe_hashtbl and inactive_list. Except
      stripe_hashtbl and inactive_list, other fields are changed very rarely.
      
      With this patch, we split inactive_list and add new hash locks. Each free
      stripe belongs to a specific inactive list. Which inactive list is determined
      by stripe's lock_hash. Note, even a stripe hasn't a sector assigned, it has a
      lock_hash assigned. Stripe's inactive list is protected by a hash lock, which
      is determined by it's lock_hash too. The lock_hash is derivied from current
      stripe_hashtbl hash, which guarantees any stripe_hashtbl list will be assigned
      to a specific lock_hash, so we can use new hash lock to protect stripe_hashtbl
      list too. The goal of the new hash locks introduced is we can only use the new
      locks in the first path of get_active_stripe(). Since we have several hash
      locks, lock contention is relieved significantly.
      
      The first path of get_active_stripe() accesses other fields, since they are
      changed rarely, changing them now need take conf->device_lock and all hash
      locks. For a slow path, this isn't a problem.
      
      If we need lock device_lock and hash lock, we always lock hash lock first. The
      tricky part is release_stripe and friends. We need take device_lock first.
      Neil's suggestion is we put inactive stripes to a temporary list and readd it
      to inactive_list after device_lock is released. In this way, we add stripes to
      temporary list with device_lock hold and remove stripes from the list with hash
      lock hold. So we don't allow concurrent access to the temporary list, which
      means we need allocate temporary list for all participants of release_stripe.
      
      One downside is free stripes are maintained in their inactive list, they can't
      across between the lists. By default, we have total 256 stripes and 8 lists, so
      each list will have 32 stripes. It's possible one list has free stripe but
      other list hasn't. The chance should be rare because stripes allocation are
      even distributed. And we can always allocate more stripes for cache, several
      mega bytes memory isn't a big deal.
      
      This completely removes the lock contention of the first path of
      get_active_stripe(). It slows down the second code path a little bit though
      because we now need takes two locks, but since the hash lock isn't contended,
      the overhead should be quite small (several atomic instructions). The second
      path of get_active_stripe() (basically sequential write or big request size
      randwrite) still has lock contentions.
      Signed-off-by: NShaohua Li <shli@fusionio.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      566c09c5
    • N
      md/raid5.c: add proper locking to error path of raid5_start_reshape. · ba8805b9
      NeilBrown 提交于
      If raid5_start_reshape errors out, we need to reset all the fields
      that were updated (not just some), and need to use the seq_counter
      to ensure make_request() doesn't use an inconsitent state.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      ba8805b9
    • N
      md: fix calculation of stacking limits on level change. · 02e5f5c0
      NeilBrown 提交于
      The various ->run routines of md personalities assume that the 'queue'
      has been initialised by the blk_set_stacking_limits() call in
      md_alloc().
      
      However when the level is changed (by level_store()) the ->run routine
      for the new level is called for an array which has already had the
      stacking limits modified.  This can result in incorrect final
      settings.
      
      So call blk_set_stacking_limits() before ->run in level_store().
      
      A specific consequence of this bug is that it causes
      discard_granularity to be set incorrectly when reshaping a RAID4 to a
      RAID0.
      
      This is suitable for any -stable kernel since 3.3 in which
      blk_set_stacking_limits() was introduced.
      
      Cc: stable@vger.kernel.org (3.3+)
      Reported-and-tested-by: N"Baldysiak, Pawel" <pawel.baldysiak@intel.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      02e5f5c0
    • M
      raid5: Use slow_path to release stripe when mddev->thread is null · ad4068de
      majianpeng 提交于
      When release_stripe() is called in grow_one_stripe(), the
      mddev->thread is null. So it will omit one wakeup this thread to
      release stripe.
      For this condition, use slow_path to release stripe.
      
      Bug was introduced in 3.12
      
      Cc: stable@vger.kernel.org (3.12+)
      Fixes: 773ca82fSigned-off-by: NJianpeng Ma <majianpeng@gmail.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      ad4068de
  3. 08 11月, 2013 1 次提交
    • H
      parisc: sticon - unbreak on 64bit kernel · 0219132f
      Helge Deller 提交于
      STI text console (sticon) was broken on 64bit machines with more than
      4GB RAM and this lead in some cases to a kernel crash.
      
      Since sticon uses the 32bit STI API it needs to keep pointers to memory
      below 4GB. But on a 64bit kernel some memory regions (e.g. the kernel
      stack) might be above 4GB which then may crash the kernel in the STI
      functions.
      
      Additionally sticon didn't selected the built-in framebuffer fonts by
      default. This is now fixed.
      
      On a side-note: Theoretically we could enhance the sticon driver to
      use the 64bit STI API. But - beside the fact that some machines don't
      provide a 64bit STI ROM - this would just add complexity.
      Signed-off-by: NHelge Deller <deller@gmx.de>
      Cc: stable@vger.kernel.org # 3.8+
      0219132f
  4. 07 11月, 2013 1 次提交
  5. 06 11月, 2013 1 次提交
  6. 04 11月, 2013 1 次提交
  7. 02 11月, 2013 13 次提交
  8. 01 11月, 2013 4 次提交
  9. 31 10月, 2013 8 次提交