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 Mar, 2016

1 commit

  • __clear_bit_unlock() is a special little snowflake. While it carries the
    non-atomic '__' prefix, it is specifically documented to pair with
    test_and_set_bit() and therefore should be 'somewhat' atomic.

    Therefore the generic implementation of __clear_bit_unlock() cannot use
    the fully non-atomic __clear_bit() as a default.

    If an arch is able to do better; is must provide an implementation of
    __clear_bit_unlock() itself.

    Specifically, this came up as a result of hackbench livelock'ing in
    slab_lock() on ARC with SMP + SLUB + !LLSC.

    The issue was incorrect pairing of atomic ops.

    slab_lock() -> bit_spin_lock() -> test_and_set_bit()
    slab_unlock() -> __bit_spin_unlock() -> __clear_bit()

    The non serializing __clear_bit() was getting "lost"

    80543b8e: ld_s r2,[r13,0]
    Tested-by: Vineet Gupta
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Christoph Lameter
    Cc: David Rientjes
    Cc: Helge Deller
    Cc: James E.J. Bottomley
    Cc: Joonsoo Kim
    Cc: Linus Torvalds
    Cc: Noam Camus
    Cc: Paul E. McKenney
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160309114054.GJ6356@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

15 Oct, 2015

1 commit


18 Apr, 2014

1 commit

  • Mostly scripted conversion of the smp_mb__* barriers.

    Signed-off-by: Peter Zijlstra
    Acked-by: Paul E. McKenney
    Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
    Cc: Linus Torvalds
    Cc: linux-arch@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

09 Feb, 2014

1 commit

  • Enabling '-Wsign-compare' compiler warnings on code that includes
    include/linux/bitops.h can generate the following warning:

    In file included from include/linux/kernel.h:10:0,
    from :48:
    include/linux/bitops.h: In function 'hweight_long':
    include/linux/bitops.h:77:26: error: signed and unsigned type in conditional expression [-Werror=sign-compare]

    (converted to an error with -Werror)

    This is due to the use of the logical negation operator '!' in the
    __const_hweight8 macro in include/asm-generic/bitops/const_hweight.h.
    The use of that operator here results in a signed value.

    Fix by explicitly casting the __const_hweight8 macro expansion to
    'unsigned int'. While here, clean up several checkpatch.pl warnings.

    Signed-off-by: Paul Walmsley
    Cc: Arnd Bergmann
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1312180459580.30198@tamien
    Signed-off-by: Ingo Molnar

    Paul Walmsley
     

13 Nov, 2013

1 commit


15 Oct, 2012

1 commit

  • Pull module signing support from Rusty Russell:
    "module signing is the highlight, but it's an all-over David Howells frenzy..."

    Hmm "Magrathea: Glacier signing key". Somebody has been reading too much HHGTTG.

    * 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (37 commits)
    X.509: Fix indefinite length element skip error handling
    X.509: Convert some printk calls to pr_devel
    asymmetric keys: fix printk format warning
    MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
    MODSIGN: Make mrproper should remove generated files.
    MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
    MODSIGN: Use the same digest for the autogen key sig as for the module sig
    MODSIGN: Sign modules during the build process
    MODSIGN: Provide a script for generating a key ID from an X.509 cert
    MODSIGN: Implement module signature checking
    MODSIGN: Provide module signing public keys to the kernel
    MODSIGN: Automatically generate module signing keys if missing
    MODSIGN: Provide Kconfig options
    MODSIGN: Provide gitignore and make clean rules for extra files
    MODSIGN: Add FIPS policy
    module: signature checking hook
    X.509: Add a crypto key parser for binary (DER) X.509 certificates
    MPILIB: Provide a function to read raw data into an MPI
    X.509: Add an ASN.1 decoder
    X.509: Add simple ASN.1 grammar compiler
    ...

    Linus Torvalds
     

08 Oct, 2012

1 commit

  • Provide count_leading/trailing_zeros() macros based on extant arch bit scanning
    functions rather than reimplementing from scratch in MPILIB.

    Whilst we're at it, turn count_foo_zeros(n, x) into n = count_foo_zeros(x).

    Also move the definition to asm-generic as other people may be interested in
    using it.

    Signed-off-by: David Howells
    Cc: David S. Miller
    Cc: Dmitry Kasatkin
    Cc: Arnd Bergmann
    Signed-off-by: Rusty Russell

    David Howells
     

06 Oct, 2012

1 commit


15 Sep, 2012

1 commit


29 Mar, 2012

1 commit

  • asm/system.h is a cause of circular dependency problems because it contains
    commonly used primitive stuff like barrier definitions and uncommonly used
    stuff like switch_to() that might require MMU definitions.

    asm/system.h has been disintegrated by this point on all arches into the
    following common segments:

    (1) asm/barrier.h

    Moved memory barrier definitions here.

    (2) asm/cmpxchg.h

    Moved xchg() and cmpxchg() here. #included in asm/atomic.h.

    (3) asm/bug.h

    Moved die() and similar here.

    (4) asm/exec.h

    Moved arch_align_stack() here.

    (5) asm/elf.h

    Moved AT_VECTOR_SIZE_ARCH here.

    (6) asm/switch_to.h

    Moved switch_to() here.

    Signed-off-by: David Howells

    David Howells
     

27 Jul, 2011

1 commit

  • The majority of architectures implement ext2 atomic bitops as
    test_and_{set,clear}_bit() without spinlock.

    This adds this type of generic implementation in ext2-atomic-setbit.h and
    use it wherever possible.

    Signed-off-by: Akinobu Mita
    Suggested-by: Andreas Dilger
    Suggested-by: Arnd Bergmann
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

27 May, 2011

1 commit

  • The style that we normally use in asm-generic is to test the macro itself
    for existence, so in asm-generic, do:

    #ifndef find_next_zero_bit_le
    extern unsigned long find_next_zero_bit_le(const void *addr,
    unsigned long size, unsigned long offset);
    #endif

    and in the architectures, write

    static inline unsigned long find_next_zero_bit_le(const void *addr,
    unsigned long size, unsigned long offset)
    #define find_next_zero_bit_le find_next_zero_bit_le

    This adds the #ifndef for each of the find bitops in the generic header
    and source files.

    Suggested-by: Arnd Bergmann
    Signed-off-by: Akinobu Mita
    Acked-by: Russell King
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Greg Ungerer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

24 Mar, 2011

7 commits

  • minix bit operations are only used by minix filesystem and useless by
    other modules. Because byte order of inode and block bitmaps is different
    on each architecture like below:

    m68k:
    big-endian 16bit indexed bitmaps

    h8300, microblaze, s390, sparc, m68knommu:
    big-endian 32 or 64bit indexed bitmaps

    m32r, mips, sh, xtensa:
    big-endian 32 or 64bit indexed bitmaps for big-endian mode
    little-endian bitmaps for little-endian mode

    Others:
    little-endian bitmaps

    In order to move minix bit operations from asm/bitops.h to architecture
    independent code in minix filesystem, this provides two config options.

    CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED is only selected by m68k.
    CONFIG_MINIX_FS_NATIVE_ENDIAN is selected by the architectures which use
    native byte order bitmaps (h8300, microblaze, s390, sparc, m68knommu,
    m32r, mips, sh, xtensa). The architectures which always use little-endian
    bitmaps do not select these options.

    Finally, we can remove minix bit operations from asm/bitops.h for all
    architectures.

    Signed-off-by: Akinobu Mita
    Acked-by: Arnd Bergmann
    Acked-by: Greg Ungerer
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Cc: Andreas Schwab
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Yoshinori Sato
    Cc: Michal Simek
    Cc: "David S. Miller"
    Cc: Hirokazu Takata
    Acked-by: Ralf Baechle
    Acked-by: Paul Mundt
    Cc: Chris Zankel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • As the result of conversions, there are no users of ext2 non-atomic bit
    operations except for ext2 filesystem itself. Now we can put them into
    architecture independent code in ext2 filesystem, and remove from
    asm/bitops.h for all architectures.

    Signed-off-by: Akinobu Mita
    Cc: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • As a preparation for removing ext2 non-atomic bit operations from
    asm/bitops.h. This converts ext2 non-atomic bit operations to
    little-endian bit operations.

    Signed-off-by: Akinobu Mita
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Introduce little-endian bit operations to the big-endian architectures
    which do not have native little-endian bit operations and the
    little-endian architectures. (alpha, avr32, blackfin, cris, frv, h8300,
    ia64, m32r, mips, mn10300, parisc, sh, sparc, tile, x86, xtensa)

    These architectures can just include generic implementation
    (asm-generic/bitops/le.h).

    Signed-off-by: Akinobu Mita
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Mikael Starvik
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: "Luck, Tony"
    Cc: Ralf Baechle
    Cc: Kyle McMartin
    Cc: Matthew Wilcox
    Cc: Grant Grundler
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Hirokazu Takata
    Cc: "David S. Miller"
    Cc: Chris Zankel
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Acked-by: Hans-Christian Egtvedt
    Acked-by: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This makes the little-endian bitops take any pointer types by changing the
    prototypes and adding casts in the preprocessor macros.

    That would seem to at least make all the filesystem code happier, and they
    can continue to do just something like

    #define ext2_set_bit __test_and_set_bit_le

    (or whatever the exact sequence ends up being).

    Signed-off-by: Akinobu Mita
    Cc: Arnd Bergmann
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Mikael Starvik
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: "Luck, Tony"
    Cc: Ralf Baechle
    Cc: Kyle McMartin
    Cc: Matthew Wilcox
    Cc: Grant Grundler
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Hirokazu Takata
    Cc: "David S. Miller"
    Cc: Chris Zankel
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Hans-Christian Egtvedt
    Cc: "H. Peter Anvin"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • As a preparation for providing little-endian bitops for all architectures,
    This renames generic implementation of little-endian bitops. (remove
    "generic_" prefix and postfix "_le")

    s/generic_find_next_le_bit/find_next_bit_le/
    s/generic_find_next_zero_le_bit/find_next_zero_bit_le/
    s/generic_find_first_zero_le_bit/find_first_zero_bit_le/
    s/generic___test_and_set_le_bit/__test_and_set_bit_le/
    s/generic___test_and_clear_le_bit/__test_and_clear_bit_le/
    s/generic_test_le_bit/test_bit_le/
    s/generic___set_le_bit/__set_bit_le/
    s/generic___clear_le_bit/__clear_bit_le/
    s/generic_test_and_set_le_bit/test_and_set_bit_le/
    s/generic_test_and_clear_le_bit/test_and_clear_bit_le/

    Signed-off-by: Akinobu Mita
    Acked-by: Arnd Bergmann
    Acked-by: Hans-Christian Egtvedt
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Cc: Andreas Schwab
    Cc: Greg Ungerer
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch series introduces little-endian bit operations in asm/bitops.h
    for all architectures and converts all ext2 non-atomic and minix bit
    operations to use little-endian bit operations. It enables us to remove
    ext2 non-atomic and minix bit operations from asm/bitops.h. The reason
    they should be removed from asm/bitops.h is as follows:

    For ext2 non-atomic bit operations, they are used for little-endian byte
    order bitmap access by some filesystems and modules. But using ext2_*()
    functions on a module other than ext2 filesystem makes some feel strange.

    For minix bit operations, they are only used by minix filesystem and are
    useless by other modules. Because byte order of inode and block bitmap is

    This patch:

    In order to make the forthcoming changes smaller, this merges macro
    definisions in asm-generic/bitops/le.h for big-endian and little-endian as
    much as possible.

    This also removes unused BITOP_WORD macro.

    Signed-off-by: Akinobu Mita
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

10 Oct, 2010

2 commits

  • If CONFIG_GENERIC_FIND_NEXT_BIT is enabled, find_next_bit() and
    find_next_zero_bit() are doubly declared in asm-generic/bitops/find.h
    and linux/bitops.h.

    asm/bitops.h includes asm-generic/bitops/find.h if and only if the
    architecture enables CONFIG_GENERIC_FIND_NEXT_BIT. And asm/bitops.h
    is included by linux/bitops.h

    So we can just remove the extern declarations of find_next_bit() and
    find_next_zero_bit() in linux/bitops.h.

    Also we can remove unneeded #ifndef CONFIG_GENERIC_FIND_NEXT_BIT in
    asm-generic/bitops/find.h.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Arnd Bergmann

    Akinobu Mita
     
  • asm-generic/bitops/find.h has the extern declarations of find_next_bit()
    and find_next_zero_bit() and the macro definitions of find_first_bit()
    and find_first_zero_bit(). It is only usable by the architectures which
    enables CONFIG_GENERIC_FIND_NEXT_BIT and disables
    CONFIG_GENERIC_FIND_FIRST_BIT.

    x86 and tile enable both CONFIG_GENERIC_FIND_NEXT_BIT and
    CONFIG_GENERIC_FIND_FIRST_BIT. These architectures cannot include
    asm-generic/bitops/find.h in their asm/bitops.h. So ifdefed extern
    declarations of find_first_bit and find_first_zero_bit() are put in
    linux/bitops.h.

    This makes asm-generic/bitops/find.h usable by these architectures
    and use it. Also this change is needed for the forthcoming duplicated
    extern declarations cleanup.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Arnd Bergmann
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: x86@kernel.org
    Cc: Chris Metcalf

    Akinobu Mita
     

05 May, 2010

1 commit

  • Fix function prototype visibility issues when compiling for non-x86
    architectures. Tested with crosstool
    (ftp://ftp.kernel.org/pub/tools/crosstool/) with alpha, ia64 and sparc
    targets.

    Signed-off-by: Borislav Petkov
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Borislav Petkov
     

07 Apr, 2010

2 commits

  • Add support for the hardware version of the Hamming weight function,
    popcnt, present in CPUs which advertize it under CPUID, Function
    0x0000_0001_ECX[23]. On CPUs which don't support it, we fallback to the
    default lib/hweight.c sw versions.

    A synthetic benchmark comparing popcnt with __sw_hweight64 showed almost
    a 3x speedup on a F10h machine.

    Signed-off-by: Borislav Petkov
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Borislav Petkov
     
  • Rename the extisting runtime hweight() implementations to
    __arch_hweight(), rename the compile-time versions to __const_hweight()
    and then have hweight() pick between them.

    Suggested-by: H. Peter Anvin
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Acked-by: H. Peter Anvin
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Peter Zijlstra
     

15 Dec, 2009

2 commits

  • Name space cleanup. No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • The raw_spin* namespace was taken by lockdep for the architecture
    specific implementations. raw_spin_* would be the ideal name space for
    the spinlocks which are not converted to sleeping locks in preempt-rt.

    Linus suggested to convert the raw_ to arch_ locks and cleanup the
    name space instead of using an artifical name like core_spin,
    atomic_spin or whatever

    No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     

12 Jun, 2009

1 commit

  • The existing asm-generic/atomic.h only defines the
    atomic_long type. This renames it to atomic-long.h
    so we have a place to add a truly generic atomic.h
    that can be used on all non-SMP systems.

    Signed-off-by: Remis Lima Baima
    Signed-off-by: Arnd Bergmann
    Acked-by: Ingo Molnar

    Arnd Bergmann
     

14 Jan, 2009

1 commit

  • Impact: reduce kernel image size

    Hugh Dickins noticed that older gcc versions when the kernel
    is built for code size didn't inline some of the bitops.

    Mark all complex x86 bitops that have more than a single
    asm statement or two as always inline to avoid this problem.

    Probably should be done for other architectures too.

    Ingo then found a better fix that only requires
    a single line change, but it unfortunately only
    works on gcc 4.3.

    On older gccs the original patch still makes a ~0.3% defconfig
    difference with CONFIG_OPTIMIZE_INLINING=y.

    With gcc 4.1 and a defconfig like build:

    6116998 1138540 883788 8139326 7c323e vmlinux-oi-with-patch
    6137043 1138540 883788 8159371 7c808b vmlinux-optimize-inlining

    ~20k / 0.3% difference.

    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Andi Kleen
     

27 Apr, 2008

3 commits

  • Use __fls for fls64 on 64-bit archs. The implementation for
    64-bit archs is moved from x86_64 to asm-generic.

    Signed-off-by: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     
  • Add a generic __fls implementation in the same spirit as
    the generic __ffs one. It finds the last (most significant)
    set bit in the given long value.

    Signed-off-by: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     
  • This moves an optimization for searching constant-sized small
    bitmaps form x86_64-specific to generic code.

    On an i386 defconfig (the x86#testing one), the size of vmlinux hardly
    changes with this applied. I have observed only four places where this
    optimization avoids a call into find_next_bit:

    In the functions return_unused_surplus_pages, alloc_fresh_huge_page,
    and adjust_pool_surplus, this patch avoids a call for a 1-bit bitmap.
    In __next_cpu a call is avoided for a 32-bit bitmap. That's it.

    On x86_64, 52 locations are optimized with a minimal increase in
    code size:

    Current #testing defconfig:
    146 x bsf, 27 x find_next_*bit
    text data bss dec hex filename
    5392637 846592 724424 6963653 6a41c5 vmlinux

    After removing the x86_64 specific optimization for find_next_*bit:
    94 x bsf, 79 x find_next_*bit
    text data bss dec hex filename
    5392358 846592 724424 6963374 6a40ae vmlinux

    After this patch (making the optimization generic):
    146 x bsf, 27 x find_next_*bit
    text data bss dec hex filename
    5392396 846592 724424 6963412 6a40d4 vmlinux

    [ tglx@linutronix.de: build fixes ]

    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     

29 Jan, 2008

1 commit


20 Oct, 2007

1 commit

  • define first set of BIT* macros

    - move BITOP_MASK and BITOP_WORD from asm-generic/bitops/atomic.h to
    include/linux/bitops.h and rename it to BIT_MASK and BIT_WORD
    - move BITS_TO_LONGS and BITS_PER_BYTE to bitops.h too and allow easily
    define another BITS_TO_something (e.g. in event.c) by BITS_TO_TYPE macro
    Remaining (and common) BIT macro will be defined after all occurences and
    conflicts will be sorted out in the patches.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

19 Oct, 2007

1 commit

  • Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics.
    Convert all architectures to use the generic implementation.

    Signed-off-by: Nick Piggin
    Acked-By: David Howells
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Russell King
    Cc: Haavard Skinnemoen
    Cc: Bryan Wu
    Cc: Mikael Starvik
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: "Luck, Tony"
    Cc: Hirokazu Takata
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Cc: Greg Ungerer
    Cc: Ralf Baechle
    Cc: Kyle McMartin
    Cc: Matthew Wilcox
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Richard Curnow
    Cc: William Lee Irwin III
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Miles Bader
    Cc: Andi Kleen
    Cc: Chris Zankel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

10 Jul, 2007

1 commit


09 May, 2007

1 commit


12 Oct, 2006

1 commit

  • This likely profiling is pretty fun. I found a few possible problems
    in sched.c.

    This patch may be not measurable, but when I did measure long ago,
    nooping (un)likely cost a couple of % on scheduler heavy benchmarks, so
    it all adds up.

    Tweak some branch hints:

    - the 2nd 64 bits in the bitmask is likely to be populated, because it
    contains the first 28 bits (nearly 3/4) of the normal priorities.
    (ratio of 669669:691 ~= 1000:1).

    - it isn't unlikely that context switching switches to another process. it
    might be very rapidly switching to and from the idle process (ratio of
    475815:419004 and 471330:423544). Let the branch predictor decide.

    - preempt_enable seems to be very often called in a nested preempt_disable
    or with interrupts disabled (ratio of 3567760:87965 ~= 40:1)

    Signed-off-by: Nick Piggin
    Acked-by: Ingo Molnar
    Cc: Daniel Walker
    Cc: Hua Zhong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

27 Mar, 2006

2 commits

  • This patch introduces the C-language equivalents of the functions below:

    int minix_test_and_set_bit(int nr, volatile unsigned long *addr);
    int minix_set_bit(int nr, volatile unsigned long *addr);
    int minix_test_and_clear_bit(int nr, volatile unsigned long *addr);
    int minix_test_bit(int nr, const volatile unsigned long *addr);
    unsigned long minix_find_first_zero_bit(const unsigned long *addr,
    unsigned long size);

    In include/asm-generic/bitops/minix.h
    and include/asm-generic/bitops/minix-le.h

    This code largely copied from: include/asm-sparc/bitops.h

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This patch introduces the C-language equivalents of the functions below:

    int ext2_set_bit_atomic(int nr, volatile unsigned long *addr);
    int ext2_clear_bit_atomic(int nr, volatile unsigned long *addr);

    In include/asm-generic/bitops/ext2-atomic.h

    This code largely copied from: include/asm-sparc/bitops.h

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita