linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] munmap: Flexible mem unmap operation interface for scheduling latency
@ 2011-04-25 10:44 Geunsik Lim
  2011-04-25 10:44 ` [PATCH 1/4] munmap: mem unmap operation size handling Geunsik Lim
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Geunsik Lim @ 2011-04-25 10:44 UTC (permalink / raw)
  To: Ingo Molnar, Andrew Morton
  Cc: Peter Zijlstra, Thomas Gleixner, H. Peter Anvin, Hugh Dickins,
	Steven Rostedt, Darren Hart, linux-kernel, linux-rt-users

From: Geunsik Lim <geunsik.lim@samsung.com>

    As we all know, the specification of H/W(cpu, memory, i/o bandwidth, etc) is
    different according to their SOC. We can earn a suitable performance(or latency) after
    adjust memory unmap size by selecting an optimal value to consider specified system
    environment in real world.
    In other words, We can get real-fast or real-time using the Linux kernel tunable
    parameter choosingly for flexible memory unmap operation unit.

    For example, we can get the below effectiveness using this patch 
    . Reduce a temporal cpu intension(highest cpu usage) when accessing mass files
    . Improvement of user responsiveness at embedded products like mobile phone, camcorder, dica
    . Get a effective real-time or real-fast at the real world that depend on the physical h/w
    . Support sysctl interface(tunalbe parameter) to find a suitable munmap operation unit 
      at runtime favoringly

    unmap_vmas(=unmap a range of memory covered by a list of vma) is treading
    a delicate and uncomfortable line between hi-performance and lo-latency.
    We have often chosen to improve performance at the expense of latency.

    So although there may be no need to reschedule right now,
    if we keep on gathering more and more without flushing,
    we'll be very unresponsive when a resched is needed later on.

    resched is a routine that is called by the current process when rescheduling is to
    take place. It is called not only when the time quantum of the current process expires
    but also when a blocking(waiting) call such as wait is invoked by the current process
    or when a new process of potentially higher priority becomes eligible for execution.

    Here are some history about ZAP_BLOCK_SIZE content discussed for scheduling latencies
    a long time ago. Hence Ingo's ZAP_BLOCK_SIZE to split it up, small when CONFIG_PREEMPT,
    more reasonable but still limited when not.
    . Patch subject - [patch] sched, mm: fix scheduling latencies in unmap_vmas()
    . LKML archive - http://lkml.org/lkml/2004/9/14/101

    Robert Love submitted to get the better latencies by creating a preemption point
    at Linux 2.5.28 (development version).
    . Patch subject - [PATCH] updated low-latency zap_page_range
    . LKML archive - http://lkml.org/lkml/2002/7/24/273

    Originally, We aim to not hold locks for too long (for scheduling latency reasons).
    So zap pages in ZAP_BLOCK_SIZE byte counts.
    This means we need to return the ending mmu_gather to the caller.

    In general, This is not a critical latency-path on preemption mode
    (PREEMPT_VOLUNTARY / PREEMPT_DESKTOP / PREEMPT_RT)

    . Vanilla's preemption mode (mainline kernel tree)
      - http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git v2.6.38
        1) CONFIG_PREEMPT_NONE: No Forced Preemption (Server)
        2) CONFIG_PREEMPT_VOLUNTARY: Voluntary Kernel Preemption (Desktop)
        3) CONFIG_PREEMPT: Preemptible Kernel (Low-Latency Desktop)

    . Ingo rt patch's preemption mode (-tip kernel tree)
      - http://git.kernel.org/?p=linux/kernel/git/tip/linux-2.6-tip.git v2.6.33.9-rt31
        1) CONFIG_PREEMPT_NONE
        2) CONFIG_PREEMPT_VOLUNTARY
        3) CONFIG_PREEMPT + CONFIG_PREEMPT_DESKTOP
        4) CONFIG_PREEMPT + CONFIG_PREEMPT_RT + CONFIG_PREEMPT_{SOFTIRQS|HARDIRQS}

    This value can be changed at runtime using the
    '/proc/sys/vm/munmap_unit_size' as Linux kernel tunable parameter after boot.

	* Examples: The size of one page is 4,096bytes.
                  2048 => 8,388,608bytes : for straight-line efficiency (performance)
                  1024 => 4,194,304bytes
                   512 => 2,097,152bytes
                   256 => 1,048,576bytes
                   128 =>   524,288bytes
                    64 =>   262,144bytes
                    32 =>   131,072bytes
                    16 =>    65,536bytes
                     8 =>    32,768bytes : for low-latency

    p.s: I checked parsing of this patch file with './linux-2.6/script/checkpatch.pl' script.
         and, I uploaded demo video using youtube about the evaluation result according  
	 to munmap operation unit interface. (http://www.youtube.com/watch?v=PxcgvDTY5F0)

    Thanks for reading.

Geunsik Lim (4):
  munmap operation size handling
  sysctl extension for tunable parameter
  kbuild menu for munmap interface
  documentation of munmap operation interface

 Documentation/sysctl/vm.txt      |   36 +++++++++++++++++++
 MAINTAINERS                      |    7 ++++
 include/linux/munmap_unit_size.h |   24 +++++++++++++
 init/Kconfig                     |   70 ++++++++++++++++++++++++++++++++++++++
 kernel/sysctl.c                  |   10 +++++
 mm/Makefile                      |    4 ++-
 mm/memory.c                      |   21 +++++++----
 mm/munmap_unit_size.c            |   57 +++++++++++++++++++++++++++++++
 8 files changed, 221 insertions(+), 8 deletions(-)
 create mode 100644 include/linux/munmap_unit_size.h
 create mode 100644 mm/munmap_unit_size.c

-- 
1.7.3.4


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-04-27  0:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-25 10:44 [PATCH 0/4] munmap: Flexible mem unmap operation interface for scheduling latency Geunsik Lim
2011-04-25 10:44 ` [PATCH 1/4] munmap: mem unmap operation size handling Geunsik Lim
2011-04-25 10:44 ` [PATCH 2/4] munmap: sysctl extension for tunable parameter Geunsik Lim
2011-04-25 10:44 ` [PATCH 3/4] munmap: kbuild menu for munmap interface Geunsik Lim
2011-04-25 15:31   ` Steven Rostedt
2011-04-26  0:40     ` Geunsik Lim
2011-04-25 15:45   ` Randy Dunlap
2011-04-26  0:42     ` Geunsik Lim
2011-04-26 22:51       ` Hugh Dickins
2011-04-27  0:07         ` Geunsik Lim
2011-04-25 10:44 ` [PATCH 4/4] munmap: documentation of munmap operation interface Geunsik Lim
2011-04-25 19:47 ` [PATCH 0/4] munmap: Flexible mem unmap operation interface for scheduling latency Peter Zijlstra
2011-04-25 20:29   ` Steven Rostedt
2011-04-26  7:25     ` Peter Zijlstra
2011-04-26 12:30       ` Steven Rostedt
2011-04-26  1:20   ` Geunsik Lim
2011-04-26  7:22     ` Peter Zijlstra
2011-04-26 23:57       ` Geunsik Lim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).