02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

21 Jun, 2017

1 commit

  • Currently, percpu_counter_add is a wrapper around __percpu_counter_add
    which is preempt safe due to explicit calls to preempt_disable. Given
    how __ prefix is used in percpu related interfaces, the naming
    unfortunately creates the false sense that __percpu_counter_add is
    less safe than percpu_counter_add. In terms of context-safety,
    they're equivalent. The only difference is that the __ version takes
    a batch parameter.

    Make this a bit more explicit by just renaming __percpu_counter_add to
    percpu_counter_add_batch.

    This patch doesn't cause any functional changes.

    tj: Minor updates to patch description for clarity. Cosmetic
    indentation updates.

    Signed-off-by: Nikolay Borisov
    Signed-off-by: Tejun Heo
    Cc: Chris Mason
    Cc: Josef Bacik
    Cc: David Sterba
    Cc: Darrick J. Wong
    Cc: Jan Kara
    Cc: Jens Axboe
    Cc: linux-mm@kvack.org
    Cc: "David S. Miller"

    Nikolay Borisov
     

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