03 Aug, 2016

1 commit

  • There was only one use of __initdata_refok and __exit_refok

    __init_refok was used 46 times against 82 for __ref.

    Those definitions are obsolete since commit 312b1485fb50 ("Introduce new
    section reference annotations tags: __ref, __refdata, __refconst")

    This patch removes the following compatibility definitions and replaces
    them treewide.

    /* compatibility defines */
    #define __init_refok __ref
    #define __initdata_refok __refdata
    #define __exit_refok __ref

    I can also provide separate patches if necessary.
    (One patch per tree and check in 1 month or 2 to remove old definitions)

    [akpm@linux-foundation.org: coding-style fixes]
    Link: http://lkml.kernel.org/r/1466796271-3043-1-git-send-email-fabf@skynet.be
    Signed-off-by: Fabian Frederick
    Cc: Ingo Molnar
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     

04 Jul, 2013

4 commits

  • Prepare for removing num_physpages and simplify mem_init().

    Signed-off-by: Jiang Liu
    Cc: Mike Frysinger
    Cc: Bob Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiang Liu
     
  • Concentrate code to modify totalram_pages into the mm core, so the arch
    memory initialized code doesn't need to take care of it. With these
    changes applied, only following functions from mm core modify global
    variable totalram_pages: free_bootmem_late(), free_all_bootmem(),
    free_all_bootmem_node(), adjust_managed_page_count().

    With this patch applied, it will be much more easier for us to keep
    totalram_pages and zone->managed_pages in consistence.

    Signed-off-by: Jiang Liu
    Acked-by: David Howells
    Cc: "H. Peter Anvin"
    Cc: "Michael S. Tsirkin"
    Cc:
    Cc: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Chris Metcalf
    Cc: Geert Uytterhoeven
    Cc: Ingo Molnar
    Cc: Jeremy Fitzhardinge
    Cc: Jianguo Wu
    Cc: Joonsoo Kim
    Cc: Kamezawa Hiroyuki
    Cc: Konrad Rzeszutek Wilk
    Cc: Marek Szyprowski
    Cc: Mel Gorman
    Cc: Michel Lespinasse
    Cc: Minchan Kim
    Cc: Rik van Riel
    Cc: Rusty Russell
    Cc: Tang Chen
    Cc: Tejun Heo
    Cc: Thomas Gleixner
    Cc: Wen Congyang
    Cc: Will Deacon
    Cc: Yasuaki Ishimatsu
    Cc: Yinghai Lu
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiang Liu
     
  • Address more review comments from last round of code review.
    1) Enhance free_reserved_area() to support poisoning freed memory with
    pattern '0'. This could be used to get rid of poison_init_mem()
    on ARM64.
    2) A previous patch has disabled memory poison for initmem on s390
    by mistake, so restore to the original behavior.
    3) Remove redundant PAGE_ALIGN() when calling free_reserved_area().

    Signed-off-by: Jiang Liu
    Cc: Geert Uytterhoeven
    Cc: "H. Peter Anvin"
    Cc: "Michael S. Tsirkin"
    Cc:
    Cc: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Chris Metcalf
    Cc: David Howells
    Cc: Ingo Molnar
    Cc: Jeremy Fitzhardinge
    Cc: Jianguo Wu
    Cc: Joonsoo Kim
    Cc: Kamezawa Hiroyuki
    Cc: Konrad Rzeszutek Wilk
    Cc: Marek Szyprowski
    Cc: Mel Gorman
    Cc: Michel Lespinasse
    Cc: Minchan Kim
    Cc: Rik van Riel
    Cc: Rusty Russell
    Cc: Tang Chen
    Cc: Tejun Heo
    Cc: Thomas Gleixner
    Cc: Wen Congyang
    Cc: Will Deacon
    Cc: Yasuaki Ishimatsu
    Cc: Yinghai Lu
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiang Liu
     
  • Change signature of free_reserved_area() according to Russell King's
    suggestion to fix following build warnings:

    arch/arm/mm/init.c: In function 'mem_init':
    arch/arm/mm/init.c:603:2: warning: passing argument 1 of 'free_reserved_area' makes integer from pointer without a cast [enabled by default]
    free_reserved_area(__va(PHYS_PFN_OFFSET), swapper_pg_dir, 0, NULL);
    ^
    In file included from include/linux/mman.h:4:0,
    from arch/arm/mm/init.c:15:
    include/linux/mm.h:1301:22: note: expected 'long unsigned int' but argument is of type 'void *'
    extern unsigned long free_reserved_area(unsigned long start, unsigned long end,

    mm/page_alloc.c: In function 'free_reserved_area':
    >> mm/page_alloc.c:5134:3: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast [enabled by default]
    In file included from arch/mips/include/asm/page.h:49:0,
    from include/linux/mmzone.h:20,
    from include/linux/gfp.h:4,
    from include/linux/mm.h:8,
    from mm/page_alloc.c:18:
    arch/mips/include/asm/io.h:119:29: note: expected 'const volatile void *' but argument is of type 'long unsigned int'
    mm/page_alloc.c: In function 'free_area_init_nodes':
    mm/page_alloc.c:5030:34: warning: array subscript is below array bounds [-Warray-bounds]

    Also address some minor code review comments.

    Signed-off-by: Jiang Liu
    Reported-by: Arnd Bergmann
    Cc: "H. Peter Anvin"
    Cc: "Michael S. Tsirkin"
    Cc:
    Cc: Catalin Marinas
    Cc: Chris Metcalf
    Cc: David Howells
    Cc: Geert Uytterhoeven
    Cc: Ingo Molnar
    Cc: Jeremy Fitzhardinge
    Cc: Jianguo Wu
    Cc: Joonsoo Kim
    Cc: Kamezawa Hiroyuki
    Cc: Konrad Rzeszutek Wilk
    Cc: Marek Szyprowski
    Cc: Mel Gorman
    Cc: Michel Lespinasse
    Cc: Minchan Kim
    Cc: Rik van Riel
    Cc: Rusty Russell
    Cc: Tang Chen
    Cc: Tejun Heo
    Cc: Thomas Gleixner
    Cc: Wen Congyang
    Cc: Will Deacon
    Cc: Yasuaki Ishimatsu
    Cc: Yinghai Lu
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiang Liu
     

30 Apr, 2013

1 commit


19 Nov, 2012

1 commit


21 May, 2012

2 commits


01 Nov, 2011

1 commit


27 May, 2011

1 commit


26 May, 2011

1 commit

  • The functions probe_kernel_write() and probe_kernel_read() do not modify
    the src pointer. Allow const pointers to be passed in without the need
    of a typecast.

    Acked-by: Mike Frysinger
    Acked-by: Heiko Carstens
    Acked-by: Martin Schwidefsky
    Signed-off-by: Steven Rostedt
    Link: http://lkml.kernel.org/r/1305824936.1465.4.camel@gandalf.stny.rr.com

    Steven Rostedt
     

25 May, 2011

1 commit


10 Jan, 2011

1 commit


22 Oct, 2010

1 commit

  • If the kernel's init section is merged back into the main memory region
    during boot (which it should since that is how we've laid out the kernel
    linker map), we want to make sure that these aren't counted as independent
    regions. Otherwise, if a large mapping is attempted which starts in the
    init region and extends into the main memory region, the access_ok func
    will deny it. This leads to weird messages during runtime like "unable
    to map xxx library" from the ldso but upon running the application again,
    everything works fine.

    So if the address of the end of the init region is the same as the start
    of the main memory region, simply enlarge the memory region to include
    the init region.

    Signed-off-by: Sonic Zhang
    Signed-off-by: Mike Frysinger

    Sonic Zhang
     

23 May, 2010

2 commits


21 May, 2010

2 commits


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

09 Mar, 2010

2 commits


08 Jan, 2010

1 commit

  • Blackfin needs it own arch specific probe_kernel_read() and
    probe_kernel_write().

    This was moved out of the kgdb code and into the
    arch/blackfin/maccess.c, because it is a generic kernel api.

    The arch specific kgdb.c for blackfin was cleaned of all functions
    which exist in the kgdb core that do the same thing after resolving
    the probe_kernel_read() and probe_kernel_write(). This also
    eliminated the need for most of the #include's.

    CC: Sonic Zhang
    Signed-off-by: Jason Wessel
    Signed-off-by: Mike Frysinger

    Jason Wessel
     

07 Oct, 2009

1 commit

  • Bill Gatliff & David Brownell pointed out we were missing some
    copyrights, and licensing terms in some of the files in
    ./arch/blackfin, so this fixes things, and cleans them up.

    It also removes:
    - verbose GPL text(refer to the top level ./COPYING file)
    - file names (you are looking at the file)
    - bug url (it's in the ./MAINTAINERS file)
    - "or later" on GPL-2, when we did not have that right

    It also allows some Blackfin-specific assembly files to be under a BSD
    like license (for people to use them outside of Linux).

    Signed-off-by: Robin Getz
    Signed-off-by: Mike Frysinger

    Robin Getz
     

17 Sep, 2009

4 commits

  • The DTEST write bit is 2, not 1. Improve comments in the related macro
    while we're here.

    Signed-off-by: Robin Getz
    Signed-off-by: Mike Frysinger

    Robin Getz
     
  • Make it easy to figure out if code changes here are correct.

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     
  • Allow hardware errors to be caught during early portions of booting, and
    leave something in the shadow console that people can use to debug their
    system with (to be printed out by the bootloader on next reset).

    This enables the hardare error interrupts in head.S, allowing us to find
    hardware errors when they happen (well, as much as you can with a hardware
    error) and prints out the trace if it is enabled. This will catch errors
    (like booting the wrong image on a 533) which previously resulted in a
    infinite loop/hang, as well as random hardware errors before before
    setup_arch().

    To disable this debug only feature - turn off EARLY_PRINTK.

    Signed-off-by: Robin Getz
    Signed-off-by: Mike Frysinger

    Robin Getz
     
  • Rather than defining the locks and initializing them all the time, only do
    so when we actually need them (i.e. the SRAM regions exist). This avoids
    dead data and code bloat during runtime.

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     

04 Jul, 2009

1 commit

  • Pull linus#master to merge PER_CPU_DEF_ATTRIBUTES and alpha build fix
    changes. As alpha in percpu tree uses 'weak' attribute instead of
    inline assembly, there's no need for __used attribute.

    Conflicts:
    arch/alpha/include/asm/percpu.h
    arch/mn10300/kernel/vmlinux.lds.S
    include/linux/percpu-defs.h

    Tejun Heo
     

24 Jun, 2009

1 commit

  • There are a few places where ___cacheline_aligned* is used with
    DEFINE_PER_CPU(). Use DEFINE_PER_CPU_SHARED_ALIGNED() instead.

    DEFINE_PER_CPU_SHARED_ALIGNED() applies alignment only on SMPs. While
    all other converted places used _in_smp variant or only get compiled
    for SMP, net/rds used unconditional ____cacheline_aligned. I don't
    see any reason these data structures should be aligned on UP and thus
    converted together.

    Signed-off-by: Tejun Heo
    Cc: Mike Frysinger
    Cc: Tony Luck
    Cc: Andy Grover

    Tejun Heo
     

23 Jun, 2009

1 commit

  • The current cache options don't really represent the hardware features.
    They end up setting different aspects of the hardware so that the end
    result is to turn on/off the cache. Unfortunately, when we hit cache
    problems with the hardware, it's difficult to test different settings to
    root cause the problem. The current settings also don't cleanly allow for
    different caching behaviors with different regions of memory.

    So split the configure options such that they properly reflect the settings
    that are applied to the hardware.

    Signed-off-by: Jie Zhang
    Signed-off-by: Mike Frysinger

    Jie Zhang
     

12 Jun, 2009

6 commits


31 Mar, 2009

1 commit

  • Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
    as correctly noted at bug #12454. Someone can lookup entry with NULL
    ->owner, thus not pinning enything, and release it later resulting
    in module refcount underflow.

    We can keep ->owner and supply it at registration time like ->proc_fops
    and ->data.

    But this leaves ->owner as easy-manipulative field (just one C assignment)
    and somebody will forget to unpin previous/pin current module when
    switching ->owner. ->proc_fops is declared as "const" which should give
    some thoughts.

    ->read_proc/->write_proc were just fixed to not require ->owner for
    protection.

    rmmod'ed directories will be empty and return "." and ".." -- no harm.
    And directories with tricky enough readdir and lookup shouldn't be modular.
    We definitely don't want such modular code.

    Removing ->owner will also make PDE smaller.

    So, let's nuke it.

    Kudos to Jeff Layton for reminding about this, let's say, oversight.

    http://bugzilla.kernel.org/show_bug.cgi?id=12454

    Signed-off-by: Alexey Dobriyan

    Alexey Dobriyan
     

05 Mar, 2009

1 commit


07 Jan, 2009

1 commit

  • This is a mixture ofcMichael McTernan's patch and the existing cplb-mpu code.

    We ditch the old cplb-nompu implementation, which is a good example of
    why a good algorithm in a HLL is preferrable to a bad algorithm written in
    assembly. Rather than try to construct a table of all posible CPLBs and
    search it, we just create a (smaller) table of memory regions and
    their attributes. Some of the data structures are now unified for both
    the mpu and nompu cases. A lot of needless complexity in cplbinit.c is
    removed.

    Further optimizations:
    * compile cplbmgr.c with a lot of -ffixed-reg options, and omit saving
    these registers on the stack when entering a CPLB exception.
    * lose cli/nop/nop/sti sequences for some workarounds - these don't
    * make
    sense in an exception context

    Additional code unification should be possible after this.

    [Mike Frysinger :
    - convert CPP if statements to C if statements
    - remove redundant statements
    - use a do...while loop rather than a for loop to get slightly better
    optimization and to avoid gcc "may be used uninitialized" warnings ...
    we know that the [id]cplb_nr_bounds variables will never be 0, so this
    is OK
    - the no-mpu code was the last user of MAX_MEM_SIZE and with that rewritten,
    we can punt it
    - add some BUG_ON() checks to make sure we dont overflow the small
    cplb_bounds array
    - add i/d cplb entries for the bootrom because there is functions/data in
    there we want to access
    - we do not need a NULL trailing entry as any time we access the bounds
    arrays, we use the nr_bounds variable
    ]

    Signed-off-by: Michael McTernan
    Signed-off-by: Mike Frysinger
    Signed-off-by: Bernd Schmidt
    Signed-off-by: Bryan Wu

    Bernd Schmidt