03 Apr, 2013

1 commit

  • We are planning to convert the dynticks Kconfig options layout
    into a choice menu. The user must be able to easily pick
    any of the following implementations: constant periodic tick,
    idle dynticks, full dynticks.

    As this implies a mutual exclusion, the two dynticks implementions
    need to converge on the selection of a common Kconfig option in order
    to ease the sharing of a common infrastructure.

    It would thus seem pretty natural to reuse CONFIG_NO_HZ to
    that end. It already implements all the idle dynticks code
    and the full dynticks depends on all that code for now.
    So ideally the choice menu would propose CONFIG_NO_HZ_IDLE and
    CONFIG_NO_HZ_EXTENDED then both would select CONFIG_NO_HZ.

    On the other hand we want to stay backward compatible: if
    CONFIG_NO_HZ is set in an older config file, we want to
    enable CONFIG_NO_HZ_IDLE by default.

    But we can't afford both at the same time or we run into
    a circular dependency:

    1) CONFIG_NO_HZ_IDLE and CONFIG_NO_HZ_EXTENDED both select
    CONFIG_NO_HZ
    2) If CONFIG_NO_HZ is set, we default to CONFIG_NO_HZ_IDLE

    We might be able to support that from Kconfig/Kbuild but it
    may not be wise to introduce such a confusing behaviour.

    So to solve this, create a new CONFIG_NO_HZ_COMMON option
    which gathers the common code between idle and full dynticks
    (that common code for now is simply the idle dynticks code)
    and select it from their referring Kconfig.

    Then we'll later create CONFIG_NO_HZ_IDLE and map CONFIG_NO_HZ
    to it for backward compatibility.

    Signed-off-by: Frederic Weisbecker
    Cc: Andrew Morton
    Cc: Chris Metcalf
    Cc: Christoph Lameter
    Cc: Geoff Levand
    Cc: Gilad Ben Yossef
    Cc: Hakan Akkan
    Cc: Ingo Molnar
    Cc: Kevin Hilman
    Cc: Li Zhong
    Cc: Namhyung Kim
    Cc: Paul E. McKenney
    Cc: Paul Gortmaker
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner

    Frederic Weisbecker
     

10 Oct, 2012

1 commit


06 Sep, 2012

1 commit

  • Fix the following compile error on UML.

    arch/um/os-Linux/time.c: In function 'deliver_alarm':
    arch/um/os-Linux/time.c:117:3: error: too few arguments to function 'alarm_handler'
    arch/um/os-Linux/internal.h:1:6: note: declared here

    The error was introduced by commit d3c1cfcd ("um: pass siginfo to guest
    process") in 3.6-rc1.

    Signed-off-by: Miklos Szeredi
    CC: Martin Pärtel
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

02 Aug, 2012

1 commit

  • UML guest processes now get correct siginfo_t for SIGTRAP, SIGFPE,
    SIGILL and SIGBUS. Specifically, si_addr and si_code are now correct
    where previously they were si_addr = NULL and si_code = 128.

    Signed-off-by: Martin Pärtel
    Signed-off-by: Richard Weinberger

    Martin Pärtel
     

02 Nov, 2011

2 commits


27 Oct, 2010

1 commit

  • This fixes a issue which was introduced by fe2cc53e ("uml: track and make
    up lost ticks").

    timeval_to_ns() returns long long and not int. Due to that UML's timer
    did not work properlt and caused timer freezes.

    Signed-off-by: Richard Weinberger
    Acked-by: Pekka Enberg
    Cc: Jeff Dike
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Weinberger
     

07 Jun, 2008

1 commit

  • Protection against the host's time going backwards (eg, ntp activity on
    the host) by keeping track of the time at the last tick and if it's
    greater than the current time, keep time stopped until the host catches
    up.

    Cc: Nix
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

13 May, 2008

1 commit

  • Alarm delivery could be noticably late in the !CONFIG_NOHZ case because lost
    ticks weren't being taken into account. This is now treated more carefully,
    with the time between ticks being calculated and the appropriate number of
    ticks delivered to the timekeeping system.

    Cc: Nix
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

04 Dec, 2007

1 commit


30 Nov, 2007

1 commit

  • With NO_HZ disabled, the UML idle loop effectively becomes a busy loop, as
    it will sleep for no time.

    The cause was forgetting to restart the tick after waking up from sleep.
    It was disabled before sleeping, and the remaining time used as the
    interval to sleep. So, the tick needs to be restarted when nanosleep
    finishes.

    This is done by introducing after_sleep_interval, which is empty in the
    NO_HZ case, but which sets the tick starting in the !NO_HZ case.

    Signed-off-by: Jeff Dike
    Cc: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

17 Oct, 2007

10 commits

  • There are various uses of powers of 1000, plus the odd BILLION constant in the
    time code. However, there are perfectly good definitions of *SEC_PER_*SEC in
    linux/time.h which can be used instaed.

    These are replaced directly in kernel code. Userspace code imports those
    constants as UM_*SEC_PER_*SEC and uses these.

    Signed-off-by: Jeff Dike
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Put back an implementation of timeval_to_ns in arch/um/os-Linux/time.c.
    tglx pointed out in his review of tickless support that there was a
    perfectly good implementation of it in linux/time.h. The problem is that
    this is userspace code which can't pull in kernel headers and there doesn't
    seem to be a libc version.

    So, I'm copying the version from linux/time.h rather than resurrecting my
    version. This causes some declaration changes as it now returns a signed
    value rather than an unsigned value.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Now, the idle loop now longer needs SIGALRM firing - it can just sleep for the
    requisite amount of time and fake a timer interrupt when it finishes.

    Any use of ITIMER_REAL now goes away. disable_timer only turns off
    ITIMER_VIRTUAL. switch_timers is no longer needed, so it, and all calls, goes
    away.

    disable_timer now returns the amount of time remaining on the timer.
    default_idle uses this to tell idle_sleep how long to sleep. idle_sleep will
    call alarm_handler if nanosleep returns 0, which is the case if it didn't
    return early due to an interrupt. Otherwise, it just returns.

    Signed-off-by: Jeff Dike
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Enable tickless support.

    CONFIG_TICK_ONESHOT and CONFIG_NO_HZ are enabled.

    itimer_clockevent gets CLOCK_EVT_FEAT_ONESHOT and an implementation of
    .set_next_event.

    CONFIG_UML_REAL_TIME_CLOCK goes away because it only makes sense when there is
    a clock ticking away all the time. timer_handler now just calls do_IRQ once
    without trying to figure out how many ticks to emulate.

    The idle loop now needs to turn ticking on and off.

    Userspace ticks keep happening as usual. However, the userspace loop keep
    track of when the next wakeup should happen and suppresses process ticks until
    that happens.

    Signed-off-by: Jeff Dike
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Enable CONFIG_GENERIC_CLOCKEVENTS.

    timer_irq gets its name changed to timer_handler, and becomes the recipient of
    timer signals.

    The clock_event_device is set up to imitate the current ticking clock, i.e.
    CLOCK_EVT_FEAT_ONESHOT is not enabled yet.

    disable_timer now doesn't ignore SIGALRM and SIGVTALRM because that breaks
    delay calibration.

    Signed-off-by: Jeff Dike
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • set_interval took a timer type as an argument, but it always specified a
    virtual timer. So, it is not needed, and it is gone, and set_interval is
    simplified appropriately.

    Signed-off-by: Jeff Dike
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Fix up the switching between virtual and real timers. The idle loop sleeps,
    so the timer at that point must be real time. At all other times, the timer
    must be virtual. Even when userspace is running, and the kernel is asleep,
    the virtual timer is correct because the process timer will be running and the
    process timer will be firing.

    The timer switch used to be in the context switch and timer handler code.
    This is moved to the idle loop and the signal handler, making it much more
    clear why it is happening.

    switch_timers now returns the old timer type so that it may be restored. The
    signal handler uses this in order to restore the previous timer type when it
    returns.

    Signed-off-by: Jeff Dike
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Eliminate hz() since its only purpose was to provide a kernel-space constant
    to userspace code. This can be done instead by providing the constant
    directly through kernel_constants.h.

    Signed-off-by: Jeff Dike
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Formatting changes in the files which have been changed in the
    tt-removal patchset so far. These include:
    copyright updates
    header file trimming
    style fixes
    adding severity to printks
    indenting Kconfig help according to the predominant kernel style

    These changes should be entirely non-functional.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patchset throws out tt mode, which has been non-functional for a while.

    This is done in phases, interspersed with code cleanups on the affected files.

    The removal is done as follows:
    remove all code, config options, and files which depend on
    CONFIG_MODE_TT
    get rid of the CHOOSE_MODE macro, which decided whether to
    call tt-mode or skas-mode code, and replace invocations with their
    skas portions
    replace all now-trivial procedures with their skas equivalents

    There are now a bunch of now-redundant pieces of data structures, including
    mode-specific pieces of the thread structure, pt_regs, and mm_context. These
    are all replaced with their skas-specific contents.

    As part of the ongoing style compliance project, I made a style pass over all
    files that were changed. There are three such patches, one for each phase,
    covering the files affected by that phase but no later ones.

    I noticed that we weren't freeing the LDT state associated with a process when
    it exited, so that's fixed in one of the later patches.

    The last patch is a tidying patch which I've had for a while, but which caused
    inexplicable crashes under tt mode. Since that is no longer a problem, this
    can now go in.

    This patch:

    Start getting rid of tt mode support.

    This patch throws out CONFIG_MODE_TT and all config options, code, and files
    which depend on it.

    CONFIG_MODE_SKAS is gone and everything that depends on it is included
    unconditionally.

    The few changed lines are in re-written Kconfig help, lines which needed
    something skas-related removed from them, and a few more which weren't
    strictly deletions.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

08 May, 2007

1 commit

  • user_util.h isn't needed any more, so delete it and remove all includes of it.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

21 Oct, 2006

1 commit


26 Sep, 2006

2 commits

  • set_interval returns an error instead of panicing if setitimer fails. Some of
    its callers now check the return.

    enable_timer is largely tt-mode-specific, so it is marked as such, and the
    only skas-mode caller is made to call set-interval instead.

    user_time_init was a no-value-added wrapper around set_interval, so it is
    gone.

    Since set_interval is now called from kernel code, callers no longer pass
    ITIMER_* to it. Instead, they pass a flag which is converted into ITIMER_REAL
    or ITIMER_VIRTUAL.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Have most signals go through an arch-provided handler which recovers the
    sigcontext and then calls a generic handler. This replaces the
    ARCH_GET_SIGCONTEXT macro, which was somewhat fragile. On x86_64, recovering
    %rdx (which holds the sigcontext pointer) must be the first thing that
    happens. sig_handler duly invokes that first, but there is no guarantee that
    I can see that instructions won't be reordered such that %rdx is used before
    that. Having the arch provide the handler seems much more robust.

    Some signals in some parts of UML require their own handlers - these places
    don't call set_handler any more. They call sigaction or signal themselves.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

11 Jul, 2006

3 commits

  • uml_idle_timer is tt-mode only, so ifdef it as such to make it easier to spot
    when tt mode is killed.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • wall_to_monotonic isn't used in this file, so we can remove the declaration.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This cleans up the mess that is the timer initialization. There used to be
    two timer handlers - one that basically ran during delay loop calibration and
    one that handled the timer afterwards. There were also two sets of timer
    initialization code - one that starts in user code and calls into the kernel
    side of the house, and one that starts in kernel code and calls user code.

    This eliminates one timer handler and consolidates the two sets of
    initialization code.

    [akpm@osdl.org: use new INTF_ flags]
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

06 Jun, 2006

1 commit

  • From: Jeff Dike

    Initialize wall_to_monotonic correctly. This fixes a problem where sleeps
    lasted about one secone less than they should. This also called for a bit of
    code restructuring, following a patch which Blaisorblade had been keeping.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

19 Jan, 2006

1 commit

  • The serial UML OS-abstraction layer patch (um/kernel dir).

    This moves all systemcalls from time.c file under os-Linux dir and joins
    time.c and tine_kernel.c files

    Signed-off-by: Gennady Sharapov
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gennady Sharapov
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds