06 Jan, 2009

4 commits

  • Remove bogus indentation of new_text_line declaration introduced in
    commit ac60ad741.

    Acked-by: Nick Andrew
    Signed-off-by: Jiri Kosina

    Jiri Kosina
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
    module: convert to stop_machine_create/destroy.
    stop_machine: introduce stop_machine_create/destroy.
    parisc: fix module loading failure of large kernel modules
    module: fix module loading failure of large kernel modules for parisc
    module: fix warning of unused function when !CONFIG_PROC_FS
    kernel/module.c: compare symbol values when marking symbols as exported in /proc/kallsyms.
    remove CONFIG_KMOD

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    inotify: fix type errors in interfaces
    fix breakage in reiserfs_new_inode()
    fix the treatment of jfs special inodes
    vfs: remove duplicate code in get_fs_type()
    add a vfs_fsync helper
    sys_execve and sys_uselib do not call into fsnotify
    zero i_uid/i_gid on inode allocation
    inode->i_op is never NULL
    ntfs: don't NULL i_op
    isofs check for NULL ->i_op in root directory is dead code
    affs: do not zero ->i_op
    kill suid bit only for regular files
    vfs: lseek(fd, 0, SEEK_CUR) race condition

    Linus Torvalds
     
  • ... and don't bother in callers. Don't bother with zeroing i_blocks,
    while we are at it - it's already been zeroed.

    i_mode is not worth the effort; it has no common default value.

    Signed-off-by: Al Viro

    Al Viro
     

05 Jan, 2009

23 commits

  • * 'audit.b61' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
    audit: validate comparison operations, store them in sane form
    clean up audit_rule_{add,del} a bit
    make sure that filterkey of task,always rules is reported
    audit rules ordering, part 2
    fixing audit rule ordering mess, part 1
    audit_update_lsm_rules() misses the audit_inode_hash[] ones
    sanitize audit_log_capset()
    sanitize audit_fd_pair()
    sanitize audit_mq_open()
    sanitize AUDIT_MQ_SENDRECV
    sanitize audit_mq_notify()
    sanitize audit_mq_getsetattr()
    sanitize audit_ipc_set_perm()
    sanitize audit_ipc_obj()
    sanitize audit_socketcall
    don't reallocate buffer in every audit_sockaddr()

    Linus Torvalds
     
  • The module code relies on a non-failing stop_machine call. So we create
    the kstop threads in advance and with that make sure the call won't fail.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Rusty Russell

    Heiko Carstens
     
  • Introduce stop_machine_create/destroy. With this interface subsystems
    that need a non-failing stop_machine environment can create the
    stop_machine machine threads before actually calling stop_machine.
    When the threads aren't needed anymore they can be killed with
    stop_machine_destroy again.

    When stop_machine gets called and the threads aren't present they
    will be created and destroyed automatically. This restores the old
    behaviour of stop_machine.

    This patch also converts cpu hotplug to the new interface since it
    is special: cpu_down calls __stop_machine instead of stop_machine.
    However the kstop threads will only be created when stop_machine
    gets called.

    Changing the code so that the threads would be created automatically
    on __stop_machine is currently not possible: when __stop_machine gets
    called we hold cpu_add_remove_lock, which is the same lock that
    create_rt_workqueue would take. So the workqueue needs to be created
    before the cpu hotplug code locks cpu_add_remove_lock.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Rusty Russell

    Heiko Carstens
     
  • When creating the final layout of a kernel module in memory, allow the
    module loader to reserve some additional memory in front of a given section.
    This is currently only needed for the parisc port which needs to put the
    stub entries there to fulfill the 17/22bit PCREL relocations with large
    kernel modules like xfs.

    Signed-off-by: Helge Deller
    Signed-off-by: Rusty Russell (renamed fn)

    Helge Deller
     
  • Fix this warning:
    kernel/module.c:824: warning: ‘print_unload_info’ defined but not used
    print_unload_info() just was used when CONFIG_PROC_FS was defined.
    This patch mark print_unload_info() inline to solve the problem.

    Signed-off-by: Jianjun Kong
    Signed-off-by: Rusty Russell
    CC: Ingo Molnar
    CC: Américo Wang

    Jianjun Kong
     
  • When there are two symbols in a module with the same name, one of which is
    exported, both will be marked as exported in /proc/kallsyms. There aren't
    any instances of this in the current kernel, but it is easy to construct a
    simple module with two compilation units that exhibits the problem.

    $ objdump -j .text -t testmod.ko | grep foo
    00000000 l F .text 00000032 foo
    00000080 g F .text 00000001 foo
    $ sudo insmod testmod.ko
    $ grep "T foo" /proc/kallsyms
    c28e8000 T foo [testmod]
    c28e8080 T foo [testmod]

    Fix this by comparing the symbol values once we've found the exported
    symbol table entry matching the symbol name. Tested using Ksplice:

    $ ksplice-create --patch=this_commit.patch --id=bar .
    $ sudo ksplice-apply ksplice-bar.tar.gz
    Done!
    $ grep "T foo" /proc/kallsyms
    c28e8080 T foo [testmod]

    Signed-off-by: Tim Abbott
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Rusty Russell

    Tim Abbott
     
  • The race is calling cgroup_clone() while umounting the ns cgroup subsys,
    and thus cgroup_clone() might access invalid cgroup_fs, or kill_sb() is
    called after cgroup_clone() created a new dir in it.

    The BUG I triggered is BUG_ON(root->number_of_cgroups != 1);

    ------------[ cut here ]------------
    kernel BUG at kernel/cgroup.c:1093!
    invalid opcode: 0000 [#1] SMP
    ...
    Process umount (pid: 5177, ti=e411e000 task=e40c4670 task.ti=e411e000)
    ...
    Call Trace:
    [] ? deactivate_super+0x3f/0x51
    [] ? mntput_no_expire+0xb3/0xdd
    [] ? sys_umount+0x265/0x2ac
    [] ? sys_oldumount+0xd/0xf
    [] ? sysenter_do_call+0x12/0x31
    ...
    EIP: [] cgroup_kill_sb+0x23/0xe0 SS:ESP 0068:e411ef2c
    ---[ end trace c766c1be3bf944ac ]---

    Cc: Serge E. Hallyn
    Signed-off-by: Li Zefan
    Cc: Paul Menage
    Cc: "Serge E. Hallyn"
    Cc: Balbir Singh
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Li Zefan
     
  • Don't store the field->op in the messy (and very inconvenient for e.g.
    audit_comparator()) form; translate to dense set of values and do full
    validation of userland-submitted value while we are at it.

    ->audit_init_rule() and ->audit_match_rule() get new values now; in-tree
    instances updated.

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Fix the actual rule listing; add per-type lists _not_ used for matching,
    with all exit,... sitting on one such list. Simplifies "do something
    for all rules" logics, while we are at it...

    Signed-off-by: Al Viro

    Al Viro
     
  • Problem: ordering between the rules on exit chain is currently lost;
    all watch and inode rules are listed after everything else _and_
    exit,never on one kind doesn't stop exit,always on another from
    being matched.

    Solution: assign priorities to rules, keep track of the current
    highest-priority matching rule and its result (always/never).

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • * no allocations
    * return void
    * don't duplicate checked for dummy context

    Signed-off-by: Al Viro

    Al Viro
     
  • * no allocations
    * return void

    Signed-off-by: Al Viro

    Al Viro
     
  • * don't bother with allocations
    * don't do double copy_from_user()
    * don't duplicate parts of check for audit_dummy_context()

    Signed-off-by: Al Viro

    Al Viro
     
  • * logging the original value of *msg_prio in mq_timedreceive(2)
    is insane - the argument is write-only (i.e. syscall always
    ignores the original value and only overwrites it).
    * merge __audit_mq_timed{send,receive}
    * don't do copy_from_user() twice
    * don't mess with allocations in auditsc part
    * ... and don't bother checking !audit_enabled and !context in there -
    we'd already checked for audit_dummy_context().

    Signed-off-by: Al Viro

    Al Viro
     
  • * don't copy_from_user() twice
    * don't bother with allocations
    * don't duplicate parts of audit_dummy_context()
    * make it return void

    Signed-off-by: Al Viro

    Al Viro
     
  • * get rid of allocations
    * make it return void
    * don't duplicate parts of audit_dummy_context()

    Signed-off-by: Al Viro

    Al Viro
     
  • * get rid of allocations
    * make it return void
    * simplify callers

    Signed-off-by: Al Viro

    Al Viro
     
  • * get rid of allocations
    * make it return void
    * simplify callers

    Signed-off-by: Al Viro

    Al Viro
     
  • * don't bother with allocations
    * now that it can't fail, make it return void

    Signed-off-by: Al Viro

    Al Viro
     
  • No need to do that more than once per process lifetime; allocating/freeing
    on each sendto/accept/etc. is bloody pointless.

    Signed-off-by: Al Viro

    Al Viro
     

04 Jan, 2009

6 commits

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

    * 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (77 commits)
    x86: setup_per_cpu_areas() cleanup
    cpumask: fix compile error when CONFIG_NR_CPUS is not defined
    cpumask: use alloc_cpumask_var_node where appropriate
    cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t
    x86: use cpumask_var_t in acpi/boot.c
    x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids
    sched: put back some stack hog changes that were undone in kernel/sched.c
    x86: enable cpus display of kernel_max and offlined cpus
    ia64: cpumask fix for is_affinity_mask_valid()
    cpumask: convert RCU implementations, fix
    xtensa: define __fls
    mn10300: define __fls
    m32r: define __fls
    h8300: define __fls
    frv: define __fls
    cris: define __fls
    cpumask: CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
    cpumask: zero extra bits in alloc_cpumask_var_node
    cpumask: replace for_each_cpu_mask_nr with for_each_cpu in kernel/time/
    cpumask: convert mm/
    ...

    Linus Torvalds
     
  • * 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
    [PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID
    [PATCH] improve idle cputime accounting
    [PATCH] improve precision of idle time detection.
    [PATCH] improve precision of process accounting.
    [PATCH] idle cputime accounting
    [PATCH] fix scaled & unscaled cputime accounting

    Linus Torvalds
     
  • Impact: prevents panic from stack overflow on numa-capable machines.

    Some of the "removal of stack hogs" changes in kernel/sched.c by using
    node_to_cpumask_ptr were undone by the early cpumask API updates, and
    causes a panic due to stack overflow. This patch undoes those changes
    by using cpumask_of_node() which returns a 'const struct cpumask *'.

    In addition, cpu_coregoup_map is replaced with cpu_coregroup_mask further
    reducing stack usage. (Both of these updates removed 9 FIXME's!)

    Also:
    Pick up some remaining changes from the old 'cpumask_t' functions to
    the new 'struct cpumask *' functions.

    Optimize memory traffic by allocating each percpu local_cpu_mask on the
    same node as the referring cpu.

    Signed-off-by: Mike Travis
    Acked-by: Rusty Russell
    Signed-off-by: Ingo Molnar

    Mike Travis
     
  • Impact: build fix on ia64

    ia64's default_affinity_write() still had old cpumask_t usage:

    /home/mingo/tip/kernel/irq/proc.c: In function `default_affinity_write':
    /home/mingo/tip/kernel/irq/proc.c:114: error: incompatible type for argument 1 of `is_affinity_mask_valid'
    make[3]: *** [kernel/irq/proc.o] Error 1
    make[3]: *** Waiting for unfinished jobs....

    update it to cpumask_var_t.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: cleanup

    This warning:

    kernel/rcuclassic.c: In function ‘rcu_start_batch’:
    kernel/rcuclassic.c:397: warning: passing argument 1 of ‘cpumask_andnot’ from incompatible pointer type

    triggers because one usage site of rcp->cpumask was not converted
    to to_cpumask(rcp->cpumask). There's no ill effects of this bug.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • …ux-2.6-cpumask into merge-rr-cpumask

    Conflicts:
    arch/x86/kernel/io_apic.c
    kernel/rcuclassic.c
    kernel/sched.c
    kernel/time/tick-sched.c

    Signed-off-by: Mike Travis <travis@sgi.com>
    [ mingo@elte.hu: backmerged typo fix for io_apic.c ]
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

    Mike Travis
     

03 Jan, 2009

1 commit

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

    * 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (66 commits)
    x86: export vector_used_by_percpu_irq
    x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()
    sched: nominate preferred wakeup cpu, fix
    x86: fix lguest used_vectors breakage, -v2
    x86: fix warning in arch/x86/kernel/io_apic.c
    sched: fix warning in kernel/sched.c
    sched: move test_sd_parent() to an SMP section of sched.h
    sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0
    sched: activate active load balancing in new idle cpus
    sched: bias task wakeups to preferred semi-idle packages
    sched: nominate preferred wakeup cpu
    sched: favour lower logical cpu number for sched_mc balance
    sched: framework for sched_mc/smt_power_savings=N
    sched: convert BALANCE_FOR_xx_POWER to inline functions
    x86: use possible_cpus=NUM to extend the possible cpus allowed
    x86: fix cpu_mask_to_apicid_and to include cpu_online_mask
    x86: update io_apic.c to the new cpumask code
    x86: Introduce topology_core_cpumask()/topology_thread_cpumask()
    x86: xen: use smp_call_function_many()
    x86: use work_on_cpu in x86/kernel/cpu/mcheck/mce_amd_64.c
    ...

    Fixed up trivial conflict in kernel/time/tick-sched.c manually

    Linus Torvalds
     

01 Jan, 2009

6 commits

  • Impact: cleanup

    Simple replacement, now the _nr is redundant.

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis
    Cc: Ingo Molnar

    Rusty Russell
     
  • Impact: Reduce stack usage, use new cpumask API.

    Mainly changing cpumask_t to 'struct cpumask' and similar simple API
    conversion. Two conversions worth mentioning:

    1) we use cpumask_any_but to avoid a temporary in kernel/softlockup.c,
    2) Use cpumask_var_t in taskstats_user_cmd().

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis
    Cc: Balbir Singh
    Cc: Ingo Molnar

    Rusty Russell
     
  • Impact: Reduce kernel stack and memory usage, use new cpumask API.

    Use cpumask_var_t for take_cpu_down() stack var, and frozen_cpus.

    Note that notify_cpu_starting() can be called before core_initcall
    allocates frozen_cpus, but the NULL check is optimized out by gcc for
    the CONFIG_CPUMASK_OFFSTACK=n case.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Impact: Reduce kernel memory usage, use new cpumask API.

    Avoid a static cpumask_t for prof_cpu_mask, and an on-stack cpumask_t
    in prof_cpu_mask_write_proc. Both become cpumask_var_t.

    prof_cpu_mask is only allocated when profiling is on, but the NULL
    checks are optimized out by gcc for the !CPUMASK_OFFSTACK case.

    Also removed some strange and unnecessary casts.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Impact: use new cpumask API.

    rcu_ctrlblk contains a cpumask, and it's highly optimized so I don't want
    a cpumask_var_t (ie. a pointer) for the CONFIG_CPUMASK_OFFSTACK case. It
    could use a dangling bitmap, and be allocated in __rcu_init to save memory,
    but for the moment we use a bitmap.

    (Eventually 'struct cpumask' will be undefined for CONFIG_CPUMASK_OFFSTACK,
    so we use a bitmap here to show we really mean it).

    We remove on-stack cpumasks, using cpumask_var_t for
    rcu_torture_shuffle_tasks() and for_each_cpu_and in force_quiescent_state().

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Impact: Reduce stack usage, use new cpumask API. ALPHA mod!

    Main change is that irq_default_affinity becomes a cpumask_var_t, so
    treat it as a pointer (this effects alpha).

    Signed-off-by: Rusty Russell

    Rusty Russell