01 Dec, 2013

2 commits


20 Nov, 2013

2 commits

  • Pull UML changes from Richard Weinberger:
    "This pile contains a nice defconfig cleanup, a rewritten stack
    unwinder and various cleanups"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
    um: Remove unused declarations from
    um: remove used STDIO_CONSOLE Kconfig param
    um/vdso: add .gitignore for a couple of targets
    arch/um: make it work with defconfig and x86_64
    um: Make kstack_depth_to_print conform to arch/x86
    um: Get rid of thread_struct->saved_task
    um: Make stack trace reliable against kernel mode faults
    um: Rewrite show_stack()

    Linus Torvalds
     
  • Pull irq cleanups from Ingo Molnar:
    "This is a multi-arch cleanup series from Thomas Gleixner, which we
    kept to near the end of the merge window, to not interfere with
    architecture updates.

    This series (motivated by the -rt kernel) unifies more aspects of IRQ
    handling and generalizes PREEMPT_ACTIVE"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    preempt: Make PREEMPT_ACTIVE generic
    sparc: Use preempt_schedule_irq
    ia64: Use preempt_schedule_irq
    m32r: Use preempt_schedule_irq
    hardirq: Make hardirq bits generic
    m68k: Simplify low level interrupt handling code
    genirq: Prevent spurious detection for unconditionally polled interrupts

    Linus Torvalds
     

17 Nov, 2013

7 commits

  • _end is used, but it's already provided by , so use that.

    Signed-off-by: Geert Uytterhoeven
    Cc: Richard Weinberger
    Cc: user-mode-linux-devel@lists.sourceforge.net
    Signed-off-by: Richard Weinberger

    Geert Uytterhoeven
     
  • This removes the STDIO_CONSOLE Kconfig parameter which
    is defined but no longer used anywhere in the makefiles and source code.

    Signed-off-by: Michael Opdenacker
    Signed-off-by: Richard Weinberger

    Michael Opdenacker
     
  • arch/um/defconfig only lists one default configuration, and that applies
    only to the i386 architecture. Replace it with two minimal
    configuration files generated using `make savedefconfig`:

    i386_defconfig and x86_64_defconfig

    The build scripts now require two updates:

    1. um's Kconfig (arch/x86/um/Kconfig) should specify an ARCH_DEFCONFIG
    section explicitly pointing to these scripts if the required
    variables are set. Take care to remove the DEFCONFIG_LIST section
    defined in the included file arch/um/Kconfig.common.

    2. um's Makefile (arch/um/Makefile) should set KBUILD_DEFCONFIG properly
    for the top-level Makefile to pick up. Copy the logic in
    arch/x86/Makefile to properly pick the defconfig file depending on
    the actual architecture; except we're working with $SUBARCH here,
    instead of $ARCH.

    Now, you can do:

    $ ARCH=um make defconfig
    $ ARCH=um make

    and successfully build User-Mode Linux on an x86_64 box in default
    configuration.

    Cc: Richard Weinberger
    Cc: Jeff Dike
    Signed-off-by: Ramkumar Ramachandra
    Signed-off-by: Richard Weinberger

    Ramkumar Ramachandra
     
  • Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • As we have a sane show_stack() now, we can drop
    the ->saved_task hack.

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • As UML uses an alternative signal stack we cannot use
    the current stack pointer for stack dumping if UML itself
    dies by SIGSEGV. To bypass this issue we save regs taken
    from mcontext in our segv handler into thread_struct and
    use these regs to obtain the stack pointer in show_stack().

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • Currently on UML stack traces are not very reliable and both
    x86 and x86_64 have their on implementations.
    This patch unifies both and adds support to outline unreliable
    functions calls.

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     

15 Nov, 2013

1 commit


14 Nov, 2013

1 commit


01 Nov, 2013

1 commit

  • Resolve cherry-picking conflicts:

    Conflicts:
    mm/huge_memory.c
    mm/memory.c
    mm/mprotect.c

    See this upstream merge commit for more details:

    52469b4fcd4f Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

31 Oct, 2013

1 commit

  • We don't cap the size of buffer from the user so we could write past the
    end of the array here. Only root can write to this file.

    Reported-by: Nico Golde
    Reported-by: Fabian Yamaguchi
    Signed-off-by: Dan Carpenter
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     

25 Sep, 2013

1 commit

  • In order to prepare to per-arch implementations of preempt_count move
    the required bits into an asm-generic header and use this for all
    archs.

    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-h5j0c1r3e3fk015m30h8f1zx@git.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

13 Sep, 2013

3 commits

  • After the last architecture switched to generic hard irqs the config
    options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
    for !CONFIG_GENERIC_HARDIRQS can be removed.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     
  • Unlike global OOM handling, memory cgroup code will invoke the OOM killer
    in any OOM situation because it has no way of telling faults occuring in
    kernel context - which could be handled more gracefully - from
    user-triggered faults.

    Pass a flag that identifies faults originating in user space from the
    architecture-specific fault handlers to generic code so that memcg OOM
    handling can be improved.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Michal Hocko
    Cc: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: azurIt
    Cc: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • Kernel faults are expected to handle OOM conditions gracefully (gup,
    uaccess etc.), so they should never invoke the OOM killer. Reserve this
    for faults triggered in user context when it is the only option.

    Most architectures already do this, fix up the remaining few.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Michal Hocko
    Acked-by: KOSAKI Motohiro
    Cc: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: azurIt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

07 Sep, 2013

6 commits

  • These handlers are not optional and need in our case
    dummy implementions to avoid NULL pointer bugs within
    the irq core code.

    Reported-and-tested-by: Toralf Foester
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • If UML is not run by a shell it can happen that UML
    will kill unrelated proceses upon a fatal exit because
    it issues a kill(0, ...).
    To prevent such oddities we create a new session in main().

    Reported-and-tested-by: Richard W.M. Jones
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • Richard reported that some UML processes survive if the UML
    main process receives a SIGTERM.
    This issue was caused by a wrongly placed signal(SIGTERM, SIG_DFL)
    in init_new_thread_signals().
    It disabled the UML exit handler accidently for some processes.
    The correct solution is to disable the fatal handler for all
    UML helper threads/processes.
    Such that last_ditch_exit() does not get called multiple times
    and all processes can exit due to SIGTERM.

    Reported-and-tested-by: Richard W.M. Jones
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • Just a clean-up patch to remove the open coded
    variants and to ensure that all requests are submitted the
    same way.

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • UML's block device driver does not support write barriers,
    to support this this patch adds REQ_FLUSH suppport.
    Every time the block layer sends a REQ_FLUSH we fsync() now
    our backing file to guarantee data consistency.

    Reported-and-tested-by: Richard W.M. Jones
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • UML needs it's own probe_kernel_read() to handle kernel
    mode faults correctly.
    The implementation uses mincore() on the host side to detect
    whether a page is owned by the UML kernel process.

    This fixes also a possible crash when sysrq-t is used.
    Starting with 3.10 sysrq-t calls probe_kernel_read() to
    read details from the kernel workers. As kernel worker are
    completely async pointers may turn NULL while reading them.

    Cc:
    Cc:
    Cc: # 3.10.x
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     

16 Aug, 2013

1 commit

  • Ben Tebulin reported:

    "Since v3.7.2 on two independent machines a very specific Git
    repository fails in 9/10 cases on git-fsck due to an SHA1/memory
    failures. This only occurs on a very specific repository and can be
    reproduced stably on two independent laptops. Git mailing list ran
    out of ideas and for me this looks like some very exotic kernel issue"

    and bisected the failure to the backport of commit 53a59fc67f97 ("mm:
    limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT").

    That commit itself is not actually buggy, but what it does is to make it
    much more likely to hit the partial TLB invalidation case, since it
    introduces a new case in tlb_next_batch() that previously only ever
    happened when running out of memory.

    The real bug is that the TLB gather virtual memory range setup is subtly
    buggered. It was introduced in commit 597e1c3580b7 ("mm/mmu_gather:
    enable tlb flush range in generic mmu_gather"), and the range handling
    was already fixed at least once in commit e6c495a96ce0 ("mm: fix the TLB
    range flushed when __tlb_remove_page() runs out of slots"), but that fix
    was not complete.

    The problem with the TLB gather virtual address range is that it isn't
    set up by the initial tlb_gather_mmu() initialization (which didn't get
    the TLB range information), but it is set up ad-hoc later by the
    functions that actually flush the TLB. And so any such case that forgot
    to update the TLB range entries would potentially miss TLB invalidates.

    Rather than try to figure out exactly which particular ad-hoc range
    setup was missing (I personally suspect it's the hugetlb case in
    zap_huge_pmd(), which didn't have the same logic as zap_pte_range()
    did), this patch just gets rid of the problem at the source: make the
    TLB range information available to tlb_gather_mmu(), and initialize it
    when initializing all the other tlb gather fields.

    This makes the patch larger, but conceptually much simpler. And the end
    result is much more understandable; even if you want to play games with
    partial ranges when invalidating the TLB contents in chunks, now the
    range information is always there, and anybody who doesn't want to
    bother with it won't introduce subtle bugs.

    Ben verified that this fixes his problem.

    Reported-bisected-and-tested-by: Ben Tebulin
    Build-testing-by: Stephen Rothwell
    Build-testing-by: Richard Weinberger
    Reviewed-by: Michal Hocko
    Acked-by: Peter Zijlstra
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

19 Jul, 2013

5 commits


04 Jul, 2013

5 commits

  • Prepare for removing num_physpages and simplify mem_init().

    Signed-off-by: Jiang Liu
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiang Liu
     
  • Normalize global variables exported by vmlinux.lds to conform usage
    guidelines from include/asm-generic/sections.h.

    1) Use _text to mark the start of the kernel image including the head
    text, and _stext to mark the start of the .text section.
    2) Export mandatory global variables __bss_stop.
    3) Adjust __init_begin and __init_end to avoid acrossing .text and
    .data sections.

    Signed-off-by: Jiang Liu
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Al Viro
    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
     

03 Jul, 2013

1 commit

  • Pull scheduler updates from Ingo Molnar:
    "The main changes:

    - load-calculation cleanups and improvements, by Alex Shi
    - various nohz related tidying up of statisics, by Frederic
    Weisbecker
    - factor out /proc functions to kernel/sched/proc.c, by Paul
    Gortmaker
    - simplify the RT policy scheduler, by Kirill Tkhai
    - various fixes and cleanups"

    * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits)
    sched/debug: Remove CONFIG_FAIR_GROUP_SCHED mask
    sched/debug: Fix formatting of /proc//sched
    sched: Fix typo in struct sched_avg member description
    sched/fair: Fix typo describing flags in enqueue_entity
    sched/debug: Add load-tracking statistics to task
    sched: Change get_rq_runnable_load() to static and inline
    sched/tg: Remove tg.load_weight
    sched/cfs_rq: Change atomic64_t removed_load to atomic_long_t
    sched/tg: Use 'unsigned long' for load variable in task group
    sched: Change cfs_rq load avg to unsigned long
    sched: Consider runnable load average in move_tasks()
    sched: Compute runnable load avg in cpu_load and cpu_avg_load_per_task
    sched: Update cpu load after task_tick
    sched: Fix sleep time double accounting in enqueue entity
    sched: Set an initial value of runnable avg for new forked task
    sched: Move a few runnable tg variables into CONFIG_SMP
    Revert "sched: Introduce temporary FAIR_GROUP_SCHED dependency for load-tracking"
    sched: Don't mix use of typedef ctl_table and struct ctl_table
    sched: Remove WARN_ON(!sd) from init_sched_groups_power()
    sched: Fix memory leakage in build_sched_groups()
    ...

    Linus Torvalds
     

01 Jul, 2013

1 commit

  • Merge in a recent upstream commit:

    c2853c8df57f include/linux/math64.h: add div64_ul()

    because:

    72a4cf20cb71 sched: Change cfs_rq load avg to unsigned long

    relies on it.

    [ We don't rebase sched/core for this, because the handful of
    followup commits after the broken commit are not behavioral
    changes so are unlikely to be needed during bisection. ]

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

29 Jun, 2013

1 commit


19 Jun, 2013

1 commit

  • Most of the stuff from kernel/sched.c was moved to kernel/sched/core.c long time
    back and the comments/Documentation never got updated.

    I figured it out when I was going through sched-domains.txt and so thought of
    fixing it globally.

    I haven't crossed check if the stuff that is referenced in sched/core.c by all
    these files is still present and hasn't changed as that wasn't the motive behind
    this patch.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/cdff76a265326ab8d71922a1db5be599f20aad45.1370329560.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Viresh Kumar