07 Apr, 2010

1 commit

  • When we look into pagemap using page-types with option -p, the value of
    pfn for hugepages looks wrong (see below.) This is because pte was
    evaluated only once for one vma although it should be updated for each
    hugepage. This patch fixes it.

    $ page-types -p 3277 -Nl -b huge
    voffset offset len flags
    7f21e8a00 11e400 1 ___U___________H_G________________
    7f21e8a01 11e401 1ff ________________TG________________
    ^^^
    7f21e8c00 11e400 1 ___U___________H_G________________
    7f21e8c01 11e401 1ff ________________TG________________
    ^^^

    One hugepage contains 1 head page and 511 tail pages in x86_64 and each
    two lines represent each hugepage. Voffset and offset mean virtual
    address and physical address in the page unit, respectively. The
    different hugepages should not have the same offset value.

    With this patch applied:

    $ page-types -p 3386 -Nl -b huge
    voffset offset len flags
    7fec7a600 112c00 1 ___UD__________H_G________________
    7fec7a601 112c01 1ff ________________TG________________
    ^^^
    7fec7a800 113200 1 ___UD__________H_G________________
    7fec7a801 113201 1ff ________________TG________________
    ^^^
    OK

    More info:

    - This patch modifies walk_page_range()'s hugepage walker. But the
    change only affects pagemap_read(), which is the only caller of hugepage
    callback.

    - Without this patch, hugetlb_entry() callback is called per vma, that
    doesn't match the natural expectation from its name.

    - With this patch, hugetlb_entry() is called per hugepte entry and the
    callback can become much simpler.

    Signed-off-by: Naoya Horiguchi
    Signed-off-by: KAMEZAWA Hiroyuki
    Acked-by: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naoya Horiguchi
     

06 Apr, 2010

1 commit


05 Apr, 2010

2 commits

  • Tejun Heo
     
  • In initial design, walk_page_range() was designed just for walking page
    table and it didn't require mmap_sem. Now, find_vma() etc.. are used
    in walk_page_range() and we need mmap_sem around it.

    This patch adds mmap_sem around walk_page_range().

    Because /proc//pagemap's callback routine use put_user(), we have
    to get rid of it to do sane fix.

    Changelog: 2010/Apr/2
    - fixed start_vaddr and end overflow
    Changelog: 2010/Apr/1
    - fixed start_vaddr calculation
    - removed unnecessary cast.
    - removed unnecessary change in smaps.
    - use GFP_TEMPORARY instead of GFP_KERNEL

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Matt Mackall
    Cc: KOSAKI Motohiro
    Cc: San Mehat
    Cc: Brian Swetland
    Cc: Dave Hansen
    Cc: Andrew Morton
    [ Fixed kmalloc failure return code as per Matt ]
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     

01 Apr, 2010

1 commit

  • proc_oom_score(task) has a reference to task_struct, but that is all.
    If this task was already released before we take tasklist_lock

    - we can't use task->group_leader, it points to nowhere

    - it is not safe to call badness() even if this task is
    ->group_leader, has_intersects_mems_allowed() assumes
    it is safe to iterate over ->thread_group list.

    - even worse, badness() can hit ->signal == NULL

    Add the pid_alive() check to ensure __unhash_process() was not called.

    Also, use "task" instead of task->group_leader. badness() should return
    the same result for any sub-thread. Currently this is not true, but
    this should be changed anyway.

    Signed-off-by: Oleg Nesterov
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

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
     

25 Mar, 2010

1 commit

  • "m" is never NULL here. We need a different test for the end of list
    condition.

    Signed-off-by: Dan Carpenter
    Acked-by: KAMEZAWA Hiroyuki
    Acked-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     

07 Mar, 2010

5 commits

  • * warn if creation goes on to non-existent directory
    * warn if removal goes on from non-existing directory
    * warn if non-existing proc entry is removed

    Signed-off-by: Alexey Dobriyan
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • remove_proc_entry() does

    lock
    lookup parent
    unlock
    lock
    unlink proc entry from lists
    unlock

    which can be made bit more correct by doing parent translation + unlink
    without dropping lock.

    Signed-off-by: Alexey Dobriyan
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Make sure compiler won't do weird things with limits. E.g. fetching them
    twice may return 2 different values after writable limits are implemented.

    I.e. either use rlimit helpers added in commit 3e10e716abf3 ("resource:
    add helpers for fetching rlimits") or ACCESS_ONCE if not applicable.

    Signed-off-by: Jiri Slaby
    Cc: Alexander Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • A frequent questions from users about memory management is what numbers of
    swap ents are user for processes. And this information will give some
    hints to oom-killer.

    Besides we can count the number of swapents per a process by scanning
    /proc//smaps, this is very slow and not good for usual process
    information handler which works like 'ps' or 'top'. (ps or top is now
    enough slow..)

    This patch adds a counter of swapents to mm_counter and update is at each
    swap events. Information is exported via /proc//status file as

    [kamezawa@bluextal memory]$ cat /proc/self/status
    Name: cat
    State: R (running)
    Tgid: 2910
    Pid: 2910
    PPid: 2823
    TracerPid: 0
    Uid: 500 500 500 500
    Gid: 500 500 500 500
    FDSize: 256
    Groups: 500
    VmPeak: 82696 kB
    VmSize: 82696 kB
    VmLck: 0 kB
    VmHWM: 432 kB
    VmRSS: 432 kB
    VmData: 172 kB
    VmStk: 84 kB
    VmExe: 48 kB
    VmLib: 1568 kB
    VmPTE: 40 kB
    VmSwap: 0 kB
    Reviewed-by: Minchan Kim
    Reviewed-by: Christoph Lameter
    Cc: Lee Schermerhorn
    Cc: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Presently, per-mm statistics counter is defined by macro in sched.h

    This patch modifies it to
    - defined in mm.h as inlinf functions
    - use array instead of macro's name creation.

    This patch is for reducing patch size in future patch to modify
    implementation of per-mm counter.

    Signed-off-by: KAMEZAWA Hiroyuki
    Reviewed-by: Minchan Kim
    Cc: Christoph Lameter
    Cc: Lee Schermerhorn
    Cc: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     

05 Mar, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
    init: Open /dev/console from rootfs
    mqueue: fix typo "failues" -> "failures"
    mqueue: only set error codes if they are really necessary
    mqueue: simplify do_open() error handling
    mqueue: apply mathematics distributivity on mq_bytes calculation
    mqueue: remove unneeded info->messages initialization
    mqueue: fix mq_open() file descriptor leak on user-space processes
    fix race in d_splice_alias()
    set S_DEAD on unlink() and non-directory rename() victims
    vfs: add NOFOLLOW flag to umount(2)
    get rid of ->mnt_parent in tomoyo/realpath
    hppfs can use existing proc_mnt, no need for do_kern_mount() in there
    Mirror MS_KERNMOUNT in ->mnt_flags
    get rid of useless vfsmount_lock use in put_mnt_ns()
    Take vfsmount_lock to fs/internal.h
    get rid of insanity with namespace roots in tomoyo
    take check for new events in namespace (guts of mounts_poll()) to namespace.c
    Don't mess with generic_permission() under ->d_lock in hpfs
    sanitize const/signedness for udf
    nilfs: sanitize const/signedness in dealing with ->d_name.name
    ...

    Fix up fairly trivial (famous last words...) conflicts in
    drivers/infiniband/core/uverbs_main.c and security/tomoyo/realpath.c

    Linus Torvalds
     

04 Mar, 2010

2 commits


01 Mar, 2010

2 commits

  • James Morris
     
  • * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (44 commits)
    rcu: Fix accelerated GPs for last non-dynticked CPU
    rcu: Make non-RCU_PROVE_LOCKING rcu_read_lock_sched_held() understand boot
    rcu: Fix accelerated grace periods for last non-dynticked CPU
    rcu: Export rcu_scheduler_active
    rcu: Make rcu_read_lock_sched_held() take boot time into account
    rcu: Make lockdep_rcu_dereference() message less alarmist
    sched, cgroups: Fix module export
    rcu: Add RCU_CPU_STALL_VERBOSE to dump detailed per-task information
    rcu: Fix rcutorture mod_timer argument to delay one jiffy
    rcu: Fix deadlock in TREE_PREEMPT_RCU CPU stall detection
    rcu: Convert to raw_spinlocks
    rcu: Stop overflowing signed integers
    rcu: Use canonical URL for Mathieu's dissertation
    rcu: Accelerate grace period if last non-dynticked CPU
    rcu: Fix citation of Mathieu's dissertation
    rcu: Documentation update for CONFIG_PROVE_RCU
    security: Apply lockdep-based checking to rcu_dereference() uses
    idr: Apply lockdep-based diagnostics to rcu_dereference() uses
    radix-tree: Disable RCU lockdep checking in radix tree
    vfs: Abstract rcu_dereference_check for files-fdtable use
    ...

    Linus Torvalds
     

26 Feb, 2010

1 commit

  • * 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (41 commits)
    of: remove undefined request_OF_resource & release_OF_resource
    of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
    of: move definition of of_chosen into common code.
    of: remove unused extern reference to devtree_lock
    of: put default string compare and #a/s-cell values into common header
    of/flattree: Don't assume HAVE_LMB
    of: protect linux/of.h with CONFIG_OF
    proc_devtree: fix THIS_MODULE without module.h
    of: Remove old and misplaced function declarations
    of/flattree: Make the kernel accept ePAPR style phandle information
    of/flattree: endian-convert members of boot_param_header
    of: assume big-endian properties, adding conversions where necessary
    of: use __be32 for cell value accessors
    of/flattree: use OF_ROOT_NODE_{SIZE,ADDR}_CELLS DEFAULT for fdt parsing
    of/flattree: use callback to setup initrd from /chosen
    proc_devtree: include linux/of.h
    of: make set_node_proc_entry private to proc_devtree.c
    of: include linux/proc_fs.h
    of/flattree: merge early_init_dt_scan_memory() common code
    of: add 'of_' prefix to machine_is_compatible()
    ...

    Linus Torvalds
     

25 Feb, 2010

1 commit

  • Add lockdep-ified RCU primitives to alloc_fd(), files_fdtable()
    and fcheck_files().

    Cc: Alexander Viro
    Signed-off-by: Paul E. McKenney
    Cc: laijs@cn.fujitsu.com
    Cc: dipankar@in.ibm.com
    Cc: mathieu.desnoyers@polymtl.ca
    Cc: josh@joshtriplett.org
    Cc: dvhltc@us.ibm.com
    Cc: niv@us.ibm.com
    Cc: peterz@infradead.org
    Cc: rostedt@goodmis.org
    Cc: Valdis.Kletnieks@vt.edu
    Cc: dhowells@redhat.com
    Cc: Alexander Viro
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Paul E. McKenney
     

19 Feb, 2010

1 commit


14 Feb, 2010

1 commit

  • Commit e22f628395432b967f2f505858c64450f7835365 introduced a build
    breakage for ARM devtree work: the THIS_MODULE macro was added, but we
    don't have module.h

    This change adds the necessary #include to get THIS_MODULE defined.
    While we could just replace it with NULL (PROC_FS is a bool, not a
    tristate), using THIS_MODULE will prevent unexpected breakage if we
    ever do compile this as a module.

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Grant Likely
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Michal Simek

    Jeremy Kerr
     

09 Feb, 2010

2 commits

  • Currenly, proc_devtree.c depends on asm/prom.h to include linux/of.h, to
    provide some device-tree definitions (eg, struct property).

    Instead, include linux/of.h directly. We still need asm/prom.h for
    HAVE_ARCH_DEVTREE_FIXUPS.

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Grant Likely

    Jeremy Kerr
     
  • We only need set_node_proc_entry in proc_devtree.c, so move it there.

    This fixes the !HAVE_ARCH_DEVTREE_FIXUPS build, as we can't make make
    the definition in linux/of.h conditional on this #define (definitions in
    asm/prom.h can't be exposed to linux/of.h, due to the enforced #include
    ordering).

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Grant Likely

    Jeremy Kerr
     

04 Feb, 2010

2 commits

  • Right now the syslog "type" action are just raw numbers which makes
    the source difficult to follow. This patch replaces the raw numbers
    with defined constants for some level of sanity.

    Signed-off-by: Kees Cook
    Acked-by: John Johansen
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    Kees Cook
     
  • This allows the LSM to distinguish between syslog functions originating
    from /proc/kmsg access and direct syscalls. By default, the commoncaps
    will now no longer require CAP_SYS_ADMIN to read an opened /proc/kmsg
    file descriptor. For example the kernel syslog reader can now drop
    privileges after opening /proc/kmsg, instead of staying privileged with
    CAP_SYS_ADMIN. MAC systems that implement security_syslog have unchanged
    behavior.

    Signed-off-by: Kees Cook
    Acked-by: Serge Hallyn
    Acked-by: John Johansen
    Signed-off-by: James Morris

    Kees Cook
     

14 Jan, 2010

1 commit

  • We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT)
    if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type
    is bogus here; we want LAST_BIND for everything of that kind and we
    get LAST_NORM left over from finding parent directory.

    So make sure that it *is* set properly; set to LAST_BIND before
    doing ->follow_link() - for normal symlinks it will be changed
    by __vfs_follow_link() and everything else needs it set that way.

    Signed-off-by: Al Viro

    Al Viro
     

12 Jan, 2010

2 commits

  • A long time ago we regarded zero page as file_rss and vm_normal_page
    doesn't return NULL.

    But now, we reinstated ZERO_PAGE and vm_normal_page's implementation can
    return NULL in case of zero page. Also we don't count it with file_rss
    any more.

    Then, RSS and PSS can't be matched. For consistency, Let's ignore zero
    page in smaps_pte_range.

    Signed-off-by: Minchan Kim
    Acked-by: KAMEZAWA Hiroyuki
    Acked-by: Hugh Dickins
    Acked-by: Matt Mackall
    Reviewed-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Minchan Kim
     
  • Commit d899bf7b (procfs: provide stack information for threads) introduced
    to show stack information in /proc/{pid}/status. But it cause large
    performance regression. Unfortunately /proc/{pid}/status is used ps
    command too and ps is one of most important component. Because both to
    take mmap_sem and page table walk are heavily operation.

    If many process run, the ps performance is,

    [before d899bf7b]

    % perf stat ps >/dev/null

    Performance counter stats for 'ps':

    4090.435806 task-clock-msecs # 0.032 CPUs
    229 context-switches # 0.000 M/sec
    0 CPU-migrations # 0.000 M/sec
    234 page-faults # 0.000 M/sec
    8587565207 cycles # 2099.425 M/sec
    9866662403 instructions # 1.149 IPC
    3789415411 cache-references # 926.409 M/sec
    30419509 cache-misses # 7.437 M/sec

    128.859521955 seconds time elapsed

    [after d899bf7b]

    % perf stat ps > /dev/null

    Performance counter stats for 'ps':

    4305.081146 task-clock-msecs # 0.028 CPUs
    480 context-switches # 0.000 M/sec
    2 CPU-migrations # 0.000 M/sec
    237 page-faults # 0.000 M/sec
    9021211334 cycles # 2095.480 M/sec
    10605887536 instructions # 1.176 IPC
    3612650999 cache-references # 839.160 M/sec
    23917502 cache-misses # 5.556 M/sec

    152.277819582 seconds time elapsed

    Thus, this patch revert it. Fortunately /proc/{pid}/task/{tid}/smaps
    provide almost same information. we can use it.

    Commit d899bf7b introduced two features:

    1) Add the annotattion of [thread stack: xxxx] mark to
    /proc/{pid}/task/{tid}/maps.
    2) Add StackUsage field to /proc/{pid}/status.

    I only revert (2), because I haven't seen (1) cause regression.

    Signed-off-by: KOSAKI Motohiro
    Cc: Stefani Seibold
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Alexey Dobriyan
    Cc: "Eric W. Biederman"
    Cc: Randy Dunlap
    Cc: Andrew Morton
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     

20 Dec, 2009

1 commit

  • …l/git/tip/linux-2.6-tip

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (25 commits)
    sched: Fix broken assertion
    sched: Assert task state bits at build time
    sched: Update task_state_arraypwith new states
    sched: Add missing state chars to TASK_STATE_TO_CHAR_STR
    sched: Move TASK_STATE_TO_CHAR_STR near the TASK_state bits
    sched: Teach might_sleep() about preemptible RCU
    sched: Make warning less noisy
    sched: Simplify set_task_cpu()
    sched: Remove the cfs_rq dependency from set_task_cpu()
    sched: Add pre and post wakeup hooks
    sched: Move kthread_bind() back to kthread.c
    sched: Fix select_task_rq() vs hotplug issues
    sched: Fix sched_exec() balancing
    sched: Ensure set_task_cpu() is never called on blocked tasks
    sched: Use TASK_WAKING for fork wakups
    sched: Select_task_rq_fair() must honour SD_LOAD_BALANCE
    sched: Fix task_hot() test order
    sched: Fix set_cpu_active() in cpu_down()
    sched: Mark boot-cpu active before smp_init()
    sched: Fix cpu_clock() in NMIs, on !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
    ...

    Linus Torvalds
     

17 Dec, 2009

3 commits

  • Since everybody is lazy and prone to forgetting things, make the
    compiler help us a bit.

    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Neglected because its hidden... (who reads comments anyway)

    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • * 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6: (34 commits)
    HWPOISON: Remove stray phrase in a comment
    HWPOISON: Try to allocate migration page on the same node
    HWPOISON: Don't do early filtering if filter is disabled
    HWPOISON: Add a madvise() injector for soft page offlining
    HWPOISON: Add soft page offline support
    HWPOISON: Undefine short-hand macros after use to avoid namespace conflict
    HWPOISON: Use new shake_page in memory_failure
    HWPOISON: Use correct name for MADV_HWPOISON in documentation
    HWPOISON: mention HWPoison in Kconfig entry
    HWPOISON: Use get_user_page_fast in hwpoison madvise
    HWPOISON: add an interface to switch off/on all the page filters
    HWPOISON: add memory cgroup filter
    memcg: add accessor to mem_cgroup.css
    memcg: rename and export try_get_mem_cgroup_from_page()
    HWPOISON: add page flags filter
    mm: export stable page flags
    HWPOISON: limit hwpoison injector to known page types
    HWPOISON: add fs/device filters
    HWPOISON: return 0 to indicate success reliably
    HWPOISON: make semantics of IGNORED/DELAYED clear
    ...

    Linus Torvalds
     

16 Dec, 2009

6 commits

  • Currently all architectures but microblaze unconditionally define
    USE_ELF_CORE_DUMP. The microblaze omission seems like an error to me, so
    let's kill this ifdef and make sure we are the same everywhere.

    Signed-off-by: Christoph Hellwig
    Acked-by: Hugh Dickins
    Cc:
    Cc: Michal Simek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • * de_get() is trivial -- make inline, save a few bits of code, drop
    "refcount is 0" check -- it should be done in some generic refcount
    code, don't recall it's was helpful

    * rename GET and PUT functions to pde_get(), pde_put() for cool prefix!

    * remove obvious and incorrent comments

    * in remove_proc_entry() use pde_put(), when I fixed PDE refcounting to
    be normal one, remove_proc_entry() was supposed to do "-1" and code now
    reflects that.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Rename get_uflags() to stable_page_flags() and make it a global function
    for use in the hwpoison page flags filter, which need to compare user
    page flags with the value provided by user space.

    Also move KPF_* to kernel-page-flags.h for use by user space tools.

    Acked-by: Matt Mackall
    Signed-off-by: Andi Kleen
    CC: Nick Piggin
    CC: Christoph Lameter
    Signed-off-by: Wu Fengguang
    Signed-off-by: Andi Kleen

    Wu Fengguang
     
  • Setting a thread's comm to be something unique is a very useful ability
    and is helpful for debugging complicated threaded applications. However
    currently the only way to set a thread name is for the thread to name
    itself via the PR_SET_NAME prctl.

    However, there may be situations where it would be advantageous for a
    thread dispatcher to be naming the threads its managing, rather then
    having the threads self-describe themselves. This sort of behavior is
    available on other systems via the pthread_setname_np() interface.

    This patch exports a task's comm via proc/pid/comm and
    proc/pid/task/tid/comm interfaces, and allows thread siblings to write to
    these values.

    [akpm@linux-foundation.org: cleanups]
    Signed-off-by: John Stultz
    Cc: Andi Kleen
    Cc: Arjan van de Ven
    Cc: Mike Fulton
    Cc: Sean Foley
    Cc: Darren Hart
    Cc: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    john stultz
     
  • On no-MMU systems, sizes reported in /proc/n/statm have units of bytes.
    Per Documentation/filesystems/proc.txt, these values should be in pages.

    Signed-off-by: Steven J. Magnani
    Cc: Greg Ungerer
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Steven J. Magnani
     
  • This patch enables extraction of the pfn of a hugepage from
    /proc/pid/pagemap in an architecture independent manner.

    Details
    -------
    My test program (leak_pagemap) works as follows:
    - creat() and mmap() a file on hugetlbfs (file size is 200MB == 100 hugepages,)
    - read()/write() something on it,
    - call page-types with option -p,
    - munmap() and unlink() the file on hugetlbfs

    Without my patches
    ------------------
    $ ./leak_pagemap
    flags page-count MB symbolic-flags long-symbolic-flags
    0x0000000000000000 1 0 __________________________________
    0x0000000000000804 1 0 __R________M______________________ referenced,mmap
    0x000000000000086c 81 0 __RU_lA____M______________________ referenced,uptodate,lru,active,mmap
    0x0000000000005808 5 0 ___U_______Ma_b___________________ uptodate,mmap,anonymous,swapbacked
    0x0000000000005868 12 0 ___U_lA____Ma_b___________________ uptodate,lru,active,mmap,anonymous,swapbacked
    0x000000000000586c 1 0 __RU_lA____Ma_b___________________ referenced,uptodate,lru,active,mmap,anonymous,swapbacked
    total 101 0

    The output of page-types don't show any hugepage.

    With my patches
    ---------------
    $ ./leak_pagemap
    flags page-count MB symbolic-flags long-symbolic-flags
    0x0000000000000000 1 0 __________________________________
    0x0000000000030000 51100 199 ________________TG________________ compound_tail,huge
    0x0000000000028018 100 0 ___UD__________H_G________________ uptodate,dirty,compound_head,huge
    0x0000000000000804 1 0 __R________M______________________ referenced,mmap
    0x000000000000080c 1 0 __RU_______M______________________ referenced,uptodate,mmap
    0x000000000000086c 80 0 __RU_lA____M______________________ referenced,uptodate,lru,active,mmap
    0x0000000000005808 4 0 ___U_______Ma_b___________________ uptodate,mmap,anonymous,swapbacked
    0x0000000000005868 12 0 ___U_lA____Ma_b___________________ uptodate,lru,active,mmap,anonymous,swapbacked
    0x000000000000586c 1 0 __RU_lA____Ma_b___________________ referenced,uptodate,lru,active,mmap,anonymous,swapbacked
    total 51300 200

    The output of page-types shows 51200 pages contributing to hugepages,
    containing 100 head pages and 51100 tail pages as expected.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Naoya Horiguchi
    Cc: Andi Kleen
    Cc: Wu Fengguang
    Cc: Hugh Dickins
    Cc: Mel Gorman
    Cc: Lee Schermerhorn
    Cc: Andy Whitcroft
    Cc: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naoya Horiguchi
     

09 Dec, 2009

1 commit


08 Dec, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6: (43 commits)
    security/tomoyo: Remove now unnecessary handling of security_sysctl.
    security/tomoyo: Add a special case to handle accesses through the internal proc mount.
    sysctl: Drop & in front of every proc_handler.
    sysctl: Remove CTL_NONE and CTL_UNNUMBERED
    sysctl: kill dead ctl_handler definitions.
    sysctl: Remove the last of the generic binary sysctl support
    sysctl net: Remove unused binary sysctl code
    sysctl security/tomoyo: Don't look at ctl_name
    sysctl arm: Remove binary sysctl support
    sysctl x86: Remove dead binary sysctl support
    sysctl sh: Remove dead binary sysctl support
    sysctl powerpc: Remove dead binary sysctl support
    sysctl ia64: Remove dead binary sysctl support
    sysctl s390: Remove dead sysctl binary support
    sysctl frv: Remove dead binary sysctl support
    sysctl mips/lasat: Remove dead binary sysctl support
    sysctl drivers: Remove dead binary sysctl support
    sysctl crypto: Remove dead binary sysctl support
    sysctl security/keys: Remove dead binary sysctl support
    sysctl kernel: Remove binary sysctl logic
    ...

    Linus Torvalds