15 Feb, 2016

1 commit


08 Sep, 2014

2 commits

  • Percpu allocator now supports allocation mask. Add @gfp to
    [flex_]proportions init functions so that !GFP_KERNEL allocation masks
    can be used with them too.

    This patch doesn't make any functional difference.

    Signed-off-by: Tejun Heo
    Reviewed-by: Jan Kara
    Cc: Peter Zijlstra

    Tejun Heo
     
  • Percpu allocator now supports allocation mask. Add @gfp to
    percpu_counter_init() so that !GFP_KERNEL allocation masks can be used
    with percpu_counters too.

    We could have left percpu_counter_init() alone and added
    percpu_counter_init_gfp(); however, the number of users isn't that
    high and introducing _gfp variants to all percpu data structures would
    be quite ugly, so let's just do the conversion. This is the one with
    the most users. Other percpu data structures are a lot easier to
    convert.

    This patch doesn't make any functional difference.

    Signed-off-by: Tejun Heo
    Acked-by: Jan Kara
    Acked-by: "David S. Miller"
    Cc: x86@kernel.org
    Cc: Jens Axboe
    Cc: "Theodore Ts'o"
    Cc: Alexander Viro
    Cc: Andrew Morton

    Tejun Heo
     

25 Sep, 2012

1 commit

  • When racing with CPU hotplug, percpu_counter_sum() can return negative
    values for the number of observed events.

    This confuses fprop_new_period(), which uses unsigned type and as a
    result number of events is set to big *positive* number. From that
    moment on, things go pear shaped and can result e.g. in division by
    zero as denominator is later truncated to 32-bits.

    This bug causes a divide-by-zero oops in bdi_dirty_limit() in Borislav's
    3.6.0-rc6 based kernel.

    Fix the issue by using a signed type in fprop_new_period(). That makes
    us bail out from the function without doing anything (mistakenly)
    thinking there are no events to age. That makes aging somewhat
    inaccurate but getting accurate data would be rather hard.

    Signed-off-by: Jan Kara
    Reported-by: Borislav Petkov
    Reported-by: Srivatsa S. Bhat
    Cc: Wu Fengguang
    Cc: Peter Zijlstra
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     

09 Jun, 2012

2 commits

  • When percpu counter function in fprop_new_period() is interrupted by an
    interrupt while holding counter lock, it can cause deadlock when the
    interrupt wants to take the lock as well. Fix the problem by disabling
    interrupts when calling percpu counter functions.

    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara
     
  • Implement code computing proportions of events of different type (like code in
    lib/proportions.c) but allowing periods to have different lengths. This allows
    us to have aging periods of fixed wallclock time which gives better proportion
    estimates given the hugely varying throughput of different devices - previous
    measuring of aging period by number of events has the problem that a reasonable
    period length for a system with low-end USB stick is not a reasonable period
    length for a system with high-end storage array resulting either in too slow
    proportion updates or too fluctuating proportion updates.

    Acked-by: Peter Zijlstra
    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara