[PATCH 1/4] 2.6.2-rc2-mm2 CPU Hotplug: cpu_active_map

From: Rusty Russell (rusty_at_rustcorp.com.au)
Date: 01/31/04

  • Next message: Rusty Russell: "[PATCH 3/4] 2.6.2-rc2-mm2 CPU Hotplug: The Core"
    To: akpm@osdl.org
    Date:	Sun, 01 Feb 2004 01:16:35 +1100
    
    

    Hi Andrew et al.

            Forward ported to -mm tree, so there might still be bugs.
    Wanted to get these aired more widely. Especially get Nick exposed to
    the sched parts.

    Name: Create cpu_active_map
    Author: Rusty Russell
    Status: Booted on 2.6.2-rc2-bk2

    D: When CPUs are going down, there is a time when cpu_online(cpu) is
    D: false, but they are still scheduling and responding to interrupts
    D: (we are migrating things off the CPU, shutting down per-cpu
    D: threads, etc). It turns out that RCU cares about these CPUs, so
    D: the decision was made to expose this mask (previously internal to x86,
    D: and only used for IPIs).
    D:
    D: The semantics of this mask are as follows:
    D: 1) For platforms without hot unplug of CPUs: cpu_active_map ==
    D: cpu_online_map.
    D: 2) For the others, they are equal except for a CPU which is going
    D: down: cpu_online_map gets cleared by __cpu_disable(), cpu_ipi_map
    D: gets cleared in __cpu_die() once the CPU is no longer responding
    D: to interrupts.

    diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .25707-linux-2.6.0-test11-bk7/include/linux/cpumask.h .25707-linux-2.6.0-test11-bk7.updated/include/linux/cpumask.h
    --- .25707-linux-2.6.0-test11-bk7/include/linux/cpumask.h 2003-12-10 13:58:18.000000000 +1100
    +++ .25707-linux-2.6.0-test11-bk7.updated/include/linux/cpumask.h 2003-12-10 14:01:29.000000000 +1100
    @@ -43,6 +43,13 @@ typedef unsigned long cpumask_t;
     extern cpumask_t cpu_online_map;
     extern cpumask_t cpu_possible_map;
     
    +#ifdef CONFIG_HOTPLUG_CPU
    +/* Online, or on its way down but still receiving interrupts. */
    +extern cpumask_t cpu_active_map;
    +#else
    +#define cpu_active_map cpu_online_map
    +#endif
    +
     #define num_online_cpus() cpus_weight(cpu_online_map)
     #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
     #define cpu_possible(cpu) cpu_isset(cpu, cpu_possible_map)
    diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .25707-linux-2.6.0-test11-bk7/kernel/rcupdate.c .25707-linux-2.6.0-test11-bk7.updated/kernel/rcupdate.c
    --- .25707-linux-2.6.0-test11-bk7/kernel/rcupdate.c 2003-12-10 13:58:19.000000000 +1100
    +++ .25707-linux-2.6.0-test11-bk7.updated/kernel/rcupdate.c 2003-12-10 14:01:03.000000000 +1100
    @@ -110,7 +110,7 @@ static void rcu_start_batch(long newbatc
                 !cpus_empty(rcu_ctrlblk.rcu_cpu_mask)) {
                     return;
             }
    - rcu_ctrlblk.rcu_cpu_mask = cpu_online_map;
    + rcu_ctrlblk.rcu_cpu_mask = cpu_active_map;
     }
     
     /*

    --
      Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Rusty Russell: "[PATCH 3/4] 2.6.2-rc2-mm2 CPU Hotplug: The Core"

    Relevant Pages

    • Re: 2.6.27-rc6 xen soft lockup
      ... device interrupts are bound to vcpu 0 and there's nothing much else to ... During the time of the lockup the cpu load, as measured with cacti, was about 4% ... So I would say mostly idle ... # Device Drivers ...
      (Linux-Kernel)
    • Re: [parisc-linux] [patch 15/23] Add cmpxchg_local to parisc
      ... non-SMP-safe counter that protects updates against interrupts. ... could be vastely used in the kernel. ... "Local atomic operations only guarantee variable modification atomicity ... that only one CPU writes to the local_t data. ...
      (Linux-Kernel)
    • Re: program runs almost twice as slow on 2 CPU machine when 1 CPU
      ... As I said, from the system management tool's perspective, the term 'CPU ... load' means system and user threads vs idle thread - interrupts and DPC ... interrupts - only port and miniport drivers do it. ...
      (microsoft.public.win32.programmer.kernel)
    • Re: [PATCH] kexec: force x86_64 arches to boot kdump kernels on boot cpu
      ... Thats what I'm doing at the moment. ... unicast interrupts delivered accross the ht bus to a single cpu, ... that that broadcast bit was set. ...
      (Linux-Kernel)
    • Re: how can i disble irq15 through C/assembly programming.
      ... Well, these machines do not run Windows, do they? ... This condition is enforced by the CPU itself, ... interrupts as a whole, but the OP wants to disable interrupts only for ... disable interrupts on CPU Y..... ...
      (microsoft.public.win32.programmer.kernel)