02 Dec, 2009

1 commit

  • The motivation for an additional notifier in batched netdevice
    notification (rt_do_flush) only needs to be called once per batch not
    once per namespace.

    For further batching improvements I need a guarantee that the
    netdevices are unregistered in order allowing me to unregister an all
    of the network devices in a network namespace at the same time with
    the guarantee that the loopback device is really and truly
    unregistered last.

    Additionally it appears that we moved the route cache flush after
    the final synchronize_net, which seems wrong and there was no
    explanation. So I have restored the original location of the final
    synchronize_net.

    Cc: Octavian Purdila
    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

18 Nov, 2009

1 commit

  • This new event is called once for each unique net namespace in batched
    unregister operations (with the argument set to a random device from
    that namespace) and once per device in non-batched unregister
    operations.

    It allows us to factorize some device unregister work such as clearing the
    routing cache.

    Signed-off-by: Octavian Purdila
    Signed-off-by: David S. Miller

    Octavian Purdila
     

05 Oct, 2009

1 commit

  • For various purposes including a wireless extensions
    bugfix, we need to hook into the netdev creation before
    before netdev_register_kobject(). This will also ease
    doing the dev type assignment that Marcel was working
    on for cfg80211 drivers w/o touching them all.

    Signed-off-by: Johannes Berg
    Signed-off-by: Marcel Holtmann
    Signed-off-by: David S. Miller

    Johannes Berg
     

15 Sep, 2009

1 commit

  • This patch fixes commit e36b9d16c6a6d0f59803b3ef04ff3c22c3844c10. The approach
    there is to call dev_close()/dev_open() whenever the device type is changed in
    order to remap the device IP multicast addresses to HW multicast addresses.
    This approach suffers from 2 drawbacks:

    *. It assumes tha the device is UP when calling dev_close(), or otherwise
    dev_close() has no affect. It is worth to mention that initscripts (Redhat)
    and sysconfig (Suse) doesn't act the same in this matter.
    *. dev_close() has other side affects, like deleting entries from the routing
    table, which might be unnecessary.

    The fix here is to directly remap the IP multicast addresses to HW multicast
    addresses for a bonding device that changes its type, and nothing else.

    Reported-by: Jason Gunthorpe
    Signed-off-by: Moni Shoua
    Signed-off-by: David S. Miller

    Moni Shoua
     

04 Jun, 2009

1 commit

  • NETDEV_UP is called after the device is set UP, but sometimes
    it is useful to be able to veto the device UP. Introduce a
    new NETDEV_PRE_UP notifier that can be used for exactly this.
    The first use case will be cfg80211 denying interfaces to be
    set UP if the device is known to be rfkill'ed.

    Signed-off-by: Johannes Berg
    Acked-by: David S. Miller
    Signed-off-by: John W. Linville

    Johannes Berg
     

09 Sep, 2008

1 commit

  • Right now, there is no notifier that is called on a new cpu, before the new
    cpu begins processing interrupts/softirqs.
    Various kernel function would need that notification, e.g. kvm works around
    by calling smp_call_function_single(), rcu polls cpu_online_map.

    The patch adds a CPU_STARTING notification. It also adds a helper function
    that sends the message to all cpu_chain handlers.

    Tested on x86-64.
    All other archs are untested. Especially on sparc, I'm not sure if I got
    it right.

    Signed-off-by: Manfred Spraul
    Signed-off-by: Ingo Molnar

    Manfred Spraul
     

26 Jul, 2008

1 commit

  • workqueue_cpu_callback(CPU_DEAD) flushes cwq->thread under
    cpu_maps_update_begin(). This means that the multithreaded workqueues
    can't use get_online_cpus() due to the possible deadlock, very bad and
    very old problem.

    Introduce the new state, CPU_POST_DEAD, which is called after
    cpu_hotplug_done() but before cpu_maps_update_done().

    Change workqueue_cpu_callback() to use CPU_POST_DEAD instead of CPU_DEAD.
    This means that create/destroy functions can't rely on get_online_cpus()
    any longer and should take cpu_add_remove_lock instead.

    [akpm@linux-foundation.org: fix CONFIG_SMP=n]
    Signed-off-by: Oleg Nesterov
    Acked-by: Gautham R Shenoy
    Cc: Heiko Carstens
    Cc: Max Krasnyansky
    Cc: Paul Jackson
    Cc: Paul Menage
    Cc: Peter Zijlstra
    Cc: Vegard Nossum
    Cc: Martin Schwidefsky
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

18 Jun, 2008

1 commit

  • Add NETDEV_BONDING_FAILOVER event to be used in a successive patch
    by bonding to announce fail-over for the active-backup mode through the
    netdev events notifier chain mechanism. Such an event can be of use for the
    RDMA CM (communication manager) to let native RDMA ULPs (eg NFS-RDMA, iSER)
    always be aligned with the IP stack, in the sense that they use the same
    ports/links as the stack does. More usages can be done to allow monitoring
    tools based on netlink events being aware to bonding fail-over.

    Signed-off-by: Or Gerlitz
    Signed-off-by: Jay Vosburgh
    Signed-off-by: Jeff Garzik

    Or Gerlitz
     

29 Apr, 2008

1 commit

  • The enhancement as asked for by Yasunori: if msgmni is set to a negative
    value, register it back into the ipcns notifier chain.

    A new interface has been added to the notification mechanism:
    notifier_chain_cond_register() registers a notifier block only if not already
    registered. With that new interface we avoid taking care of the states
    changes in procfs.

    Signed-off-by: Nadia Derbey
    Cc: Yasunori Goto
    Cc: Matt Helsley
    Cc: Mingming Cao
    Cc: Pierre Peiffer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     

28 Apr, 2008

1 commit

  • Some accessibility modules need to be able to catch the output on the
    console before the VT interpretation, and possibly swallow it.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Samuel Thibault
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Karl Dahlke
     

02 Feb, 2008

1 commit


26 Jan, 2008

1 commit


20 Oct, 2007

3 commits

  • Some external modules like Speakup need to monitor console output.

    This adds a VT notifier that such modules can use to get console output events:
    allocation, deallocation, writes, other updates (cursor position, switch, etc.)

    [akpm@linux-foundation.org: fix headers_check]
    Signed-off-by: Samuel Thibault
    Cc: Dmitry Torokhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     
  • There is separate notifier header, but no separate notifier .c file.

    Extract notifier code out of kernel/sys.c which will remain for
    misc syscalls I hope. Merge kernel/die_notifier.c into kernel/notifier.c.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Some blind people use a kernel engine called Speakup which uses hardware
    synthesis to speak what gets displayed on the screen. They use the
    PC keyboard to control this engine (start/stop, accelerate, ...) and
    also need to get keyboard feedback (to make sure to know what they are
    typing, the caps lock status, etc.)

    Up to now, the way it was done was very ugly. Below is a patch to add a
    notifier list for permitting a far better implementation, see ChangeLog
    above for details.

    You may wonder why this can't be done at the input layer. The problem
    is that what people want to monitor is the console keyboard, i.e. all
    input keyboards that got attached to the console, and with the currently
    active keymap (i.e. keysyms, not only keycodes).

    This adds a keyboard notifier that such modules can use to get the keyboard
    events and possibly eat them, at several stages:

    - keycodes: even before translation into keysym.
    - unbound keycodes: when no keysym is bound.
    - unicode: when the keycode would get translated into a unicode character.
    - keysym: when the keycode would get translated into a keysym.
    - post_keysym: after the keysym got interpreted, so as to see the result
    (caps lock, etc.)

    This also provides access to k_handler so as to permit simulation of
    keypresses.

    [akpm@linux-foundation.org: various fixes]
    Signed-off-by: Samuel Thibault
    Cc: Jiri Kosina
    Cc: Dmitry Torokhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     

31 Jul, 2007

1 commit

  • This patch adds code to allow errors to be passed up from event
    handlers of NETDEV_REGISTER and NETDEV_CHANGENAME. It also adds
    the notifier_from_errno/notifier_to_errnor helpers to pass the
    errno value up to the notifier caller.

    If an error is detected when a device is registered, it causes
    that operation to fail. A NETDEV_UNREGISTER will be sent to
    all event handlers.

    Similarly if NETDEV_CHANGENAME fails the original name is restored
    and a new NETDEV_CHANGENAME event is sent.

    As such all event handlers must be idempotent with respect to
    these events.

    When an event handler is registered NETDEV_REGISTER events are
    sent for all devices currently registered. Should any of them
    fail, we will send NETDEV_GOING_DOWN/NETDEV_DOWN/NETDEV_UNREGISTER
    events to that handler for the devices which have already been
    registered with it. The handler registration itself will fail.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

20 Jul, 2007

1 commit

  • Make it possible to register hibernation and suspend notifiers, so that
    subsystems can perform hibernation-related or suspend-related operations that
    should not be carried out by device drivers' .suspend() and .resume()
    routines.

    [akpm@linux-foundation.org: build fixes]
    [akpm@linux-foundation.org: cleanups]
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Cc: Nigel Cunningham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

16 Jul, 2007

1 commit

  • KVM wants a notification when a cpu is about to die, so it can disable
    hardware extensions, but at a time when user processes cannot be scheduled
    on the cpu, so it doesn't try to use virtualization extensions after they
    have been disabled.

    This adds a CPU_DYING notification. The notification is called in atomic
    context on the doomed cpu.

    Signed-off-by: Avi Kivity

    Avi Kivity
     

10 May, 2007

3 commits

  • Since nonboot CPUs are now disabled after tasks and devices have been
    frozen and the CPU hotplug infrastructure is used for this purpose, we need
    special CPU hotplug notifications that will help the CPU-hotplug-aware
    subsystems distinguish normal CPU hotplug events from CPU hotplug events
    related to a system-wide suspend or resume operation in progress. This
    patch introduces such notifications and causes them to be used during
    suspend and resume transitions. It also changes all of the
    CPU-hotplug-aware subsystems to take these notifications into consideration
    (for now they are handled in the same way as the corresponding "normal"
    ones).

    [oleg@tv-sign.ru: cleanups]
    Signed-off-by: Rafael J. Wysocki
    Cc: Gautham R Shenoy
    Cc: Pavel Machek
    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • This is an attempt to provide an alternate mechanism for postponing
    a hotplug event instead of using a global mechanism like lock_cpu_hotplug.

    The proposal is to add two new events namely CPU_LOCK_ACQUIRE and
    CPU_LOCK_RELEASE. The notification for these two events would be sent
    out before and after a cpu_hotplug event respectively.

    During the CPU_LOCK_ACQUIRE event, a cpu-hotplug-aware subsystem is
    supposed to acquire any per-subsystem hotcpu mutex ( Eg. workqueue_mutex
    in kernel/workqueue.c ).

    During the CPU_LOCK_RELEASE release event the cpu-hotplug-aware subsystem
    is supposed to release the per-subsystem hotcpu mutex.

    The reasons for defining new events as opposed to reusing the existing events
    like CPU_UP_PREPARE/CPU_UP_FAILED/CPU_ONLINE for locking/unlocking of
    per-subsystem hotcpu mutexes are as follow:

    - CPU_LOCK_ACQUIRE: All hotcpu mutexes are taken before subsystems
    start handling pre-hotplug events like CPU_UP_PREPARE/CPU_DOWN_PREPARE
    etc, thus ensuring a clean handling of these events.

    - CPU_LOCK_RELEASE: The hotcpu mutexes will be released only after
    all subsystems have handled post-hotplug events like CPU_DOWN_FAILED,
    CPU_DEAD,CPU_ONLINE etc thereby ensuring that there are no subsequent
    clashes amongst the interdependent subsystems after a cpu hotplugs.

    This patch also uses __raw_notifier_call chain in _cpu_up to take care
    of the dependency between the two consequetive calls to
    raw_notifier_call_chain.

    [akpm@linux-foundation.org: fix a bug]
    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gautham R Shenoy
     
  • Since 2.6.18-something, the community has been bugged by the problem to
    provide a clean and a stable mechanism to postpone a cpu-hotplug event as
    lock_cpu_hotplug was badly broken.

    This is another proposal towards solving that problem. This one is along the
    lines of the solution provided in kernel/workqueue.c

    Instead of having a global mechanism like lock_cpu_hotplug, we allow the
    subsytems to define their own per-subsystem hot cpu mutexes. These would be
    taken(released) where ever we are currently calling
    lock_cpu_hotplug(unlock_cpu_hotplug).

    Also, in the per-subsystem hotcpu callback function,we take this mutex before
    we handle any pre-cpu-hotplug events and release it once we finish handling
    the post-cpu-hotplug events. A standard means for doing this has been
    provided in [PATCH 2/4] and demonstrated in [PATCH 3/4].

    The ordering of these per-subsystem mutexes might still prove to be a
    problem, but hopefully lockdep should help us get out of that muddle.

    The patch set to be applied against linux-2.6.19-rc5 is as follows:

    [PATCH 1/4] : Extend notifier_call_chain with an option to specify the
    number of notifications to be sent and also count the
    number of notifications actually sent.

    [PATCH 2/4] : Define events CPU_LOCK_ACQUIRE and CPU_LOCK_RELEASE
    and send out notifications for these in _cpu_up and
    _cpu_down. This would help us standardise the acquire and
    release of the subsystem locks in the hotcpu
    callback functions of these subsystems.

    [PATCH 3/4] : Eliminate lock_cpu_hotplug from kernel/sched.c.

    [PATCH 4/4] : In workqueue_cpu_callback function, acquire(release) the
    workqueue_mutex while handling
    CPU_LOCK_ACQUIRE(CPU_LOCK_RELEASE).

    If the per-subsystem-locking approach survives the test of time, we can expect
    a slow phasing out of lock_cpu_hotplug, which has not yet been eliminated in
    these patches :)

    This patch:

    Provide notifier_call_chain with an option to call only a specified number of
    notifiers and also record the number of call to notifiers made.

    The need for this enhancement was identified in the post entitled
    "Slab - Eliminate lock_cpu_hotplug from slab"
    (http://lkml.org/lkml/2006/10/28/92) by Ravikiran G Thirumalai and
    Andrew Morton.

    This patch adds two additional parameters to notifier_call_chain API namely
    - int nr_to_calls : Number of notifier_functions to be called.
    The don't care value is -1.

    - unsigned int *nr_calls : Records the total number of notifier_funtions
    called by notifier_call_chain. The don't care
    value is NULL.

    [michal.k.k.piotrowski@gmail.com: build fix]
    Credit: Andrew Morton
    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Michal Piotrowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gautham R Shenoy
     

04 Oct, 2006

1 commit

  • This patch (as751) adds a new type of notifier chain, based on the SRCU
    (Sleepable Read-Copy Update) primitives recently added to the kernel. An
    SRCU notifier chain is much like a blocking notifier chain, in that it must
    be called in process context and its callout routines are allowed to sleep.
    The difference is that the chain's links are protected by the SRCU
    mechanism rather than by an rw-semaphore, so calling the chain has
    extremely low overhead: no memory barriers and no cache-line bouncing. On
    the other hand, unregistering from the chain is expensive and the chain
    head requires special runtime initialization (plus cleanup if it is to be
    deallocated).

    SRCU notifiers are appropriate for notifiers that will be called very
    frequently and for which unregistration occurs very seldom. The proposed
    "task notifier" scheme qualifies, as may some of the network notifiers.

    Signed-off-by: Alan Stern
    Acked-by: Paul E. McKenney
    Acked-by: Chandra Seetharaman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Stern
     

04 Jul, 2006

1 commit


28 Mar, 2006

1 commit

  • The kernel's implementation of notifier chains is unsafe. There is no
    protection against entries being added to or removed from a chain while the
    chain is in use. The issues were discussed in this thread:

    http://marc.theaimsgroup.com/?l=linux-kernel&m=113018709002036&w=2

    We noticed that notifier chains in the kernel fall into two basic usage
    classes:

    "Blocking" chains are always called from a process context
    and the callout routines are allowed to sleep;

    "Atomic" chains can be called from an atomic context and
    the callout routines are not allowed to sleep.

    We decided to codify this distinction and make it part of the API. Therefore
    this set of patches introduces three new, parallel APIs: one for blocking
    notifiers, one for atomic notifiers, and one for "raw" notifiers (which is
    really just the old API under a new name). New kinds of data structures are
    used for the heads of the chains, and new routines are defined for
    registration, unregistration, and calling a chain. The three APIs are
    explained in include/linux/notifier.h and their implementation is in
    kernel/sys.c.

    With atomic and blocking chains, the implementation guarantees that the chain
    links will not be corrupted and that chain callers will not get messed up by
    entries being added or removed. For raw chains the implementation provides no
    guarantees at all; users of this API must provide their own protections. (The
    idea was that situations may come up where the assumptions of the atomic and
    blocking APIs are not appropriate, so it should be possible for users to
    handle these things in their own way.)

    There are some limitations, which should not be too hard to live with. For
    atomic/blocking chains, registration and unregistration must always be done in
    a process context since the chain is protected by a mutex/rwsem. Also, a
    callout routine for a non-raw chain must not try to register or unregister
    entries on its own chain. (This did happen in a couple of places and the code
    had to be changed to avoid it.)

    Since atomic chains may be called from within an NMI handler, they cannot use
    spinlocks for synchronization. Instead we use RCU. The overhead falls almost
    entirely in the unregister routine, which is okay since unregistration is much
    less frequent that calling a chain.

    Here is the list of chains that we adjusted and their classifications. None
    of them use the raw API, so for the moment it is only a placeholder.

    ATOMIC CHAINS
    -------------
    arch/i386/kernel/traps.c: i386die_chain
    arch/ia64/kernel/traps.c: ia64die_chain
    arch/powerpc/kernel/traps.c: powerpc_die_chain
    arch/sparc64/kernel/traps.c: sparc64die_chain
    arch/x86_64/kernel/traps.c: die_chain
    drivers/char/ipmi/ipmi_si_intf.c: xaction_notifier_list
    kernel/panic.c: panic_notifier_list
    kernel/profile.c: task_free_notifier
    net/bluetooth/hci_core.c: hci_notifier
    net/ipv4/netfilter/ip_conntrack_core.c: ip_conntrack_chain
    net/ipv4/netfilter/ip_conntrack_core.c: ip_conntrack_expect_chain
    net/ipv6/addrconf.c: inet6addr_chain
    net/netfilter/nf_conntrack_core.c: nf_conntrack_chain
    net/netfilter/nf_conntrack_core.c: nf_conntrack_expect_chain
    net/netlink/af_netlink.c: netlink_chain

    BLOCKING CHAINS
    ---------------
    arch/powerpc/platforms/pseries/reconfig.c: pSeries_reconfig_chain
    arch/s390/kernel/process.c: idle_chain
    arch/x86_64/kernel/process.c idle_notifier
    drivers/base/memory.c: memory_chain
    drivers/cpufreq/cpufreq.c cpufreq_policy_notifier_list
    drivers/cpufreq/cpufreq.c cpufreq_transition_notifier_list
    drivers/macintosh/adb.c: adb_client_list
    drivers/macintosh/via-pmu.c sleep_notifier_list
    drivers/macintosh/via-pmu68k.c sleep_notifier_list
    drivers/macintosh/windfarm_core.c wf_client_list
    drivers/usb/core/notify.c usb_notifier_list
    drivers/video/fbmem.c fb_notifier_list
    kernel/cpu.c cpu_chain
    kernel/module.c module_notify_list
    kernel/profile.c munmap_notifier
    kernel/profile.c task_exit_notifier
    kernel/sys.c reboot_notifier_list
    net/core/dev.c netdev_chain
    net/decnet/dn_dev.c: dnaddr_chain
    net/ipv4/devinet.c: inetaddr_chain

    It's possible that some of these classifications are wrong. If they are,
    please let us know or submit a patch to fix them. Note that any chain that
    gets called very frequently should be atomic, because the rwsem read-locking
    used for blocking chains is very likely to incur cache misses on SMP systems.
    (However, if the chain's callout routines may sleep then the chain cannot be
    atomic.)

    The patch set was written by Alan Stern and Chandra Seetharaman, incorporating
    material written by Keith Owens and suggestions from Paul McKenney and Andrew
    Morton.

    [jes@sgi.com: restructure the notifier chain initialization macros]
    Signed-off-by: Alan Stern
    Signed-off-by: Chandra Seetharaman
    Signed-off-by: Jes Sorensen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Stern
     

30 May, 2005

1 commit


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